diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2012-01-16 03:13:12 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2012-01-16 03:13:12 +0400 |
commit | e0df491d1e465588cc018c6f6d00f72739b71516 (patch) | |
tree | fe4cbcdaa4633545bbc817c28eb780b551e5ac05 /source/blender | |
parent | 76a211d80947a453f594e4cf0a1e0acc6786eddf (diff) | |
parent | 23806a2b7d50082d70a0e4ecab22aafb8433708a (diff) |
Merged changes in the trunk up to revision 43404.
Conflicts resolved:
source/blender/python/SConscript
Diffstat (limited to 'source/blender')
307 files changed, 7524 insertions, 4411 deletions
diff --git a/source/blender/blenfont/BLF_api.h b/source/blender/blenfont/BLF_api.h index 7490502c605..a045f47cb40 100644 --- a/source/blender/blenfont/BLF_api.h +++ b/source/blender/blenfont/BLF_api.h @@ -198,6 +198,8 @@ void BLF_dir_free(char **dirs, int count); #define BLF_MATRIX (1<<4) #define BLF_ASPECT (1<<5) +#define BLF_DRAW_STR_DUMMY_MAX 1024 + // XXX, bad design extern int blf_mono_font; extern int blf_mono_font_render; // dont mess drawing with render threads. diff --git a/source/blender/blenfont/intern/blf_lang.c b/source/blender/blenfont/intern/blf_lang.c index 6c27beb14a7..d96011f0f1e 100644 --- a/source/blender/blenfont/intern/blf_lang.c +++ b/source/blender/blenfont/intern/blf_lang.c @@ -104,6 +104,7 @@ static const char *locales[] = { "persian", "fa_PE", "indonesian", "id_ID", "serbian (latin)", "sr_RS@latin", + "kyrgyz", "ky", }; void BLF_lang_init(void) diff --git a/source/blender/blenkernel/BKE_armature.h b/source/blender/blenkernel/BKE_armature.h index 8836999bc9b..b301b7cf03b 100644 --- a/source/blender/blenkernel/BKE_armature.h +++ b/source/blender/blenkernel/BKE_armature.h @@ -82,7 +82,7 @@ void free_armature(struct bArmature *arm); void make_local_armature(struct bArmature *arm); struct bArmature *copy_armature(struct bArmature *arm); -int bone_autoside_name (char name[32], int strip_number, short axis, float head, float tail); +int bone_autoside_name (char name[64], int strip_number, short axis, float head, float tail); struct Bone *get_named_bone (struct bArmature *arm, const char *name); diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h index 49cde9d6517..3632eb33717 100644 --- a/source/blender/blenkernel/BKE_blender.h +++ b/source/blender/blenkernel/BKE_blender.h @@ -42,7 +42,7 @@ extern "C" { * and keep comment above the defines. * Use STRINGIFY() rather than defining with quotes */ #define BLENDER_VERSION 261 -#define BLENDER_SUBVERSION 1 +#define BLENDER_SUBVERSION 2 #define BLENDER_MINVERSION 250 #define BLENDER_MINSUBVERSION 0 diff --git a/source/blender/blenkernel/BKE_brush.h b/source/blender/blenkernel/BKE_brush.h index 32418384795..13f72634bda 100644 --- a/source/blender/blenkernel/BKE_brush.h +++ b/source/blender/blenkernel/BKE_brush.h @@ -59,7 +59,8 @@ int brush_clone_image_set_nr(struct Brush *brush, int nr); int brush_clone_image_delete(struct Brush *brush); /* jitter */ -void brush_jitter_pos(struct Brush *brush, float *pos, float *jitterpos); +void brush_jitter_pos(const struct Scene *scene, struct Brush *brush, + float *pos, float *jitterpos); /* brush curve */ void brush_curve_preset(struct Brush *b, /*enum CurveMappingPreset*/int preset); @@ -67,8 +68,8 @@ float brush_curve_strength_clamp(struct Brush *br, float p, const float len); float brush_curve_strength(struct Brush *br, float p, const float len); /* used for sculpt */ /* sampling */ -void brush_sample_tex(struct Brush *brush, float *xy, float *rgba, const int thread); -void brush_imbuf_new(struct Brush *brush, short flt, short texfalloff, int size, +void brush_sample_tex(const struct Scene *scene, struct Brush *brush, const float xy[2], float rgba[4], const int thread); +void brush_imbuf_new(const struct Scene *scene, struct Brush *brush, short flt, short texfalloff, int size, struct ImBuf **imbuf, int use_color_correction); /* painting */ @@ -76,7 +77,7 @@ struct BrushPainter; typedef struct BrushPainter BrushPainter; typedef int (*BrushFunc)(void *user, struct ImBuf *ibuf, float *lastpos, float *pos); -BrushPainter *brush_painter_new(struct Brush *brush); +BrushPainter *brush_painter_new(struct Scene *scene, struct Brush *brush); void brush_painter_require_imbuf(BrushPainter *painter, short flt, short texonly, int size); int brush_painter_paint(BrushPainter *painter, BrushFunc func, float *pos, @@ -92,23 +93,27 @@ struct ImBuf *brush_gen_radial_control_imbuf(struct Brush *br); /* unified strength and size */ -int brush_size(struct Brush *brush); -void brush_set_size(struct Brush *brush, int value); +int brush_size(const struct Scene *scene, struct Brush *brush); +void brush_set_size(struct Scene *scene, struct Brush *brush, int value); -int brush_use_locked_size(struct Brush *brush); -void brush_set_use_locked_size(struct Brush *brush, int value); +float brush_unprojected_radius(const struct Scene *scene, struct Brush *brush); +void brush_set_unprojected_radius(struct Scene *scene, struct Brush *brush, float value); -int brush_use_alpha_pressure(struct Brush *brush); -void brush_set_use_alpha_pressure(struct Brush *brush, int value); +float brush_alpha(const struct Scene *scene, struct Brush *brush); -int brush_use_size_pressure(struct Brush *brush); -void brush_set_use_size_pressure(struct Brush *brush, int value); +int brush_use_locked_size(const struct Scene *scene, struct Brush *brush); +int brush_use_alpha_pressure(const struct Scene *scene, struct Brush *brush); +int brush_use_size_pressure(const struct Scene *scene, struct Brush *brush); -float brush_unprojected_radius(struct Brush *brush); -void brush_set_unprojected_radius(struct Brush *brush, float value); +/* scale unprojected radius to reflect a change in the brush's 2D size */ +void brush_scale_unprojected_radius(float *unprojected_radius, + int new_brush_size, + int old_brush_size); -float brush_alpha(struct Brush *brush); -void brush_set_alpha(struct Brush *brush, float value); +/* scale brush size to reflect a change in the brush's unprojected radius */ +void brush_scale_size(int *brush_size, + float new_unprojected_radius, + float old_unprojected_radius); /* debugging only */ void brush_debug_print_state(struct Brush *br); diff --git a/source/blender/blenkernel/BKE_cloth.h b/source/blender/blenkernel/BKE_cloth.h index 2dfe9fd3402..62c3df7c6f4 100644 --- a/source/blender/blenkernel/BKE_cloth.h +++ b/source/blender/blenkernel/BKE_cloth.h @@ -85,6 +85,7 @@ typedef struct Cloth struct Implicit_Data *implicit; /* our implicit solver connects to this pointer */ struct Implicit_Data *implicitEM; /* our implicit solver connects to this pointer */ struct EdgeHash *edgehash; /* used for selfcollisions */ + int last_frame, pad4; } Cloth; /** diff --git a/source/blender/blenkernel/BKE_deform.h b/source/blender/blenkernel/BKE_deform.h index 9a27f292f36..11747899aa9 100644 --- a/source/blender/blenkernel/BKE_deform.h +++ b/source/blender/blenkernel/BKE_deform.h @@ -69,7 +69,7 @@ void defvert_normalize_lock(struct MDeformVert *dvert, const int def_nr_lock); /* utility function, note that 32 chars is the maximum string length since its only * used with defgroups currently */ -void flip_side_name(char name[32], const char from_name[32], int strip_number); +void flip_side_name(char name[64], const char from_name[64], int strip_number); #endif diff --git a/source/blender/blenkernel/BKE_movieclip.h b/source/blender/blenkernel/BKE_movieclip.h index b41f038941d..6f404bf5fee 100644 --- a/source/blender/blenkernel/BKE_movieclip.h +++ b/source/blender/blenkernel/BKE_movieclip.h @@ -47,7 +47,8 @@ struct MovieClip *BKE_add_movieclip_file(const char *name); void BKE_movieclip_reload(struct MovieClip *clip); struct ImBuf *BKE_movieclip_get_ibuf(struct MovieClip *clip, struct MovieClipUser *user); -struct ImBuf *BKE_movieclip_get_stable_ibuf(struct MovieClip *clip, struct MovieClipUser *user, float loc[2], float *scale, float *angle); +struct ImBuf *BKE_movieclip_get_postprocessed_ibuf(struct MovieClip *clip, struct MovieClipUser *user, int postprocess_flag); +struct ImBuf *BKE_movieclip_get_stable_ibuf(struct MovieClip *clip, struct MovieClipUser *user, float loc[2], float *scale, float *angle, int postprocess_flag); struct ImBuf *BKE_movieclip_get_ibuf_flag(struct MovieClip *clip, struct MovieClipUser *user, int flag); void BKE_movieclip_get_size(struct MovieClip *clip, struct MovieClipUser *user, int *width, int *height); void BKE_movieclip_aspect(struct MovieClip *clip, float *aspx, float *aspy); @@ -63,8 +64,10 @@ void BKE_movieclip_get_cache_segments(struct MovieClip *clip, struct MovieClipUs void BKE_movieclip_build_proxy_frame(struct MovieClip *clip, int clip_flag, struct MovieDistortion *distortion, int cfra, int *build_sizes, int build_count, int undistorted); -#define TRACK_CLEAR_UPTO 0 -#define TRACK_CLEAR_REMAINED 1 -#define TRACK_CLEAR_ALL 2 +/* postprocessing flags */ +#define MOVIECLIP_DISABLE_RED (1<<0) +#define MOVIECLIP_DISABLE_GREEN (1<<1) +#define MOVIECLIP_DISABLE_BLUE (1<<2) +#define MOVIECLIP_PREVIEW_GRAYSCALE (1<<3) #endif diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h index 9fdae5b190e..67de699c7c4 100644 --- a/source/blender/blenkernel/BKE_node.h +++ b/source/blender/blenkernel/BKE_node.h @@ -76,7 +76,7 @@ struct Object; */ typedef struct bNodeSocketTemplate { int type, limit; - char name[32]; + char name[64]; /* MAX_NAME */ float val1, val2, val3, val4; /* default alloc value for inputs */ float min, max; PropertySubType subtype; @@ -95,7 +95,7 @@ typedef void (*NodeSocketButtonFunction)(const struct bContext *C, struct uiBloc */ typedef struct bNodeSocketType { int type; - char ui_name[32]; + char ui_name[64]; /* MAX_NAME */ char ui_description[128]; int ui_icon; char ui_color[4]; @@ -125,7 +125,7 @@ typedef struct bNodeType { short needs_free; /* set for allocated types that need to be freed */ int type; - char name[32]; + char name[64]; /* MAX_NAME */ float width, minwidth, maxwidth; float height, minheight, maxheight; short nclass, flag, compatibility; @@ -522,6 +522,7 @@ struct ShadeResult; #define SH_NODE_VOLUME_TRANSPARENT 161 #define SH_NODE_VOLUME_ISOTROPIC 162 #define SH_NODE_GAMMA 163 +#define SH_NODE_TEX_CHECKER 164 /* custom defines options for Material node */ #define SH_NODE_MAT_DIFF 1 @@ -641,6 +642,7 @@ void ntreeGPUMaterialNodes(struct bNodeTree *ntree, struct GPUMaterial *mat); #define CMP_NODE_STABILIZE2D 263 #define CMP_NODE_TRANSFORM 264 #define CMP_NODE_MOVIEDISTORTION 265 +#define CMP_NODE_DOUBLEEDGEMASK 266 #define CMP_NODE_GLARE 301 #define CMP_NODE_TONEMAP 302 diff --git a/source/blender/blenkernel/BKE_sequencer.h b/source/blender/blenkernel/BKE_sequencer.h index 3a4ac279852..ed0730b7f09 100644 --- a/source/blender/blenkernel/BKE_sequencer.h +++ b/source/blender/blenkernel/BKE_sequencer.h @@ -306,7 +306,7 @@ typedef struct SeqLoadInfo { int tot_error; int len; /* only for image strips */ char path[512]; - char name[32]; + char name[64]; } SeqLoadInfo; /* SeqLoadInfo.flag */ diff --git a/source/blender/blenkernel/BKE_tracking.h b/source/blender/blenkernel/BKE_tracking.h index 7b3cb3f69bb..d3f297ece86 100644 --- a/source/blender/blenkernel/BKE_tracking.h +++ b/source/blender/blenkernel/BKE_tracking.h @@ -53,7 +53,8 @@ void BKE_tracking_track_flag(struct MovieTrackingTrack *track, int area, int fla struct MovieTrackingTrack *BKE_tracking_add_track(struct MovieTracking *tracking, struct ListBase *tracksbase, float x, float y, int framenr, int width, int height); -void BKE_tracking_insert_marker(struct MovieTrackingTrack *track, struct MovieTrackingMarker *marker); +struct MovieTrackingMarker *BKE_tracking_insert_marker(struct MovieTrackingTrack *track, + struct MovieTrackingMarker *marker); void BKE_tracking_delete_marker(struct MovieTrackingTrack *track, int framenr); struct MovieTrackingMarker *BKE_tracking_get_marker(struct MovieTrackingTrack *track, int framenr); @@ -96,6 +97,14 @@ struct ListBase *BKE_tracking_object_tracks(struct MovieTracking *tracking, stru struct MovieTrackingReconstruction *BKE_tracking_object_reconstruction(struct MovieTracking *tracking, struct MovieTrackingObject *object); +void BKE_tracking_disable_imbuf_channels(struct ImBuf *ibuf, int disable_red, int disable_green, int disable_blue, int grayscale); + +/* clipboard */ +void BKE_tracking_free_clipboard(void); +void BKE_tracking_clipboard_copy_tracks(struct MovieTracking *tracking, struct MovieTrackingObject *object); +int BKE_tracking_clipboard_has_tracks(void); +void BKE_tracking_clipboard_paste_tracks(struct MovieTracking *tracking, struct MovieTrackingObject *object); + /* 2D tracking */ struct MovieTrackingContext *BKE_tracking_context_new(struct MovieClip *clip, struct MovieClipUser *user, short backwards, short sequence); @@ -159,6 +168,10 @@ void BKE_tracking_deselect_track(struct MovieTrackingTrack *track, int area); #define MARKER_VISIBLE(sc, marker) (((marker)->flag&MARKER_DISABLED)==0 || ((sc)->flag&SC_HIDE_DISABLED)==0) +#define TRACK_CLEAR_UPTO 0 +#define TRACK_CLEAR_REMAINED 1 +#define TRACK_CLEAR_ALL 2 + #define CLAMP_PAT_DIM 1 #define CLAMP_PAT_POS 2 #define CLAMP_SEARCH_DIM 3 diff --git a/source/blender/blenkernel/BKE_writeavi.h b/source/blender/blenkernel/BKE_writeavi.h index 01a16be18ca..c906761f3d7 100644 --- a/source/blender/blenkernel/BKE_writeavi.h +++ b/source/blender/blenkernel/BKE_writeavi.h @@ -44,7 +44,8 @@ struct Scene; typedef struct bMovieHandle { int (*start_movie)(struct Scene *scene, struct RenderData *rd, int rectx, int recty, struct ReportList *reports); - int (*append_movie)(struct RenderData *rd, int frame, int *pixels, int rectx, int recty, struct ReportList *reports); + int (*append_movie)(struct RenderData *rd, int start_frame, int frame, int *pixels, + int rectx, int recty, struct ReportList *reports); void (*end_movie)(void); int (*get_next_frame)(struct RenderData *rd, struct ReportList *reports); /* optional */ void (*get_movie_path)(char *string, struct RenderData *rd); /* optional */ diff --git a/source/blender/blenkernel/BKE_writeffmpeg.h b/source/blender/blenkernel/BKE_writeffmpeg.h index 257ed0ba15f..e99dece0f7c 100644 --- a/source/blender/blenkernel/BKE_writeffmpeg.h +++ b/source/blender/blenkernel/BKE_writeffmpeg.h @@ -68,11 +68,13 @@ struct Scene; extern int start_ffmpeg(struct Scene *scene, struct RenderData *rd, int rectx, int recty, struct ReportList *reports); extern void end_ffmpeg(void); -extern int append_ffmpeg(struct RenderData *rd, int frame, int *pixels, int rectx, int recty, struct ReportList *reports); +extern int append_ffmpeg(struct RenderData *rd, int start_frame, int frame, int *pixels, + int rectx, int recty, struct ReportList *reports); void filepath_ffmpeg(char* string, struct RenderData* rd); extern void ffmpeg_set_preset(struct RenderData *rd, int preset); extern void ffmpeg_verify_image_type(struct RenderData *rd, struct ImageFormatData *imf); +extern void ffmpeg_verify_lossless_format(struct RenderData *rd, struct ImageFormatData *imf); extern struct IDProperty *ffmpeg_property_add(struct RenderData *Rd, const char *type, int opt_index, int parent_index); extern int ffmpeg_property_add_string(struct RenderData *rd, const char *type, const char *str); diff --git a/source/blender/blenkernel/BKE_writeframeserver.h b/source/blender/blenkernel/BKE_writeframeserver.h index 2117a23b938..040550d8faa 100644 --- a/source/blender/blenkernel/BKE_writeframeserver.h +++ b/source/blender/blenkernel/BKE_writeframeserver.h @@ -42,7 +42,8 @@ struct Scene; extern int start_frameserver(struct Scene *scene, struct RenderData *rd, int rectx, int recty, struct ReportList *reports); extern void end_frameserver(void); -extern int append_frameserver(struct RenderData *rd, int frame, int *pixels, int rectx, int recty, struct ReportList *reports); +extern int append_frameserver(struct RenderData *rd, int start_frame, int frame, int *pixels, + int rectx, int recty, struct ReportList *reports); extern int frameserver_loop(struct RenderData *rd, struct ReportList *reports); #ifdef __cplusplus diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index d0ef517e2ae..0ff46045f78 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -761,14 +761,28 @@ static void add_weight_mcol_dm(Object *ob, DerivedMesh *dm, int const draw_flag) Mesh *me = ob->data; unsigned char *wtcol_v = calc_weightpaint_vert_array(ob, draw_flag, coba); unsigned char *wtcol_f = MEM_mallocN (sizeof(unsigned char) * me->totface*4*4, "weightmap_f"); + unsigned char *wtcol_f_step = wtcol_f; MFace *mf = me->mface; int i; - for (i=0; i<me->totface; i++, mf++) { + for (i=0; i<me->totface; i++, mf++, wtcol_f_step += (4 * 4)) { +#if 0 unsigned int fidx= mf->v4 ? 3:2; + +#else /* better zero out triangles 4th component. else valgrind complains when the buffer's copied */ + unsigned int fidx; + if (mf->v4) { + fidx = 3; + } + else { + fidx = 2; + *(int *)(&wtcol_f_step[3 * 4]) = 0; + } +#endif + do { - copy_v4_v4_char((char *)&wtcol_f[(4 * i + fidx) * 4], + copy_v4_v4_char((char *)&wtcol_f_step[fidx * 4], (char *)&wtcol_v[4 * (*(&mf->v1 + fidx))]); } while (fidx--); } diff --git a/source/blender/blenkernel/intern/boids.c b/source/blender/blenkernel/intern/boids.c index ec2e6b3c078..d454bef3184 100644 --- a/source/blender/blenkernel/intern/boids.c +++ b/source/blender/blenkernel/intern/boids.c @@ -1503,7 +1503,7 @@ BoidState *boid_new_state(BoidSettings *boids) state->id = boids->last_state_id++; if(state->id) - sprintf(state->name, "State %i", state->id); + BLI_snprintf(state->name, sizeof(state->name), "State %i", state->id); else strcpy(state->name, "State"); diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c index 61064bede7e..362fa6e5e9a 100644 --- a/source/blender/blenkernel/intern/brush.c +++ b/source/blender/blenkernel/intern/brush.c @@ -487,14 +487,14 @@ int brush_clone_image_delete(Brush *brush) } /* Brush Sampling */ -void brush_sample_tex(Brush *brush, float *xy, float *rgba, const int thread) +void brush_sample_tex(const Scene *scene, Brush *brush, const float xy[2], float rgba[4], const int thread) { MTex *mtex= &brush->mtex; if (mtex && mtex->tex) { float co[3], tin, tr, tg, tb, ta; int hasrgb; - const int radius= brush_size(brush); + const int radius= brush_size(scene, brush); co[0]= xy[0]/radius; co[1]= xy[1]/radius; @@ -515,19 +515,20 @@ void brush_sample_tex(Brush *brush, float *xy, float *rgba, const int thread) rgba[3]= 1.0f; } } - else if (rgba) + else { rgba[0]= rgba[1]= rgba[2]= rgba[3]= 1.0f; + } } - -void brush_imbuf_new(Brush *brush, short flt, short texfall, int bufsize, ImBuf **outbuf, int use_color_correction) +/* TODO, use define for 'texfall' arg */ +void brush_imbuf_new(const Scene *scene, Brush *brush, short flt, short texfall, int bufsize, ImBuf **outbuf, int use_color_correction) { ImBuf *ibuf; - float xy[2], dist, rgba[4], *dstf; + float xy[2], rgba[4], *dstf; int x, y, rowbytes, xoff, yoff, imbflag; - const int radius= brush_size(brush); + const int radius= brush_size(scene, brush); char *dst, crgb[3]; - const float alpha= brush_alpha(brush); + const float alpha= brush_alpha(scene, brush); float brush_rgb[3]; imbflag= (flt)? IB_rectfloat: IB_rect; @@ -554,28 +555,23 @@ void brush_imbuf_new(Brush *brush, short flt, short texfall, int bufsize, ImBuf xy[1] = y + yoff; if (texfall == 0) { - dist = sqrt(xy[0]*xy[0] + xy[1]*xy[1]); - copy_v3_v3(dstf, brush_rgb); - dstf[3]= alpha*brush_curve_strength_clamp(brush, dist, radius); + dstf[3]= alpha*brush_curve_strength_clamp(brush, len_v2(xy), radius); } else if (texfall == 1) { - brush_sample_tex(brush, xy, dstf, 0); + brush_sample_tex(scene, brush, xy, dstf, 0); } else { - dist = sqrt(xy[0]*xy[0] + xy[1]*xy[1]); - - brush_sample_tex(brush, xy, rgba, 0); + brush_sample_tex(scene, brush, xy, rgba, 0); mul_v3_v3v3(dstf, rgba, brush_rgb); - dstf[3] = rgba[3]*alpha*brush_curve_strength_clamp(brush, dist, radius); + dstf[3] = rgba[3]*alpha*brush_curve_strength_clamp(brush, len_v2(xy), radius); } } } } else { - crgb[0]= FTOCHAR(brush->rgb[0]); - crgb[1]= FTOCHAR(brush->rgb[1]); - crgb[2]= FTOCHAR(brush->rgb[2]); + float alpha_f; /* final float alpha to convert to char */ + F3TOCHAR3(brush->rgb, crgb); for (y=0; y < ibuf->y; y++) { dst = (char*)ibuf->rect + y*rowbytes; @@ -585,36 +581,38 @@ void brush_imbuf_new(Brush *brush, short flt, short texfall, int bufsize, ImBuf xy[1] = y + yoff; if (texfall == 0) { - dist = sqrt(xy[0]*xy[0] + xy[1]*xy[1]); + alpha_f = alpha * brush_curve_strength(brush, len_v2(xy), radius); - dst[0]= crgb[0]; - dst[1]= crgb[1]; - dst[2]= crgb[2]; - dst[3]= FTOCHAR(alpha*brush_curve_strength(brush, dist, radius)); + dst[0] = crgb[0]; + dst[1] = crgb[1]; + dst[2] = crgb[2]; + dst[3] = FTOCHAR(alpha_f); } else if (texfall == 1) { - brush_sample_tex(brush, xy, rgba, 0); - dst[0]= FTOCHAR(rgba[0]); - dst[1]= FTOCHAR(rgba[1]); - dst[2]= FTOCHAR(rgba[2]); - dst[3]= FTOCHAR(rgba[3]); + brush_sample_tex(scene, brush, xy, rgba, 0); + dst[0] = FTOCHAR(rgba[0]); + dst[1] = FTOCHAR(rgba[1]); + dst[2] = FTOCHAR(rgba[2]); + dst[3] = FTOCHAR(rgba[3]); } else if (texfall == 2) { - dist = sqrt(xy[0]*xy[0] + xy[1]*xy[1]); - - brush_sample_tex(brush, xy, rgba, 0); - dst[0] = FTOCHAR(rgba[0]*brush->rgb[0]); - dst[1] = FTOCHAR(rgba[1]*brush->rgb[1]); - dst[2] = FTOCHAR(rgba[2]*brush->rgb[2]); - dst[3] = FTOCHAR(rgba[3]*alpha*brush_curve_strength_clamp(brush, dist, radius)); - } else { - dist = sqrt(xy[0]*xy[0] + xy[1]*xy[1]); - - brush_sample_tex(brush, xy, rgba, 0); - dst[0]= crgb[0]; - dst[1]= crgb[1]; - dst[2]= crgb[2]; - dst[3] = FTOCHAR(rgba[3]*alpha*brush_curve_strength_clamp(brush, dist, radius)); + brush_sample_tex(scene, brush, xy, rgba, 0); + mul_v3_v3(rgba, brush->rgb); + alpha_f = rgba[3] * alpha * brush_curve_strength_clamp(brush, len_v2(xy), radius); + + dst[0] = FTOCHAR(rgba[0]); + dst[1] = FTOCHAR(rgba[1]); + dst[2] = FTOCHAR(rgba[2]); + dst[3] = FTOCHAR(alpha_f); + } + else { + brush_sample_tex(scene, brush, xy, rgba, 0); + alpha_f = rgba[3] * alpha * brush_curve_strength_clamp(brush, len_v2(xy), radius); + + dst[0] = crgb[0]; + dst[1] = crgb[1]; + dst[2] = crgb[2]; + dst[3] = FTOCHAR(alpha_f); } } } @@ -623,6 +621,125 @@ void brush_imbuf_new(Brush *brush, short flt, short texfall, int bufsize, ImBuf *outbuf= ibuf; } +/* Unified Size and Strength */ + +// XXX: be careful about setting size and unprojected radius +// because they depend on one another +// these functions do not set the other corresponding value +// this can lead to odd behavior if size and unprojected +// radius become inconsistent. +// the biggest problem is that it isn't possible to change +// unprojected radius because a view context is not +// available. my ussual solution to this is to use the +// ratio of change of the size to change the unprojected +// radius. Not completely convinced that is correct. +// In anycase, a better solution is needed to prevent +// inconsistency. + +void brush_set_size(Scene *scene, Brush *brush, int size) +{ + UnifiedPaintSettings *ups = &scene->toolsettings->unified_paint_settings; + + if (ups->flag & UNIFIED_PAINT_SIZE) + ups->size= size; + else + brush->size= size; +} + +int brush_size(const Scene *scene, Brush *brush) +{ + UnifiedPaintSettings *ups = &scene->toolsettings->unified_paint_settings; + + return (ups->flag & UNIFIED_PAINT_SIZE) ? ups->size : brush->size; +} + +int brush_use_locked_size(const Scene *scene, Brush *brush) +{ + const short us_flag = scene->toolsettings->unified_paint_settings.flag; + + return (us_flag & UNIFIED_PAINT_SIZE) ? + (us_flag & UNIFIED_PAINT_BRUSH_LOCK_SIZE) : + (brush->flag & BRUSH_LOCK_SIZE); +} + +int brush_use_size_pressure(const Scene *scene, Brush *brush) +{ + const short us_flag = scene->toolsettings->unified_paint_settings.flag; + + return (us_flag & UNIFIED_PAINT_SIZE) ? + (us_flag & UNIFIED_PAINT_BRUSH_SIZE_PRESSURE) : + (brush->flag & BRUSH_SIZE_PRESSURE); +} + +int brush_use_alpha_pressure(const Scene *scene, Brush *brush) +{ + const short us_flag = scene->toolsettings->unified_paint_settings.flag; + + return (us_flag & UNIFIED_PAINT_ALPHA) ? + (us_flag & UNIFIED_PAINT_BRUSH_ALPHA_PRESSURE) : + (brush->flag & BRUSH_ALPHA_PRESSURE); +} + +void brush_set_unprojected_radius(Scene *scene, Brush *brush, float unprojected_radius) +{ + UnifiedPaintSettings *ups = &scene->toolsettings->unified_paint_settings; + + if (ups->flag & UNIFIED_PAINT_SIZE) + ups->unprojected_radius= unprojected_radius; + else + brush->unprojected_radius= unprojected_radius; +} + +float brush_unprojected_radius(const Scene *scene, Brush *brush) +{ + UnifiedPaintSettings *ups = &scene->toolsettings->unified_paint_settings; + + return (ups->flag & UNIFIED_PAINT_SIZE) ? + ups->unprojected_radius : + brush->unprojected_radius; +} + +static void brush_set_alpha(Scene *scene, Brush *brush, float alpha) +{ + UnifiedPaintSettings *ups = &scene->toolsettings->unified_paint_settings; + + if (ups->flag & UNIFIED_PAINT_ALPHA) + ups->alpha= alpha; + else + brush->alpha= alpha; +} + +float brush_alpha(const Scene *scene, Brush *brush) +{ + UnifiedPaintSettings *ups = &scene->toolsettings->unified_paint_settings; + + return (ups->flag & UNIFIED_PAINT_ALPHA) ? ups->alpha : brush->alpha; +} + +/* scale unprojected radius to reflect a change in the brush's 2D size */ +void brush_scale_unprojected_radius(float *unprojected_radius, + int new_brush_size, + int old_brush_size) +{ + float scale = new_brush_size; + /* avoid division by zero */ + if(old_brush_size != 0) + scale /= (float)old_brush_size; + (*unprojected_radius) *= scale; +} + +/* scale brush size to reflect a change in the brush's unprojected radius */ +void brush_scale_size(int *brush_size, + float new_unprojected_radius, + float old_unprojected_radius) +{ + float scale = new_unprojected_radius; + /* avoid division by zero */ + if(old_unprojected_radius != 0) + scale /= new_unprojected_radius; + (*brush_size)= (int)((float)(*brush_size) * scale); +} + /* Brush Painting */ typedef struct BrushPainterCache { @@ -642,6 +759,7 @@ typedef struct BrushPainterCache { } BrushPainterCache; struct BrushPainter { + Scene *scene; Brush *brush; float lastmousepos[2]; /* mouse position of last paint call */ @@ -665,16 +783,17 @@ struct BrushPainter { BrushPainterCache cache; }; -BrushPainter *brush_painter_new(Brush *brush) +BrushPainter *brush_painter_new(Scene *scene, Brush *brush) { BrushPainter *painter= MEM_callocN(sizeof(BrushPainter), "BrushPainter"); painter->brush= brush; + painter->scene= scene; painter->firsttouch= 1; painter->cache.lastsize= -1; /* force ibuf create in refresh */ - painter->startsize = brush_size(brush); - painter->startalpha = brush_alpha(brush); + painter->startsize = brush_size(scene, brush); + painter->startalpha = brush_alpha(scene, brush); painter->startjitter = brush->jitter; painter->startspacing = brush->spacing; @@ -707,8 +826,8 @@ void brush_painter_free(BrushPainter *painter) { Brush *brush = painter->brush; - brush_set_size(brush, painter->startsize); - brush_set_alpha(brush, painter->startalpha); + brush_set_size(painter->scene, brush, painter->startsize); + brush_set_alpha(painter->scene, brush, painter->startalpha); brush->jitter = painter->startjitter; brush->spacing = painter->startspacing; @@ -720,12 +839,13 @@ void brush_painter_free(BrushPainter *painter) static void brush_painter_do_partial(BrushPainter *painter, ImBuf *oldtexibuf, int x, int y, int w, int h, int xt, int yt, float *pos) { + Scene *scene= painter->scene; Brush *brush= painter->brush; ImBuf *ibuf, *maskibuf, *texibuf; float *bf, *mf, *tf, *otf=NULL, xoff, yoff, xy[2], rgba[4]; char *b, *m, *t, *ot= NULL; int dotexold, origx= x, origy= y; - const int radius= brush_size(brush); + const int radius= brush_size(painter->scene, brush); xoff = -radius + 0.5f; yoff = -radius + 0.5f; @@ -763,7 +883,7 @@ static void brush_painter_do_partial(BrushPainter *painter, ImBuf *oldtexibuf, i xy[0] = x + xoff; xy[1] = y + yoff; - brush_sample_tex(brush, xy, tf, 0); + brush_sample_tex(scene, brush, xy, tf, 0); } bf[0] = tf[0]*mf[0]; @@ -794,7 +914,7 @@ static void brush_painter_do_partial(BrushPainter *painter, ImBuf *oldtexibuf, i xy[0] = x + xoff; xy[1] = y + yoff; - brush_sample_tex(brush, xy, rgba, 0); + brush_sample_tex(scene, brush, xy, rgba, 0); t[0]= FTOCHAR(rgba[0]); t[1]= FTOCHAR(rgba[1]); t[2]= FTOCHAR(rgba[2]); @@ -812,11 +932,12 @@ static void brush_painter_do_partial(BrushPainter *painter, ImBuf *oldtexibuf, i static void brush_painter_fixed_tex_partial_update(BrushPainter *painter, float *pos) { + const Scene *scene= painter->scene; Brush *brush= painter->brush; BrushPainterCache *cache= &painter->cache; ImBuf *oldtexibuf, *ibuf; int imbflag, destx, desty, srcx, srcy, w, h, x1, y1, x2, y2; - const int diameter= 2*brush_size(brush); + const int diameter= 2*brush_size(scene, brush); imbflag= (cache->flt)? IB_rectfloat: IB_rect; if (!cache->ibuf) @@ -866,13 +987,14 @@ static void brush_painter_fixed_tex_partial_update(BrushPainter *painter, float static void brush_painter_refresh_cache(BrushPainter *painter, float *pos, int use_color_correction) { + const Scene *scene= painter->scene; Brush *brush= painter->brush; BrushPainterCache *cache= &painter->cache; MTex *mtex= &brush->mtex; int size; short flt; - const int diameter= 2*brush_size(brush); - const float alpha= brush_alpha(brush); + const int diameter= 2*brush_size(scene, brush); + const float alpha= brush_alpha(scene, brush); if (diameter != cache->lastsize || alpha != cache->lastalpha || @@ -891,11 +1013,11 @@ static void brush_painter_refresh_cache(BrushPainter *painter, float *pos, int u size= (cache->size)? cache->size: diameter; if (brush->flag & BRUSH_FIXED_TEX) { - brush_imbuf_new(brush, flt, 3, size, &cache->maskibuf, use_color_correction); + brush_imbuf_new(scene, brush, flt, 3, size, &cache->maskibuf, use_color_correction); brush_painter_fixed_tex_partial_update(painter, pos); } else - brush_imbuf_new(brush, flt, 2, size, &cache->ibuf, use_color_correction); + brush_imbuf_new(scene, brush, flt, 2, size, &cache->ibuf, use_color_correction); cache->lastsize= diameter; cache->lastalpha= alpha; @@ -917,17 +1039,17 @@ void brush_painter_break_stroke(BrushPainter *painter) static void brush_apply_pressure(BrushPainter *painter, Brush *brush, float pressure) { - if (brush_use_alpha_pressure(brush)) - brush_set_alpha(brush, MAX2(0.0f, painter->startalpha*pressure)); - if (brush_use_size_pressure(brush)) - brush_set_size(brush, MAX2(1.0f, painter->startsize*pressure)); + if (brush_use_alpha_pressure(painter->scene, brush)) + brush_set_alpha(painter->scene, brush, MAX2(0.0f, painter->startalpha*pressure)); + if (brush_use_size_pressure(painter->scene, brush)) + brush_set_size(painter->scene, brush, MAX2(1.0f, painter->startsize*pressure)); if (brush->flag & BRUSH_JITTER_PRESSURE) brush->jitter = MAX2(0.0f, painter->startjitter*pressure); if (brush->flag & BRUSH_SPACING_PRESSURE) brush->spacing = MAX2(1.0f, painter->startspacing*(1.5f-pressure)); } -void brush_jitter_pos(Brush *brush, float pos[2], float jitterpos[2]) +void brush_jitter_pos(const Scene *scene, Brush *brush, float pos[2], float jitterpos[2]) { int use_jitter= brush->jitter != 0; @@ -937,7 +1059,7 @@ void brush_jitter_pos(Brush *brush, float pos[2], float jitterpos[2]) if(use_jitter){ float rand_pos[2]; - const int radius= brush_size(brush); + const int radius= brush_size(scene, brush); const int diameter= 2*radius; // find random position within a circle of diameter 1 @@ -956,6 +1078,7 @@ void brush_jitter_pos(Brush *brush, float pos[2], float jitterpos[2]) int brush_painter_paint(BrushPainter *painter, BrushFunc func, float *pos, double time, float pressure, void *user, int use_color_correction) { + Scene *scene= painter->scene; Brush *brush= painter->brush; int totpaintops= 0; @@ -1017,7 +1140,7 @@ int brush_painter_paint(BrushPainter *painter, BrushFunc func, float *pos, doubl else { float startdistance, spacing, step, paintpos[2], dmousepos[2], finalpos[2]; float t, len, press; - const int radius= brush_size(brush); + const int radius= brush_size(scene, brush); /* compute brush spacing adapted to brush radius, spacing may depend on pressure, so update it */ @@ -1042,7 +1165,7 @@ int brush_painter_paint(BrushPainter *painter, BrushFunc func, float *pos, doubl brush_apply_pressure(painter, brush, press); spacing= MAX2(1.0f, radius)*brush->spacing*0.01f; - brush_jitter_pos(brush, paintpos, finalpos); + brush_jitter_pos(scene, brush, paintpos, finalpos); if (painter->cache.enabled) brush_painter_refresh_cache(painter, finalpos, use_color_correction); @@ -1056,7 +1179,7 @@ int brush_painter_paint(BrushPainter *painter, BrushFunc func, float *pos, doubl startdistance -= spacing; } } else { - brush_jitter_pos(brush, pos, finalpos); + brush_jitter_pos(scene, brush, pos, finalpos); if (painter->cache.enabled) brush_painter_refresh_cache(painter, finalpos, use_color_correction); @@ -1084,7 +1207,7 @@ int brush_painter_paint(BrushPainter *painter, BrushFunc func, float *pos, doubl while (painter->accumtime >= (double)brush->rate) { brush_apply_pressure(painter, brush, pressure); - brush_jitter_pos(brush, pos, finalpos); + brush_jitter_pos(scene, brush, pos, finalpos); if (painter->cache.enabled) brush_painter_refresh_cache(painter, finalpos, use_color_correction); @@ -1102,8 +1225,8 @@ int brush_painter_paint(BrushPainter *painter, BrushFunc func, float *pos, doubl painter->lastmousepos[1]= pos[1]; painter->lastpressure= pressure; - brush_set_alpha(brush, painter->startalpha); - brush_set_size(brush, painter->startsize); + brush_set_alpha(scene, brush, painter->startalpha); + brush_set_size(scene, brush, painter->startsize); brush->jitter = painter->startjitter; brush->spacing = painter->startspacing; @@ -1213,298 +1336,3 @@ struct ImBuf *brush_gen_radial_control_imbuf(Brush *br) return im; } - -/* Unified Size and Strength */ - -/* XXX, wouldnt it be better to only pass the active scene? - * this can return any old scene! - campbell*/ - -static void set_unified_settings(Brush *brush, short flag, int value) -{ - Scene *sce; - for (sce= G.main->scene.first; sce; sce= sce->id.next) { - if (sce->toolsettings && - ELEM4(brush, - paint_brush(&(sce->toolsettings->imapaint.paint)), - paint_brush(&(sce->toolsettings->vpaint->paint)), - paint_brush(&(sce->toolsettings->wpaint->paint)), - paint_brush(&(sce->toolsettings->sculpt->paint)))) - { - if (value) - sce->toolsettings->sculpt_paint_settings |= flag; - else - sce->toolsettings->sculpt_paint_settings &= ~flag; - } - } -} - -static short unified_settings(Brush *brush) -{ - Scene *sce; - for (sce= G.main->scene.first; sce; sce= sce->id.next) { - if (sce->toolsettings && - ELEM4(brush, - paint_brush(&(sce->toolsettings->imapaint.paint)), - paint_brush(&(sce->toolsettings->vpaint->paint)), - paint_brush(&(sce->toolsettings->wpaint->paint)), - paint_brush(&(sce->toolsettings->sculpt->paint)))) - { - return sce->toolsettings->sculpt_paint_settings; - } - } - - return 0; -} - -// XXX: be careful about setting size and unprojected radius -// because they depend on one another -// these functions do not set the other corresponding value -// this can lead to odd behavior if size and unprojected -// radius become inconsistent. -// the biggest problem is that it isn't possible to change -// unprojected radius because a view context is not -// available. my ussual solution to this is to use the -// ratio of change of the size to change the unprojected -// radius. Not completely convinced that is correct. -// In anycase, a better solution is needed to prevent -// inconsistency. - -static void set_unified_size(Brush *brush, int value) -{ - Scene *sce; - for (sce= G.main->scene.first; sce; sce= sce->id.next) { - if (sce->toolsettings && - ELEM4(brush, - paint_brush(&(sce->toolsettings->imapaint.paint)), - paint_brush(&(sce->toolsettings->vpaint->paint)), - paint_brush(&(sce->toolsettings->wpaint->paint)), - paint_brush(&(sce->toolsettings->sculpt->paint)))) - { - sce->toolsettings->sculpt_paint_unified_size= value; - } - } -} - -static int unified_size(Brush *brush) -{ - Scene *sce; - for (sce= G.main->scene.first; sce; sce= sce->id.next) { - if (sce->toolsettings && - ELEM4(brush, - paint_brush(&(sce->toolsettings->imapaint.paint)), - paint_brush(&(sce->toolsettings->vpaint->paint)), - paint_brush(&(sce->toolsettings->wpaint->paint)), - paint_brush(&(sce->toolsettings->sculpt->paint)))) - { - return sce->toolsettings->sculpt_paint_unified_size; - } - } - - return 35; // XXX magic number -} - -static void set_unified_alpha(Brush *brush, float value) -{ - Scene *sce; - for (sce= G.main->scene.first; sce; sce= sce->id.next) { - if (sce->toolsettings && - ELEM4(brush, - paint_brush(&(sce->toolsettings->imapaint.paint)), - paint_brush(&(sce->toolsettings->vpaint->paint)), - paint_brush(&(sce->toolsettings->wpaint->paint)), - paint_brush(&(sce->toolsettings->sculpt->paint)))) - { - sce->toolsettings->sculpt_paint_unified_alpha= value; - } - } -} - -static float unified_alpha(Brush *brush) -{ - Scene *sce; - for (sce= G.main->scene.first; sce; sce= sce->id.next) { - if (sce->toolsettings && - ELEM4(brush, - paint_brush(&(sce->toolsettings->imapaint.paint)), - paint_brush(&(sce->toolsettings->vpaint->paint)), - paint_brush(&(sce->toolsettings->wpaint->paint)), - paint_brush(&(sce->toolsettings->sculpt->paint)))) - { - return sce->toolsettings->sculpt_paint_unified_alpha; - } - } - - return 0.5f; // XXX magic number -} - -static void set_unified_unprojected_radius(Brush *brush, float value) -{ - Scene *sce; - for (sce= G.main->scene.first; sce; sce= sce->id.next) { - if (sce->toolsettings && - ELEM4(brush, - paint_brush(&(sce->toolsettings->imapaint.paint)), - paint_brush(&(sce->toolsettings->vpaint->paint)), - paint_brush(&(sce->toolsettings->wpaint->paint)), - paint_brush(&(sce->toolsettings->sculpt->paint)))) - { - sce->toolsettings->sculpt_paint_unified_unprojected_radius= value; - } - } -} - -static float unified_unprojected_radius(Brush *brush) -{ - Scene *sce; - for (sce= G.main->scene.first; sce; sce= sce->id.next) { - if (sce->toolsettings && - ELEM4(brush, - paint_brush(&(sce->toolsettings->imapaint.paint)), - paint_brush(&(sce->toolsettings->vpaint->paint)), - paint_brush(&(sce->toolsettings->wpaint->paint)), - paint_brush(&(sce->toolsettings->sculpt->paint)))) - { - return sce->toolsettings->sculpt_paint_unified_unprojected_radius; - } - } - - return 0.125f; // XXX magic number -} -void brush_set_size(Brush *brush, int size) -{ - const short us_flag = unified_settings(brush); - - if (us_flag & SCULPT_PAINT_USE_UNIFIED_SIZE) - set_unified_size(brush, size); - else - brush->size= size; - - //WM_main_add_notifier(NC_BRUSH|NA_EDITED, brush); -} - -int brush_size(Brush *brush) -{ - const short us_flag = unified_settings(brush); - - return (us_flag & SCULPT_PAINT_USE_UNIFIED_SIZE) ? unified_size(brush) : brush->size; -} - -void brush_set_use_locked_size(Brush *brush, int value) -{ - const short us_flag = unified_settings(brush); - - if (us_flag & SCULPT_PAINT_USE_UNIFIED_SIZE) { - set_unified_settings(brush, SCULPT_PAINT_UNIFIED_LOCK_BRUSH_SIZE, value); - } - else { - if (value) - brush->flag |= BRUSH_LOCK_SIZE; - else - brush->flag &= ~BRUSH_LOCK_SIZE; - } - - //WM_main_add_notifier(NC_BRUSH|NA_EDITED, brush); -} - -int brush_use_locked_size(Brush *brush) -{ - const short us_flag = unified_settings(brush); - - return (us_flag & SCULPT_PAINT_USE_UNIFIED_SIZE) ? - (us_flag & SCULPT_PAINT_UNIFIED_LOCK_BRUSH_SIZE) : - (brush->flag & BRUSH_LOCK_SIZE); -} - -void brush_set_use_size_pressure(Brush *brush, int value) -{ - const short us_flag = unified_settings(brush); - - if (us_flag & SCULPT_PAINT_USE_UNIFIED_SIZE) { - set_unified_settings(brush, SCULPT_PAINT_UNIFIED_SIZE_PRESSURE, value); - } - else { - if (value) - brush->flag |= BRUSH_SIZE_PRESSURE; - else - brush->flag &= ~BRUSH_SIZE_PRESSURE; - } - - //WM_main_add_notifier(NC_BRUSH|NA_EDITED, brush); -} - -int brush_use_size_pressure(Brush *brush) -{ - const short us_flag = unified_settings(brush); - - return (us_flag & SCULPT_PAINT_USE_UNIFIED_SIZE) ? - (us_flag & SCULPT_PAINT_UNIFIED_SIZE_PRESSURE) : - (brush->flag & BRUSH_SIZE_PRESSURE); -} - -void brush_set_use_alpha_pressure(Brush *brush, int value) -{ - const short us_flag = unified_settings(brush); - - if (us_flag & SCULPT_PAINT_USE_UNIFIED_ALPHA) { - set_unified_settings(brush, SCULPT_PAINT_UNIFIED_ALPHA_PRESSURE, value); - } - else { - if (value) - brush->flag |= BRUSH_ALPHA_PRESSURE; - else - brush->flag &= ~BRUSH_ALPHA_PRESSURE; - } - - //WM_main_add_notifier(NC_BRUSH|NA_EDITED, brush); -} - -int brush_use_alpha_pressure(Brush *brush) -{ - const short us_flag = unified_settings(brush); - - return (us_flag & SCULPT_PAINT_USE_UNIFIED_ALPHA) ? - (us_flag & SCULPT_PAINT_UNIFIED_ALPHA_PRESSURE) : - (brush->flag & BRUSH_ALPHA_PRESSURE); -} - -void brush_set_unprojected_radius(Brush *brush, float unprojected_radius) -{ - const short us_flag = unified_settings(brush); - - if (us_flag & SCULPT_PAINT_USE_UNIFIED_SIZE) - set_unified_unprojected_radius(brush, unprojected_radius); - else - brush->unprojected_radius= unprojected_radius; - - //WM_main_add_notifier(NC_BRUSH|NA_EDITED, brush); -} - -float brush_unprojected_radius(Brush *brush) -{ - const short us_flag = unified_settings(brush); - - return (us_flag & SCULPT_PAINT_USE_UNIFIED_SIZE) ? - unified_unprojected_radius(brush) : - brush->unprojected_radius; -} - -void brush_set_alpha(Brush *brush, float alpha) -{ - const short us_flag = unified_settings(brush); - - if (us_flag & SCULPT_PAINT_USE_UNIFIED_ALPHA) - set_unified_alpha(brush, alpha); - else - brush->alpha= alpha; - - //WM_main_add_notifier(NC_BRUSH|NA_EDITED, brush); -} - -float brush_alpha(Brush *brush) -{ - const short us_flag = unified_settings(brush); - - return (us_flag & SCULPT_PAINT_USE_UNIFIED_ALPHA) ? - unified_alpha(brush) : - brush->alpha; -} diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c index 4d5dce14b27..73428c889dc 100644 --- a/source/blender/blenkernel/intern/cloth.c +++ b/source/blender/blenkernel/intern/cloth.c @@ -47,7 +47,6 @@ #include "BKE_modifier.h" #include "BKE_pointcache.h" - #ifdef _WIN32 void tstart ( void ) {} @@ -377,6 +376,8 @@ static int do_init_cloth(Object *ob, ClothModifierData *clmd, DerivedMesh *resul } implicit_set_positions(clmd); + + clmd->clothObject->last_frame= MINFRAME-1; } return 1; @@ -477,6 +478,8 @@ DerivedMesh *clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob, do_step_cloth(ob, clmd, dm, framenr); cloth_to_object(ob, clmd, result); + clmd->clothObject->last_frame= framenr; + return result; } @@ -498,6 +501,7 @@ DerivedMesh *clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob, do_init_cloth(ob, clmd, dm, framenr); BKE_ptcache_validate(cache, framenr); cache->flag &= ~PTCACHE_REDO_NEEDED; + clmd->clothObject->last_frame= framenr; return result; } @@ -513,6 +517,8 @@ DerivedMesh *clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob, if(cache_result == PTCACHE_READ_INTERPOLATED && cache->flag & PTCACHE_REDO_NEEDED) BKE_ptcache_write(&pid, framenr); + clmd->clothObject->last_frame= framenr; + return result; } else if(cache_result==PTCACHE_READ_OLD) { @@ -524,6 +530,9 @@ DerivedMesh *clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob, return result; } + if(framenr!=clmd->clothObject->last_frame+1) + return result; + /* if on second frame, write cache for first frame */ if(cache->simframe == startframe && (cache->flag & PTCACHE_OUTDATED || cache->last_exact==0)) BKE_ptcache_write(&pid, startframe); @@ -540,6 +549,7 @@ DerivedMesh *clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob, BKE_ptcache_write(&pid, framenr); cloth_to_object (ob, clmd, result); + clmd->clothObject->last_frame= framenr; return result; } diff --git a/source/blender/blenkernel/intern/colortools.c b/source/blender/blenkernel/intern/colortools.c index 67bd6a22348..108b4e48a95 100644 --- a/source/blender/blenkernel/intern/colortools.c +++ b/source/blender/blenkernel/intern/colortools.c @@ -1002,7 +1002,7 @@ void scopes_update(Scopes *scopes, ImBuf *ibuf, int use_color_management) } /* we still need luma for histogram */ - luma = 0.299f * rgb[0] + 0.587f * rgb[1] + 0.114f * rgb[2]; + luma = rgb_to_luma(rgb); /* check for min max */ if(ycc_mode == -1 ) { diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c index 35b2499bea5..f840774222a 100644 --- a/source/blender/blenkernel/intern/customdata.c +++ b/source/blender/blenkernel/intern/customdata.c @@ -1519,7 +1519,7 @@ static CustomDataLayer *customData_add_layer__internal(CustomData *data, data->layers[index].data = newlayerdata; if(name || (name=typeInfo->defaultname)) { - BLI_strncpy(data->layers[index].name, name, 32); + BLI_strncpy(data->layers[index].name, name, sizeof(data->layers[index].name)); CustomData_set_layer_unique_name(data, index); } else diff --git a/source/blender/blenkernel/intern/deform.c b/source/blender/blenkernel/intern/deform.c index 6fb4164d6c6..3f3e3b80042 100644 --- a/source/blender/blenkernel/intern/deform.c +++ b/source/blender/blenkernel/intern/deform.c @@ -476,22 +476,22 @@ void flip_side_name(char name[MAX_VGROUP_NAME], const char from_name[MAX_VGROUP_ switch(name[0]) { case 'l': strcpy(replace, "r"); - strcpy(suffix, name+1); + BLI_strncpy(suffix, name+1, sizeof(suffix)); prefix[0]= 0; break; case 'r': strcpy(replace, "l"); - strcpy(suffix, name+1); + BLI_strncpy(suffix, name+1, sizeof(suffix)); prefix[0]= 0; break; case 'L': strcpy(replace, "R"); - strcpy(suffix, name+1); + BLI_strncpy(suffix, name+1, sizeof(suffix)); prefix[0]= 0; break; case 'R': strcpy(replace, "L"); - strcpy(suffix, name+1); + BLI_strncpy(suffix, name+1, sizeof(suffix)); prefix[0]= 0; break; } @@ -501,29 +501,29 @@ void flip_side_name(char name[MAX_VGROUP_NAME], const char from_name[MAX_VGROUP_ index = BLI_strcasestr(prefix, "right"); if (index==prefix || index==prefix+len-5) { if (index[0]=='r') - strcpy (replace, "left"); + strcpy(replace, "left"); else { if (index[1]=='I') - strcpy (replace, "LEFT"); + strcpy(replace, "LEFT"); else - strcpy (replace, "Left"); + strcpy(replace, "Left"); } *index= 0; - strcpy (suffix, index+5); + BLI_strncpy(suffix, index+5, sizeof(suffix)); } else { index = BLI_strcasestr(prefix, "left"); if (index==prefix || index==prefix+len-4) { if (index[0]=='l') - strcpy (replace, "right"); + strcpy(replace, "right"); else { if (index[1]=='E') - strcpy (replace, "RIGHT"); + strcpy(replace, "RIGHT"); else - strcpy (replace, "Right"); + strcpy(replace, "Right"); } *index= 0; - strcpy (suffix, index+4); + BLI_strncpy(suffix, index + 4, sizeof(suffix)); } } } diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c index a5be056bc16..17936a44a73 100644 --- a/source/blender/blenkernel/intern/displist.c +++ b/source/blender/blenkernel/intern/displist.c @@ -269,9 +269,9 @@ int surfindex_displist(DispList *dl, int a, int *b, int *p1, int *p2, int *p3, i (*b)= 1; } - if( (dl->flag & DL_CYCL_V) && a==dl->parts-1) { \ - (*p3)-= dl->nr*dl->parts; \ - (*p4)-= dl->nr*dl->parts; \ + if( (dl->flag & DL_CYCL_V) && a==dl->parts-1) { + (*p3)-= dl->nr*dl->parts; + (*p4)-= dl->nr*dl->parts; } return 1; diff --git a/source/blender/blenkernel/intern/dynamicpaint.c b/source/blender/blenkernel/intern/dynamicpaint.c index 567cc5ce07f..f93aee80ab8 100644 --- a/source/blender/blenkernel/intern/dynamicpaint.c +++ b/source/blender/blenkernel/intern/dynamicpaint.c @@ -361,8 +361,8 @@ void dynamicPaintSurface_updateType(struct DynamicPaintSurface *surface) surface->depth_clamp = 1.0f; } else { - sprintf(surface->output_name, "dp_"); - strcpy(surface->output_name2,surface->output_name); + strcpy(surface->output_name, "dp_"); + strcpy(surface->output_name2, surface->output_name); surface->flags &= ~MOD_DPAINT_ANTIALIAS; surface->depth_clamp = 0.0f; } @@ -1323,7 +1323,7 @@ void dynamicPaint_setInitialColor(DynamicPaintSurface *surface) MTFace *tface; MFace *mface = dm->getFaceArray(dm); int numOfFaces = dm->getNumFaces(dm); - char uvname[40]; + char uvname[MAX_CUSTOMDATA_LAYER_NAME]; if (!tex) return; @@ -1620,8 +1620,8 @@ static struct DerivedMesh *dynamicPaint_Modifier_apply(DynamicPaintModifierData } else { col[i*4+j].a = 255; - col[i*4+j].r = FTOCHAR(pPoint[index].wetness); - col[i*4+j].g = FTOCHAR(pPoint[index].wetness); + col[i*4+j].r = + col[i*4+j].g = col[i*4+j].b = FTOCHAR(pPoint[index].wetness); } } @@ -1671,8 +1671,8 @@ static struct DerivedMesh *dynamicPaint_Modifier_apply(DynamicPaintModifierData for (; j<((mface[i].v4)?4:3); j++) { int index = (j==0)?mface[i].v1: (j==1)?mface[i].v2: (j==2)?mface[i].v3: mface[i].v4; col[i*4+j].a = 255; - col[i*4+j].r = FTOCHAR(pPoint[index].wetness); - col[i*4+j].g = FTOCHAR(pPoint[index].wetness); + col[i*4+j].r = + col[i*4+j].g = col[i*4+j].b = FTOCHAR(pPoint[index].wetness); } } @@ -1877,7 +1877,8 @@ struct DerivedMesh *dynamicPaint_Modifier_do(DynamicPaintModifierData *pmd, Scen * px,py : origin pixel x and y * n_index : lookup direction index (use neighX,neighY to get final index) */ -static int dynamicPaint_findNeighbourPixel(PaintUVPoint *tempPoints, DerivedMesh *dm, char *uvname, int w, int h, int px, int py, int n_index) +static int dynamicPaint_findNeighbourPixel(PaintUVPoint *tempPoints, DerivedMesh *dm, + const char *uvname, int w, int h, int px, int py, int n_index) { /* Note: Current method only uses polygon edges to detect neighbouring pixels. * -> It doesn't always lead to the optimum pixel but is accurate enough @@ -2079,7 +2080,7 @@ int dynamicPaint_createUVSurface(DynamicPaintSurface *surface) int ty; int w,h; int numOfFaces; - char uvname[32]; + char uvname[MAX_CUSTOMDATA_LAYER_NAME]; int active_points = 0; int error = 0; diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index a5c8f5c905d..9e5917f0b07 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -950,6 +950,7 @@ char BKE_imtype_valid_channels(const char imtype) case R_IMF_IMTYPE_MULTILAYER: case R_IMF_IMTYPE_DDS: case R_IMF_IMTYPE_JP2: + case R_IMF_IMTYPE_QUICKTIME: chan_flag |= IMA_CHAN_FLAG_ALPHA; } @@ -1168,7 +1169,7 @@ static void stampdata(Scene *scene, Object *camera, StampData *stamp_data, int d char *name = scene_find_last_marker_name(scene, CFRA); if (name) BLI_strncpy(text, name, sizeof(text)); - else strcpy(text, "<none>"); + else BLI_strncpy(text, "<none>", sizeof(text)); BLI_snprintf(stamp_data->marker, sizeof(stamp_data->marker), do_prefix ? "Marker %s":"%s", text); } else { @@ -1202,14 +1203,14 @@ static void stampdata(Scene *scene, Object *camera, StampData *stamp_data, int d } if (scene->r.stamp & R_STAMP_FRAME) { - char format[32]; + char fmtstr[32]; int digits= 1; if(scene->r.efra>9) digits= 1 + (int) log10(scene->r.efra); - BLI_snprintf(format, sizeof(format), do_prefix ? "Frame %%0%di":"%%0%di", digits); - BLI_snprintf (stamp_data->frame, sizeof(stamp_data->frame), format, scene->r.cfra); + BLI_snprintf(fmtstr, sizeof(fmtstr), do_prefix ? "Frame %%0%di":"%%0%di", digits); + BLI_snprintf (stamp_data->frame, sizeof(stamp_data->frame), fmtstr, scene->r.cfra); } else { stamp_data->frame[0] = '\0'; } @@ -1224,7 +1225,7 @@ static void stampdata(Scene *scene, Object *camera, StampData *stamp_data, int d if (camera && camera->type == OB_CAMERA) { BLI_snprintf(text, sizeof(text), "%.2f", ((Camera *)camera->data)->lens); } - else strcpy(text, "<none>"); + else BLI_strncpy(text, "<none>", sizeof(text)); BLI_snprintf(stamp_data->cameralens, sizeof(stamp_data->cameralens), do_prefix ? "Lens %s":"%s", text); } else { @@ -1241,7 +1242,7 @@ static void stampdata(Scene *scene, Object *camera, StampData *stamp_data, int d Sequence *seq= seq_foreground_frame_get(scene, scene->r.cfra); if (seq) BLI_strncpy(text, seq->name+2, sizeof(text)); - else strcpy(text, "<none>"); + else BLI_strncpy(text, "<none>", sizeof(text)); BLI_snprintf(stamp_data->strip, sizeof(stamp_data->strip), do_prefix ? "Strip %s":"%s", text); } else { diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c index 9890a2629fc..40fe3626848 100644 --- a/source/blender/blenkernel/intern/ipo.c +++ b/source/blender/blenkernel/intern/ipo.c @@ -328,9 +328,9 @@ static char *shapekey_adrcodes_to_paths (int adrcode, int *UNUSED(array_index)) /* block will be attached to ID_KE block, and setting that we alter is the 'value' (which sets keyblock.curval) */ // XXX adrcode 0 was dummy 'speed' curve if (adrcode == 0) - sprintf(buf, "speed"); + strcpy(buf, "speed"); else - sprintf(buf, "key_blocks[%d].value", adrcode); + BLI_snprintf(buf, sizeof(buf), "key_blocks[%d].value", adrcode); return buf; } @@ -915,7 +915,7 @@ static char *get_rna_access (int blocktype, int adrcode, char actname[], char co /* note, strings are not escapted and they should be! */ if ((actname && actname[0]) && (constname && constname[0])) { /* Constraint in Pose-Channel */ - sprintf(buf, "pose.bones[\"%s\"].constraints[\"%s\"]", actname, constname); + BLI_snprintf(buf, sizeof(buf), "pose.bones[\"%s\"].constraints[\"%s\"]", actname, constname); } else if (actname && actname[0]) { if ((blocktype == ID_OB) && strcmp(actname, "Object")==0) { @@ -928,16 +928,16 @@ static char *get_rna_access (int blocktype, int adrcode, char actname[], char co } else { /* Pose-Channel */ - sprintf(buf, "pose.bones[\"%s\"]", actname); + BLI_snprintf(buf, sizeof(buf), "pose.bones[\"%s\"]", actname); } } else if (constname && constname[0]) { /* Constraint in Object */ - sprintf(buf, "constraints[\"%s\"]", constname); + BLI_snprintf(buf, sizeof(buf), "constraints[\"%s\"]", constname); } else if (seq) { /* Sequence names in Scene */ - sprintf(buf, "sequence_editor.sequences_all[\"%s\"]", seq->name+2); + BLI_snprintf(buf, sizeof(buf), "sequence_editor.sequences_all[\"%s\"]", seq->name+2); } else { buf[0]= '\0'; /* empty string */ @@ -954,7 +954,7 @@ static char *get_rna_access (int blocktype, int adrcode, char actname[], char co /* if there was no array index pointer provided, add it to the path */ if (array_index == NULL) { - sprintf(buf, "[\"%d\"]", dummy_index); + BLI_snprintf(buf, sizeof(buf), "[\"%d\"]", dummy_index); BLI_dynstr_append(path, buf); } diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index a79f4a2628b..d7985914f25 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -1006,7 +1006,7 @@ static void IDnames_to_dyn_pupstring(DynStr *pupds, ListBase *lb, ID *link, shor ID *id; for (i=0, id= lb->first; id; id= id->next, i++) { - char buf[32]; + char numstr[32]; if (nr && id==link) *nr= i+1; @@ -1017,12 +1017,12 @@ static void IDnames_to_dyn_pupstring(DynStr *pupds, ListBase *lb, ID *link, shor if ( ((Image *)id)->source==IMA_SRC_VIEWER ) continue; - get_flags_for_id(id, buf); + get_flags_for_id(id, numstr); - BLI_dynstr_append(pupds, buf); + BLI_dynstr_append(pupds, numstr); BLI_dynstr_append(pupds, id->name+2); - BLI_snprintf(buf, sizeof(buf), "%%x%d", i+1); - BLI_dynstr_append(pupds, buf); + BLI_snprintf(numstr, sizeof(numstr), "%%x%d", i+1); + BLI_dynstr_append(pupds, numstr); /* icon */ switch(GS(id->name)) @@ -1032,8 +1032,8 @@ static void IDnames_to_dyn_pupstring(DynStr *pupds, ListBase *lb, ID *link, shor case ID_IM: /* fall through */ case ID_WO: /* fall through */ case ID_LA: /* fall through */ - BLI_snprintf(buf, sizeof(buf), "%%i%d", BKE_icon_getid(id) ); - BLI_dynstr_append(pupds, buf); + BLI_snprintf(numstr, sizeof(numstr), "%%i%d", BKE_icon_getid(id) ); + BLI_dynstr_append(pupds, numstr); break; default: break; @@ -1151,10 +1151,12 @@ static int check_for_dupid(ListBase *lb, ID *id, char *name) { ID *idtest; int nr= 0, nrtest, a, left_len; - char left[32], leftest[32], in_use[32]; + char in_use[64]; /* use as a boolean array, unrelated to name length */ + + char left[MAX_ID_NAME + 8], leftest[MAX_ID_NAME + 8]; /* make sure input name is terminated properly */ - /* if( strlen(name) > 21 ) name[21]= 0; */ + /* if( strlen(name) > MAX_ID_NAME-3 ) name[MAX_ID_NAME-3]= 0; */ /* removed since this is only ever called from one place - campbell */ while (1) { @@ -1166,20 +1168,20 @@ static int check_for_dupid(ListBase *lb, ID *id, char *name) if( idtest == NULL ) return 0; /* we have a dup; need to make a new name */ - /* quick check so we can reuse one of first 32 ids if vacant */ + /* quick check so we can reuse one of first 64 ids if vacant */ memset(in_use, 0, sizeof(in_use)); /* get name portion, number portion ("name.number") */ left_len= BLI_split_name_num(left, &nr, name, '.'); /* if new name will be too long, truncate it */ - if(nr > 999 && left_len > 16) { - left[16]= 0; - left_len= 16; + if(nr > 999 && left_len > (MAX_ID_NAME - 8)) { + left[MAX_ID_NAME - 8]= 0; + left_len= MAX_ID_NAME - 8; } - else if(left_len > 17) { - left[17]= 0; - left_len= 17; + else if(left_len > (MAX_ID_NAME - 7)) { + left[MAX_ID_NAME - 7]= 0; + left_len= MAX_ID_NAME - 7; } for(idtest= lb->first; idtest; idtest= idtest->next) { @@ -1221,11 +1223,11 @@ static int check_for_dupid(ListBase *lb, ID *id, char *name) /* otherwise just continue and use a number suffix */ } - if(nr > 999 && left_len > 16) { + if(nr > 999 && left_len > (MAX_ID_NAME - 8)) { /* this would overflow name buffer */ - left[16] = 0; - /* left_len = 16; */ /* for now this isnt used again */ - memcpy(name, left, sizeof(char) * 17); + left[MAX_ID_NAME - 8] = 0; + /* left_len = MAX_ID_NAME - 8; */ /* for now this isnt used again */ + memcpy(name, left, sizeof(char) * (MAX_ID_NAME - 7)); continue; } /* this format specifier is from hell... */ @@ -1260,7 +1262,7 @@ int new_id(ListBase *lb, ID *id, const char *tname) strncpy(name, tname, sizeof(name)-1); - /* if result > 21, strncpy don't put the final '\0' to name. + /* if result > MAX_ID_NAME-3, strncpy don't put the final '\0' to name. * easier to assign each time then to check if its needed */ name[sizeof(name)-1]= 0; diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c index 9f98a83dcf8..5f7f7ab5920 100644 --- a/source/blender/blenkernel/intern/material.c +++ b/source/blender/blenkernel/intern/material.c @@ -51,6 +51,7 @@ #include "BLI_listbase.h" #include "BLI_utildefines.h" #include "BLI_bpath.h" +#include "BLI_string.h" #include "BKE_animsys.h" #include "BKE_displist.h" @@ -1615,7 +1616,7 @@ static void calculate_tface_materialname(char *matname, char *newname, int flag) int digits = integer_getdigits(flag); /* clamp the old name, remove the MA prefix and add the .TF.flag suffix e.g. matname = "MALoooooooooooooongName"; newname = "Loooooooooooooon.TF.2" */ - sprintf(newname, "%.*s.TF.%0*d", MAX_ID_NAME-(digits+5), matname, digits, flag); + BLI_snprintf(newname, MAX_ID_NAME, "%.*s.TF.%0*d", MAX_ID_NAME-(digits+5), matname, digits, flag); } /* returns -1 if no match */ @@ -1662,8 +1663,8 @@ static short convert_tfacenomaterial(Main *main, Mesh *me, MTFace *tf, int flag) short mat_nr= -1; /* new material, the name uses the flag*/ - sprintf(idname, "MAMaterial.TF.%0*d", integer_getdigits(flag), flag); - + BLI_snprintf(idname, sizeof(idname), "MAMaterial.TF.%0*d", integer_getdigits(flag), flag); + if ((ma= BLI_findstring(&main->mat, idname+2, offsetof(ID, name)+2))) { mat_nr= mesh_getmaterialnumber(me, ma); /* assign the material to the mesh */ diff --git a/source/blender/blenkernel/intern/mball.c b/source/blender/blenkernel/intern/mball.c index 57fc7473860..fe2c10d7091 100644 --- a/source/blender/blenkernel/intern/mball.c +++ b/source/blender/blenkernel/intern/mball.c @@ -356,7 +356,7 @@ int is_basis_mball(Object *ob) int is_mball_basis_for(Object *ob1, Object *ob2) { int basis1nr, basis2nr; - char basis1name[32], basis2name[32]; + char basis1name[MAX_ID_NAME], basis2name[MAX_ID_NAME]; BLI_split_name_num(basis1name, &basis1nr, ob1->id.name+2, '.'); BLI_split_name_num(basis2name, &basis2nr, ob2->id.name+2, '.'); @@ -378,7 +378,7 @@ void copy_mball_properties(Scene *scene, Object *active_object) Object *ob; MetaBall *active_mball = (MetaBall*)active_object->data; int basisnr, obnr; - char basisname[32], obname[32]; + char basisname[MAX_ID_NAME], obname[MAX_ID_NAME]; BLI_split_name_num(basisname, &basisnr, active_object->id.name+2, '.'); @@ -423,7 +423,7 @@ Object *find_basis_mball(Scene *scene, Object *basis) Object *ob,*bob= basis; MetaElem *ml=NULL; int basisnr, obnr; - char basisname[32], obname[32]; + char basisname[MAX_ID_NAME], obname[MAX_ID_NAME]; BLI_split_name_num(basisname, &basisnr, basis->id.name+2, '.'); totelem= 0; @@ -1596,7 +1596,7 @@ float init_meta(Scene *scene, Object *ob) /* return totsize */ float size, totsize, obinv[4][4], obmat[4][4], vec[3]; //float max=0.0; int a, obnr, zero_size=0; - char obname[32]; + char obname[MAX_ID_NAME]; copy_m4_m4(obmat, ob->obmat); /* to cope with duplicators from next_object */ invert_m4_m4(obinv, ob->obmat); @@ -1619,7 +1619,7 @@ float init_meta(Scene *scene, Object *ob) /* return totsize */ else ml= mb->elems.first; } else { - char name[32]; + char name[MAX_ID_NAME]; int nr; BLI_split_name_num(name, &nr, bob->id.name+2, '.'); diff --git a/source/blender/blenkernel/intern/movieclip.c b/source/blender/blenkernel/intern/movieclip.c index 4c78ab13874..3b1dc2973ad 100644 --- a/source/blender/blenkernel/intern/movieclip.c +++ b/source/blender/blenkernel/intern/movieclip.c @@ -257,18 +257,30 @@ typedef struct MovieClipCache { /* regular movie cache */ struct MovieCache *moviecache; - /* cache for stable shot */ - int stable_framenr; - float stable_loc[2], stable_scale, stable_angle; - ImBuf *stableibuf; - int proxy; - short render_flag; + /* cached postprocessed shot */ + struct { + ImBuf *ibuf; + int framenr; + int flag; - /* cache for undistorted shot */ - int undist_framenr; - float principal[2]; - float k1, k2, k3; - ImBuf *undistibuf; + /* cache for undistorted shot */ + float principal[2]; + float k1, k2, k3; + short undistoriton_used; + + int proxy; + short render_flag; + } postprocessed; + + /* cache for stable shot */ + struct { + ImBuf *ibuf; + int framenr; + + float loc[2], scale, angle; + int proxy; + short render_flag; + } stabilized; } MovieClipCache; typedef struct MovieClipImBufCacheKey { @@ -465,111 +477,179 @@ static void real_ibuf_size(MovieClip *clip, MovieClipUser *user, ImBuf *ibuf, in } } -static int need_undistorted_cache(MovieClipUser *user, int flag) +static ImBuf *get_undistorted_ibuf(MovieClip *clip, struct MovieDistortion *distortion, ImBuf *ibuf) +{ + ImBuf *undistibuf; + + /* XXX: because of #27997 do not use float buffers to undistort, + otherwise, undistorted proxy can be darker than it should */ + imb_freerectfloatImBuf(ibuf); + + if(distortion) + undistibuf= BKE_tracking_distortion_exec(distortion, &clip->tracking, ibuf, ibuf->x, ibuf->y, 0.0f, 1); + else + undistibuf= BKE_tracking_undistort(&clip->tracking, ibuf, ibuf->x, ibuf->y, 0.0f); + + if(undistibuf->userflags&IB_RECT_INVALID) { + ibuf->userflags&= ~IB_RECT_INVALID; + IMB_rect_from_float(undistibuf); + } + + IMB_scaleImBuf(undistibuf, ibuf->x, ibuf->y); + + return undistibuf; +} + +static int need_undistortion_postprocess(MovieClipUser *user, int flag) { + int result = 0; + /* only full undistorted render can be used as on-fly undistorting image */ - if(flag&MCLIP_USE_PROXY) { - if(user->render_size != MCLIP_PROXY_RENDER_SIZE_FULL || (user->render_flag&MCLIP_PROXY_RENDER_UNDISTORT)==0) - return 0; + if(flag & MCLIP_USE_PROXY) { + result |= (user->render_size == MCLIP_PROXY_RENDER_SIZE_FULL) && + (user->render_flag & MCLIP_PROXY_RENDER_UNDISTORT) != 0; } - else return 0; - return 1; + return result; } -static ImBuf *get_undistorted_cache(MovieClip *clip, MovieClipUser *user) +static int need_postprocessed_frame(MovieClipUser *user, int flag, int postprocess_flag) +{ + int result = postprocess_flag; + + result |= need_undistortion_postprocess(user, flag); + + return result; +} + +static int check_undistortion_cache_flags(MovieClip *clip) { MovieClipCache *cache= clip->cache; MovieTrackingCamera *camera= &clip->tracking.camera; + + /* check for distortion model changes */ + if(!equals_v2v2(camera->principal, cache->postprocessed.principal)) + return 0; + + if(!equals_v3v3(&camera->k1, &cache->postprocessed.k1)) + return 0; + + return 1; +} + +static ImBuf *get_postprocessed_cached_frame(MovieClip *clip, MovieClipUser *user, int flag, int postprocess_flag) +{ + MovieClipCache *cache= clip->cache; int framenr= user->framenr; + short proxy= IMB_PROXY_NONE; + int render_flag= 0; - /* no cache or no cached undistorted image */ - if(!clip->cache || !clip->cache->undistibuf) + if(flag&MCLIP_USE_PROXY) { + proxy= rendersize_to_proxy(user, flag); + render_flag= user->render_flag; + } + + /* no cache or no cached postprocessed image */ + if(!clip->cache || !clip->cache->postprocessed.ibuf) return NULL; - /* undistortion happened for other frame */ - if(cache->undist_framenr!=framenr) + /* postprocessing happened for other frame */ + if(cache->postprocessed.framenr != framenr) return NULL; - /* check for distortion model changes */ - if(!equals_v2v2(camera->principal, cache->principal)) + /* cached ibuf used different proxy settings */ + if(cache->postprocessed.render_flag != render_flag || cache->postprocessed.proxy != proxy) return NULL; - if(!equals_v3v3(&camera->k1, &cache->k1)) + if(cache->postprocessed.flag != postprocess_flag) return NULL; - IMB_refImBuf(cache->undistibuf); + if(need_undistortion_postprocess(user, flag)) { + if(!check_undistortion_cache_flags(clip)) + return NULL; + } + else if(cache->postprocessed.undistoriton_used) + return NULL; - return cache->undistibuf; + IMB_refImBuf(cache->postprocessed.ibuf); + + return cache->postprocessed.ibuf; } -static ImBuf *get_undistorted_ibuf(MovieClip *clip, struct MovieDistortion *distortion, ImBuf *ibuf) +static ImBuf *put_postprocessed_frame_to_cache(MovieClip *clip, MovieClipUser *user, ImBuf *ibuf, int flag, int postprocess_flag) { - ImBuf *undistibuf; + MovieClipCache *cache= clip->cache; + MovieTrackingCamera *camera= &clip->tracking.camera; + ImBuf *postproc_ibuf = NULL; - /* XXX: because of #27997 do not use float buffers to undistort, - otherwise, undistorted proxy can be darker than it should */ - imb_freerectfloatImBuf(ibuf); + if(cache->postprocessed.ibuf) + IMB_freeImBuf(cache->postprocessed.ibuf); - if(distortion) - undistibuf= BKE_tracking_distortion_exec(distortion, &clip->tracking, ibuf, ibuf->x, ibuf->y, 0.0f, 1); - else - undistibuf= BKE_tracking_undistort(&clip->tracking, ibuf, ibuf->x, ibuf->y, 0.0f); + cache->postprocessed.framenr= user->framenr; + cache->postprocessed.flag = postprocess_flag; - if(undistibuf->userflags&IB_RECT_INVALID) { - ibuf->userflags&= ~IB_RECT_INVALID; - IMB_rect_from_float(undistibuf); + if(flag&MCLIP_USE_PROXY) { + cache->postprocessed.proxy= rendersize_to_proxy(user, flag); + cache->postprocessed.render_flag= user->render_flag; + } + else { + cache->postprocessed.proxy = IMB_PROXY_NONE; + cache->postprocessed.render_flag = 0; } - IMB_scaleImBuf(undistibuf, ibuf->x, ibuf->y); + if(need_undistortion_postprocess(user, flag)) { + copy_v2_v2(cache->postprocessed.principal, camera->principal); + copy_v3_v3(&cache->postprocessed.k1, &camera->k1); + cache->postprocessed.undistoriton_used = 1; + postproc_ibuf= get_undistorted_ibuf(clip, NULL, ibuf); + } + else cache->postprocessed.undistoriton_used = 0; - return undistibuf; -} + if(postprocess_flag) { + int disable_red = postprocess_flag & MOVIECLIP_DISABLE_RED, + disable_green = postprocess_flag & MOVIECLIP_DISABLE_GREEN, + disable_blue = postprocess_flag & MOVIECLIP_DISABLE_BLUE, + grayscale = postprocess_flag & MOVIECLIP_PREVIEW_GRAYSCALE; -static ImBuf *put_undistorted_cache(MovieClip *clip, MovieClipUser *user, ImBuf *ibuf) -{ - MovieClipCache *cache= clip->cache; - MovieTrackingCamera *camera= &clip->tracking.camera; + if(!postproc_ibuf) + postproc_ibuf = IMB_dupImBuf(ibuf); - copy_v2_v2(cache->principal, camera->principal); - copy_v3_v3(&cache->k1, &camera->k1); - cache->undist_framenr= user->framenr; + if(disable_red || disable_green || disable_blue || grayscale) + BKE_tracking_disable_imbuf_channels(postproc_ibuf, disable_red, disable_green, disable_blue, 1); + } - if(cache->undistibuf) - IMB_freeImBuf(cache->undistibuf); + IMB_refImBuf(postproc_ibuf); - cache->undistibuf= get_undistorted_ibuf(clip, NULL, ibuf); + cache->postprocessed.ibuf= postproc_ibuf; - if(cache->stableibuf) { + if(cache->stabilized.ibuf) { /* force stable buffer be re-calculated */ - IMB_freeImBuf(cache->stableibuf); - cache->stableibuf= NULL; + IMB_freeImBuf(cache->stabilized.ibuf); + cache->stabilized.ibuf= NULL; } - IMB_refImBuf(cache->undistibuf); - - return cache->undistibuf; + return postproc_ibuf; } -ImBuf *BKE_movieclip_get_ibuf(MovieClip *clip, MovieClipUser *user) +static ImBuf *movieclip_get_postprocessed_ibuf(MovieClip *clip, MovieClipUser *user, int flag, int postprocess_flag) { ImBuf *ibuf= NULL; - int framenr= user->framenr; - int cache_undistorted= 0; + int framenr= user->framenr, need_postprocess= 0; /* cache isn't threadsafe itself and also loading of movies can't happen from concurent threads that's why we use lock here */ BLI_lock_thread(LOCK_MOVIECLIP); - /* try to obtain cached undistorted image first */ - if(need_undistorted_cache(user, clip->flag)) { - ibuf= get_undistorted_cache(clip, user); + /* try to obtain cached postprocessed frame first */ + if(need_postprocessed_frame(user, flag, postprocess_flag)) { + ibuf= get_postprocessed_cached_frame(clip, user, flag, postprocess_flag); + if(!ibuf) - cache_undistorted= 1; + need_postprocess= 1; } if(!ibuf) - ibuf= get_imbuf_cache(clip, user, clip->flag); + ibuf= get_imbuf_cache(clip, user, flag); if(!ibuf) { int use_sequence= 0; @@ -579,23 +659,23 @@ ImBuf *BKE_movieclip_get_ibuf(MovieClip *clip, MovieClipUser *user) (user->render_size!=MCLIP_PROXY_RENDER_SIZE_FULL); if(clip->source==MCLIP_SRC_SEQUENCE || use_sequence) - ibuf= movieclip_load_sequence_file(clip, user, framenr, clip->flag); + ibuf= movieclip_load_sequence_file(clip, user, framenr, flag); else { - ibuf= movieclip_load_movie_file(clip, user, framenr, clip->flag); + ibuf= movieclip_load_movie_file(clip, user, framenr, flag); } if(ibuf) - put_imbuf_cache(clip, user, ibuf, clip->flag); + put_imbuf_cache(clip, user, ibuf, flag); } if(ibuf) { clip->lastframe= framenr; real_ibuf_size(clip, user, ibuf, &clip->lastsize[0], &clip->lastsize[1]); - /* put undistorted frame to cache */ - if(cache_undistorted) { + /* postprocess frame and put to cache */ + if(need_postprocess) { ImBuf *tmpibuf= ibuf; - ibuf= put_undistorted_cache(clip, user, tmpibuf); + ibuf= put_postprocessed_frame_to_cache(clip, user, tmpibuf, flag, postprocess_flag); IMB_freeImBuf(tmpibuf); } } @@ -605,105 +685,113 @@ ImBuf *BKE_movieclip_get_ibuf(MovieClip *clip, MovieClipUser *user) return ibuf; } +ImBuf *BKE_movieclip_get_ibuf(MovieClip *clip, MovieClipUser *user) +{ + return BKE_movieclip_get_ibuf_flag(clip, user, clip->flag); +} + ImBuf *BKE_movieclip_get_ibuf_flag(MovieClip *clip, MovieClipUser *user, int flag) { - ImBuf *ibuf= NULL; - int framenr= user->framenr; - int cache_undistorted= 0; + return movieclip_get_postprocessed_ibuf(clip, user, flag, 0); +} - /* cache isn't threadsafe itself and also loading of movies - can't happen from concurent threads that's why we use lock here */ - BLI_lock_thread(LOCK_MOVIECLIP); +ImBuf *BKE_movieclip_get_postprocessed_ibuf(MovieClip *clip, MovieClipUser *user, int postprocess_flag) +{ + return movieclip_get_postprocessed_ibuf(clip, user, clip->flag, postprocess_flag); +} - /* try to obtain cached undistorted image first */ - if(need_undistorted_cache(user, flag)) { - ibuf= get_undistorted_cache(clip, user); - if(!ibuf) - cache_undistorted= 1; +static ImBuf *get_stable_cached_frame(MovieClip *clip, MovieClipUser *user, int framenr) +{ + MovieClipCache *cache = clip->cache; + ImBuf *stableibuf; + float tloc[2], tscale, tangle; + short proxy = IMB_PROXY_NONE; + int render_flag = 0; + + if(clip->flag&MCLIP_USE_PROXY) { + proxy = rendersize_to_proxy(user, clip->flag); + render_flag = user->render_flag; } - ibuf= get_imbuf_cache(clip, user, flag); + /* there's no cached frame or it was calculated for another frame */ + if(!cache->stabilized.ibuf || cache->stabilized.framenr != framenr) + return NULL; - if(!ibuf) { - if(clip->source==MCLIP_SRC_SEQUENCE) { - ibuf= movieclip_load_sequence_file(clip, user, framenr, flag); - } else { - ibuf= movieclip_load_movie_file(clip, user, framenr, flag); - } + /* cached ibuf used different proxy settings */ + if(cache->stabilized.render_flag!=render_flag || cache->stabilized.proxy!=proxy) + return NULL; - if(ibuf) { - int bits= MCLIP_USE_PROXY|MCLIP_USE_PROXY_CUSTOM_DIR; + stableibuf = cache->stabilized.ibuf; - if((flag&bits)==(clip->flag&bits)) - put_imbuf_cache(clip, user, ibuf, clip->flag); - } - } + BKE_tracking_stabilization_data(&clip->tracking, framenr, stableibuf->x, stableibuf->y, tloc, &tscale, &tangle); - /* put undistorted frame to cache */ - if(ibuf && cache_undistorted) { - ImBuf *tmpibuf= ibuf; - ibuf= put_undistorted_cache(clip, user, tmpibuf); - IMB_freeImBuf(tmpibuf); + /* check for stabilization parameters */ + if(tscale != cache->stabilized.scale || + tangle != cache->stabilized.angle || + !equals_v2v2(tloc, cache->stabilized.loc)) + { + return NULL; } - BLI_unlock_thread(LOCK_MOVIECLIP); + IMB_refImBuf(stableibuf); - return ibuf; + return stableibuf; } -ImBuf *BKE_movieclip_get_stable_ibuf(MovieClip *clip, MovieClipUser *user, float loc[2], float *scale, float *angle) +static ImBuf *put_stabilized_frame_to_cache(MovieClip *clip, MovieClipUser *user, ImBuf *ibuf, int framenr) { - ImBuf *ibuf, *stableibuf= NULL; - int framenr= user->framenr; + MovieClipCache *cache = clip->cache; + ImBuf *stableibuf; + float tloc[2], tscale, tangle; - ibuf= BKE_movieclip_get_ibuf(clip, user); + if(cache->stabilized.ibuf) + IMB_freeImBuf(cache->stabilized.ibuf); - if(!ibuf) - return NULL; + stableibuf = BKE_tracking_stabilize(&clip->tracking, framenr, ibuf, tloc, &tscale, &tangle); - if(clip->tracking.stabilization.flag&TRACKING_2D_STABILIZATION) { - float tloc[2], tscale, tangle; - short proxy= IMB_PROXY_NONE; - int render_flag= 0; + cache->stabilized.ibuf= stableibuf; - if(clip->flag&MCLIP_USE_PROXY) { - proxy= rendersize_to_proxy(user, clip->flag); - render_flag= user->render_flag; - } + copy_v2_v2(cache->stabilized.loc, tloc); - if(clip->cache->stableibuf && clip->cache->stable_framenr==framenr) { /* there's cached ibuf */ - if(clip->cache->render_flag==render_flag && clip->cache->proxy==proxy) { /* cached ibuf used the same proxy settings */ - stableibuf= clip->cache->stableibuf; + cache->stabilized.scale = tscale; + cache->stabilized.angle = tangle; + cache->stabilized.framenr = framenr; - BKE_tracking_stabilization_data(&clip->tracking, framenr, stableibuf->x, stableibuf->y, tloc, &tscale, &tangle); + if(clip->flag&MCLIP_USE_PROXY) { + cache->stabilized.proxy= rendersize_to_proxy(user, clip->flag); + cache->stabilized.render_flag= user->render_flag; + } + else { + cache->stabilized.proxy = IMB_PROXY_NONE; + cache->stabilized.render_flag = 0; + } - /* check for stabilization parameters */ - if(!equals_v2v2(tloc, clip->cache->stable_loc) || tscale!=clip->cache->stable_scale || tangle!=clip->cache->stable_angle) { - stableibuf= NULL; - } - } - } + IMB_refImBuf(stableibuf); - if(!stableibuf) { - if(clip->cache->stableibuf) - IMB_freeImBuf(clip->cache->stableibuf); + return stableibuf; +} - stableibuf= BKE_tracking_stabilize(&clip->tracking, framenr, ibuf, tloc, &tscale, &tangle); +ImBuf *BKE_movieclip_get_stable_ibuf(MovieClip *clip, MovieClipUser *user, float loc[2], float *scale, float *angle, int postprocess_flag) +{ + ImBuf *ibuf, *stableibuf= NULL; + int framenr= user->framenr; - copy_v2_v2(clip->cache->stable_loc, tloc); - clip->cache->stable_scale= tscale; - clip->cache->stable_angle= tangle; - clip->cache->stable_framenr= framenr; - clip->cache->stableibuf= stableibuf; - clip->cache->proxy= proxy; - clip->cache->render_flag= render_flag; - } + ibuf= BKE_movieclip_get_postprocessed_ibuf(clip, user, postprocess_flag); + + if(!ibuf) + return NULL; + + if(clip->tracking.stabilization.flag&TRACKING_2D_STABILIZATION) { + MovieClipCache *cache= clip->cache; + + stableibuf= get_stable_cached_frame(clip, user, framenr); - IMB_refImBuf(stableibuf); + if(!stableibuf) + stableibuf= put_stabilized_frame_to_cache(clip, user, ibuf, framenr); - if(loc) copy_v2_v2(loc, tloc); - if(scale) *scale= tscale; - if(angle) *angle= tangle; + if(loc) copy_v2_v2(loc, cache->stabilized.loc); + if(scale) *scale= cache->stabilized.scale; + if(angle) *angle= cache->stabilized.angle; } else { if(loc) zero_v2(loc); if(scale) *scale= 1.0f; @@ -786,11 +874,11 @@ static void free_buffers(MovieClip *clip) if(clip->cache) { IMB_moviecache_free(clip->cache->moviecache); - if(clip->cache->stableibuf) - IMB_freeImBuf(clip->cache->stableibuf); + if(clip->cache->postprocessed.ibuf) + IMB_freeImBuf(clip->cache->postprocessed.ibuf); - if(clip->cache->undistibuf) - IMB_freeImBuf(clip->cache->undistibuf); + if(clip->cache->stabilized.ibuf) + IMB_freeImBuf(clip->cache->stabilized.ibuf); MEM_freeN(clip->cache); clip->cache= NULL; @@ -861,7 +949,7 @@ void BKE_movieclip_update_scopes(MovieClip *clip, MovieClipUser *user, MovieClip } /* NOTE: margin should be kept in sync with value from ui_draw_but_TRACKPREVIEW */ - tmpibuf= BKE_tracking_get_pattern_imbuf(ibuf, track, &undist_marker, 2 /* margin */, + tmpibuf= BKE_tracking_get_pattern_imbuf(ibuf, track, &undist_marker, 3 /* margin */, 1 /* anchor */, scopes->track_pos, NULL); if(tmpibuf->rect_float) diff --git a/source/blender/blenkernel/intern/multires.c b/source/blender/blenkernel/intern/multires.c index 458fb895b64..3fb49d508cd 100644 --- a/source/blender/blenkernel/intern/multires.c +++ b/source/blender/blenkernel/intern/multires.c @@ -1616,7 +1616,7 @@ static void multires_apply_smat(Scene *scene, Object *ob, float smat[3][3]) CustomData_external_read(&me->fdata, &me->id, CD_MASK_MDISPS, me->totface); mdisps= CustomData_get_layer(&me->fdata, CD_MDISPS); - if(!mdisps || !mmd) return; + if(!mdisps || !mmd || !mmd->totlvl) return; /* we need derived mesh created from highest resolution */ high_mmd= *mmd; diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c index 5253d7a9961..359470eecf2 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -1862,7 +1862,8 @@ static void registerCompositNodes(bNodeTreeType *ttype) register_node_type_cmp_channel_matte(ttype); register_node_type_cmp_color_spill(ttype); register_node_type_cmp_luma_matte(ttype); - + register_node_type_cmp_doubleedgemask(ttype); + register_node_type_cmp_translate(ttype); register_node_type_cmp_rotate(ttype); register_node_type_cmp_scale(ttype); @@ -1945,6 +1946,7 @@ static void registerShaderNodes(bNodeTreeType *ttype) register_node_type_sh_tex_musgrave(ttype); register_node_type_sh_tex_gradient(ttype); register_node_type_sh_tex_magic(ttype); + register_node_type_sh_tex_checker(ttype); } static void registerTextureNodes(bNodeTreeType *ttype) diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index fab59a7b88a..58fc3378476 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -840,7 +840,7 @@ Object *add_object(struct Scene *scene, int type) { Object *ob; Base *base; - char name[32]; + char name[MAX_ID_NAME]; BLI_strncpy(name, get_obdata_defname(type), sizeof(name)); ob = add_only_object(type, name); diff --git a/source/blender/blenkernel/intern/packedFile.c b/source/blender/blenkernel/intern/packedFile.c index 7be8aefc883..2decc40da81 100644 --- a/source/blender/blenkernel/intern/packedFile.c +++ b/source/blender/blenkernel/intern/packedFile.c @@ -251,7 +251,7 @@ static char *find_new_name(char *name) if (fop_exists(name)) { for (number = 1; number <= 999; number++) { - sprintf(tempname, "%s.%03d", name, number); + BLI_snprintf(tempname, sizeof(tempname), "%s.%03d", name, number); if (! fop_exists(tempname)) { break; } diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index ce50c58a6e1..3a4ae5797a0 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -3409,14 +3409,14 @@ ModifierData *object_add_particle_system(Scene *scene, Object *ob, const char *n psys->part = psys_new_settings("ParticleSettings", NULL); if(BLI_countlist(&ob->particlesystem)>1) - sprintf(psys->name, "ParticleSystem %i", BLI_countlist(&ob->particlesystem)); + BLI_snprintf(psys->name, sizeof(psys->name), "ParticleSystem %i", BLI_countlist(&ob->particlesystem)); else strcpy(psys->name, "ParticleSystem"); md= modifier_new(eModifierType_ParticleSystem); if(name) BLI_strncpy(md->name, name, sizeof(md->name)); - else sprintf(md->name, "ParticleSystem %i", BLI_countlist(&ob->particlesystem)); + else BLI_snprintf(md->name, sizeof(md->name), "ParticleSystem %i", BLI_countlist(&ob->particlesystem)); modifier_unique_name(&ob->modifiers, md); psmd= (ParticleSystemModifierData*) md; diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index 411e77de858..6fd89db10e7 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -3096,7 +3096,7 @@ void BKE_ptcache_disk_cache_rename(PTCacheID *pid, const char *name_src, const c } closedir(dir); - strcpy(pid->cache->name, old_name); + BLI_strncpy(pid->cache->name, old_name, sizeof(pid->cache->name)); } void BKE_ptcache_load_external(PTCacheID *pid) @@ -3217,11 +3217,11 @@ void BKE_ptcache_update_info(PTCacheID *pid) /* smoke doesn't use frame 0 as info frame so can't check based on totpoint */ if(pid->type == PTCACHE_TYPE_SMOKE_DOMAIN && totframes) - sprintf(cache->info, "%i frames found!", totframes); + BLI_snprintf(cache->info, sizeof(cache->info), "%i frames found!", totframes); else if(totframes && cache->totpoint) - sprintf(cache->info, "%i points found!", cache->totpoint); + BLI_snprintf(cache->info, sizeof(cache->info), "%i points found!", cache->totpoint); else - sprintf(cache->info, "No valid data to read!"); + BLI_snprintf(cache->info, sizeof(cache->info), "No valid data to read!"); return; } @@ -3231,9 +3231,9 @@ void BKE_ptcache_update_info(PTCacheID *pid) int totpoint = pid->totpoint(pid->calldata, 0); if(cache->totpoint > totpoint) - sprintf(mem_info, "%i cells + High Resolution cached", totpoint); + BLI_snprintf(mem_info, sizeof(mem_info), "%i cells + High Resolution cached", totpoint); else - sprintf(mem_info, "%i cells cached", totpoint); + BLI_snprintf(mem_info, sizeof(mem_info), "%i cells cached", totpoint); } else { int cfra = cache->startframe; @@ -3243,7 +3243,7 @@ void BKE_ptcache_update_info(PTCacheID *pid) totframes++; } - sprintf(mem_info, "%i frames on disk", totframes); + BLI_snprintf(mem_info, sizeof(mem_info), "%i frames on disk", totframes); } } else { @@ -3267,20 +3267,21 @@ void BKE_ptcache_update_info(PTCacheID *pid) mb = (bytes > 1024.0f * 1024.0f); - sprintf(mem_info, "%i frames in memory (%.1f %s)", + BLI_snprintf(mem_info, sizeof(mem_info), "%i frames in memory (%.1f %s)", totframes, bytes / (mb ? 1024.0f * 1024.0f : 1024.0f), mb ? "Mb" : "kb"); } if(cache->flag & PTCACHE_OUTDATED) { - sprintf(cache->info, "%s, cache is outdated!", mem_info); + BLI_snprintf(cache->info, sizeof(cache->info), "%s, cache is outdated!", mem_info); } else if(cache->flag & PTCACHE_FRAMES_SKIPPED) { - sprintf(cache->info, "%s, not exact since frame %i.", mem_info, cache->last_exact); + BLI_snprintf(cache->info, sizeof(cache->info), "%s, not exact since frame %i.", mem_info, cache->last_exact); + } + else { + BLI_snprintf(cache->info, sizeof(cache->info), "%s.", mem_info); } - else - sprintf(cache->info, "%s.", mem_info); } void BKE_ptcache_validate(PointCache *cache, int framenr) diff --git a/source/blender/blenkernel/intern/property.c b/source/blender/blenkernel/intern/property.c index d6c4b5f3a2e..5668907b094 100644 --- a/source/blender/blenkernel/intern/property.c +++ b/source/blender/blenkernel/intern/property.c @@ -171,7 +171,7 @@ void unique_property(bProperty *first, bProperty *prop, int force) i= 0; do { /* ensure we have enough chars for the new number in the name */ - sprintf(num, "%d", i++); + BLI_snprintf(num, sizeof(num), "%d", i++); BLI_strncpy(new_name, base_name, sizeof(prop->name) - strlen(num)); strcat(new_name, num); } while(get_property__internal(first, prop, new_name)); diff --git a/source/blender/blenkernel/intern/sca.c b/source/blender/blenkernel/intern/sca.c index f7eda6bd9b3..92dfe90eec1 100644 --- a/source/blender/blenkernel/intern/sca.c +++ b/source/blender/blenkernel/intern/sca.c @@ -428,7 +428,7 @@ void init_actuator(bActuator *act) case ACT_CAMERA: act->data= MEM_callocN(sizeof(bCameraActuator), "camact"); ca = act->data; - ca->axis = ACT_CAMERA_X; + ca->axis = OB_POSX; ca->damping = 1.0/32.0; break; case ACT_EDIT_OBJECT: diff --git a/source/blender/blenkernel/intern/seqeffects.c b/source/blender/blenkernel/intern/seqeffects.c index 731f82e1b80..a8f89b0a1eb 100644 --- a/source/blender/blenkernel/intern/seqeffects.c +++ b/source/blender/blenkernel/intern/seqeffects.c @@ -176,7 +176,7 @@ static void open_plugin_seq(PluginSeq *pis, const char *seqname) MEM_freeN(info); cp= BLI_dynlib_find_symbol(pis->handle, "seqname"); - if(cp) BLI_strncpy(cp, seqname, 21); + if(cp) BLI_strncpy(cp, seqname, SEQ_NAME_MAXSTR); } else { printf ("Plugin returned unrecognized version number\n"); return; @@ -303,7 +303,10 @@ static struct ImBuf * do_plugin_effect( cp = BLI_dynlib_find_symbol( seq->plugin->handle, "seqname"); - if(cp) strncpy(cp, seq->name+2, 22); + /* XXX: it's crappy to limit copying buffer by it's lemgth, + * but assuming plugin stuff is using correct buffer size + * it should be fine */ + if(cp) strncpy(cp, seq->name+2, sizeof(seq->name)-2); if (seq->plugin->current_private_data) { *seq->plugin->current_private_data diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index 6da9199ddc4..71377799651 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -833,8 +833,8 @@ void clear_scene_in_allseqs(Main *bmain, Scene *scene) typedef struct SeqUniqueInfo { Sequence *seq; - char name_src[32]; - char name_dest[32]; + char name_src[SEQ_NAME_MAXSTR]; + char name_dest[SEQ_NAME_MAXSTR]; int count; int match; } SeqUniqueInfo; @@ -850,7 +850,8 @@ static void seqbase_unique_name(ListBase *seqbasep, SeqUniqueInfo *sui) Sequence *seq; for(seq=seqbasep->first; seq; seq= seq->next) { if (sui->seq != seq && strcmp(sui->name_dest, seq->name+2)==0) { - sprintf(sui->name_dest, "%.17s.%03d", sui->name_src, sui->count++); /*24 - 2 for prefix, -1 for \0 */ + /* SEQ_NAME_MAXSTR - 2 for prefix, -1 for \0, -4 for the number */ + BLI_snprintf(sui->name_dest, sizeof(sui->name_dest), "%.59s.%03d", sui->name_src, sui->count++); sui->match= 1; /* be sure to re-scan */ } } @@ -3388,13 +3389,13 @@ int seq_swap(Sequence *seq_a, Sequence *seq_b, const char **error_str) /* XXX - hackish function needed for transforming strips! TODO - have some better solution */ void seq_offset_animdata(Scene *scene, Sequence *seq, int ofs) { - char str[32]; + char str[SEQ_NAME_MAXSTR+3]; FCurve *fcu; if(scene->adt==NULL || ofs==0 || scene->adt->action==NULL) return; - sprintf(str, "[\"%s\"]", seq->name+2); + BLI_snprintf(str, sizeof(str), "[\"%s\"]", seq->name+2); for (fcu= scene->adt->action->curves.first; fcu; fcu= fcu->next) { if(strstr(fcu->rna_path, "sequence_editor.sequences_all[") && strstr(fcu->rna_path, str)) { @@ -3411,7 +3412,7 @@ void seq_offset_animdata(Scene *scene, Sequence *seq, int ofs) void seq_dupe_animdata(Scene *scene, const char *name_src, const char *name_dst) { - char str_from[32]; + char str_from[SEQ_NAME_MAXSTR+3]; FCurve *fcu; FCurve *fcu_last; FCurve *fcu_cpy; @@ -3420,7 +3421,7 @@ void seq_dupe_animdata(Scene *scene, const char *name_src, const char *name_dst) if(scene->adt==NULL || scene->adt->action==NULL) return; - sprintf(str_from, "[\"%s\"]", name_src); + BLI_snprintf(str_from, sizeof(str_from), "[\"%s\"]", name_src); fcu_last= scene->adt->action->curves.last; @@ -3441,13 +3442,13 @@ void seq_dupe_animdata(Scene *scene, const char *name_src, const char *name_dst) /* XXX - hackish function needed to remove all fcurves belonging to a sequencer strip */ static void seq_free_animdata(Scene *scene, Sequence *seq) { - char str[32]; + char str[SEQ_NAME_MAXSTR+3]; FCurve *fcu; if(scene->adt==NULL || scene->adt->action==NULL) return; - sprintf(str, "[\"%s\"]", seq->name+2); + BLI_snprintf(str, sizeof(str), "[\"%s\"]", seq->name+2); fcu= scene->adt->action->curves.first; diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c index cab621eeff7..8d20a06d009 100644 --- a/source/blender/blenkernel/intern/softbody.c +++ b/source/blender/blenkernel/intern/softbody.c @@ -3728,6 +3728,8 @@ SoftBody *sbNew(Scene *scene) if(!sb->effector_weights) sb->effector_weights = BKE_add_effector_weights(NULL); + sb->last_frame= MINFRAME-1; + return sb; } @@ -4108,6 +4110,7 @@ void sbObjectStep(Scene *scene, Object *ob, float cfra, float (*vertexCos)[3], i softbody_update_positions(ob, sb, vertexCos, numVerts); softbody_step(scene, ob, sb, dtime); softbody_to_object(ob, vertexCos, numVerts, 0); + sb->last_frame = framenr; return; } @@ -4123,6 +4126,9 @@ void sbObjectStep(Scene *scene, Object *ob, float cfra, float (*vertexCos)[3], i BKE_ptcache_validate(cache, framenr); cache->flag &= ~PTCACHE_REDO_NEEDED; + + sb->last_frame = framenr; + return; } @@ -4137,6 +4143,8 @@ void sbObjectStep(Scene *scene, Object *ob, float cfra, float (*vertexCos)[3], i if(cache_result == PTCACHE_READ_INTERPOLATED && cache->flag & PTCACHE_REDO_NEEDED) BKE_ptcache_write(&pid, framenr); + sb->last_frame = framenr; + return; } else if(cache_result==PTCACHE_READ_OLD) { @@ -4148,6 +4156,9 @@ void sbObjectStep(Scene *scene, Object *ob, float cfra, float (*vertexCos)[3], i return; } + if(framenr!=sb->last_frame+1) + return; + /* if on second frame, write cache for first frame */ if(cache->simframe == startframe && (cache->flag & PTCACHE_OUTDATED || cache->last_exact==0)) BKE_ptcache_write(&pid, startframe); @@ -4164,5 +4175,7 @@ void sbObjectStep(Scene *scene, Object *ob, float cfra, float (*vertexCos)[3], i BKE_ptcache_validate(cache, framenr); BKE_ptcache_write(&pid, framenr); + + sb->last_frame = framenr; } diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index 649984a7934..f5b677203f6 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -233,7 +233,7 @@ struct bSound* sound_new_buffer(struct Main *bmain, struct bSound *source) { bSound* sound = NULL; - char name[25]; + char name[MAX_ID_NAME+5]; strcpy(name, "buf_"); strcpy(name + 4, source->id.name); @@ -257,7 +257,7 @@ struct bSound* sound_new_limiter(struct Main *bmain, struct bSound *source, floa { bSound* sound = NULL; - char name[25]; + char name[MAX_ID_NAME+5]; strcpy(name, "lim_"); strcpy(name + 4, source->id.name); diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c index 7051376a1f4..88858c9ff51 100644 --- a/source/blender/blenkernel/intern/texture.c +++ b/source/blender/blenkernel/intern/texture.c @@ -168,7 +168,7 @@ PluginTex *add_plugin_tex(char *str) pit= MEM_callocN(sizeof(PluginTex), "plugintex"); - strcpy(pit->name, str); + BLI_strncpy(pit->name, str, sizeof(pit->name)); open_plugin_tex(pit); if(pit->doit==NULL) { diff --git a/source/blender/blenkernel/intern/tracking.c b/source/blender/blenkernel/intern/tracking.c index ff76fc14755..73170612ff7 100644 --- a/source/blender/blenkernel/intern/tracking.c +++ b/source/blender/blenkernel/intern/tracking.c @@ -70,6 +70,10 @@ typedef struct MovieDistortion { struct libmv_CameraIntrinsics *intrinsics; } MovieDistortion; +static struct { + ListBase tracks; +} tracking_clipboard; + /*********************** common functions *************************/ void BKE_tracking_init_settings(MovieTracking *tracking) @@ -261,7 +265,7 @@ MovieTrackingTrack *BKE_tracking_add_track(MovieTracking *tracking, ListBase *tr return track; } -void BKE_tracking_insert_marker(MovieTrackingTrack *track, MovieTrackingMarker *marker) +MovieTrackingMarker *BKE_tracking_insert_marker(MovieTrackingTrack *track, MovieTrackingMarker *marker) { MovieTrackingMarker *old_marker= NULL; @@ -270,6 +274,8 @@ void BKE_tracking_insert_marker(MovieTrackingTrack *track, MovieTrackingMarker * if(old_marker) { *old_marker= *marker; + + return old_marker; } else { int a= track->markersnr; @@ -287,6 +293,8 @@ void BKE_tracking_insert_marker(MovieTrackingTrack *track, MovieTrackingMarker * track->markers[a+1]= *marker; track->last_marker= a+1; + + return &track->markers[a+1]; } } @@ -574,10 +582,76 @@ void BKE_tracking_free(MovieTracking *tracking) BKE_tracking_distortion_destroy(tracking->camera.intrinsics); } +static MovieTrackingTrack *duplicate_track(MovieTrackingTrack *track) +{ + MovieTrackingTrack *new_track; + + new_track = MEM_callocN(sizeof(MovieTrackingTrack), "tracksMapMerge new_track"); + + *new_track= *track; + new_track->next = new_track->prev = NULL; + + new_track->markers = MEM_dupallocN(new_track->markers); + + return new_track; +} + +/*********************** clipboard *************************/ + +void BKE_tracking_free_clipboard(void) +{ + MovieTrackingTrack *track = tracking_clipboard.tracks.first, *next_track; + + while (track) { + next_track = track->next; + + BKE_tracking_free_track(track); + MEM_freeN(track); + + track = next_track; + } +} + +void BKE_tracking_clipboard_copy_tracks(MovieTracking *tracking, MovieTrackingObject *object) +{ + ListBase *tracksbase = BKE_tracking_object_tracks(tracking, object); + MovieTrackingTrack *track = tracksbase->first; + + while (track) { + if (TRACK_SELECTED(track)) { + MovieTrackingTrack *new_track = duplicate_track(track); + + BLI_addtail(&tracking_clipboard.tracks, new_track); + } + + track = track->next; + } +} + +int BKE_tracking_clipboard_has_tracks(void) +{ + return tracking_clipboard.tracks.first != NULL; +} + +void BKE_tracking_clipboard_paste_tracks(MovieTracking *tracking, MovieTrackingObject *object) +{ + ListBase *tracksbase = BKE_tracking_object_tracks(tracking, object); + MovieTrackingTrack *track = tracking_clipboard.tracks.first; + + while (track) { + MovieTrackingTrack *new_track = duplicate_track(track); + + BLI_addtail(tracksbase, new_track); + BKE_track_unique_name(tracksbase, new_track); + + track = track->next; + } +} + /*********************** tracks map *************************/ typedef struct TracksMap { - char object_name[32]; + char object_name[MAX_NAME]; int is_camera; int num_tracks; @@ -595,7 +669,7 @@ static TracksMap *tracks_map_new(const char *object_name, int is_camera, int num { TracksMap *map= MEM_callocN(sizeof(TracksMap), "TrackingsMap"); - strcpy(map->object_name, object_name); + BLI_strncpy(map->object_name, object_name, sizeof(map->object_name)); map->is_camera= is_camera; map->num_tracks= num_tracks; @@ -696,9 +770,7 @@ static void tracks_map_merge(TracksMap *map, MovieTracking *tracking) } } - new_track= MEM_callocN(sizeof(MovieTrackingTrack), "tracksMapMerge new_track"); - *new_track= *track; - new_track->markers= MEM_dupallocN(new_track->markers); + new_track= duplicate_track(track); BLI_ghash_remove(map->hash, track, NULL, NULL); /* XXX: are we actually need this */ BLI_ghash_insert(map->hash, track, new_track); @@ -938,19 +1010,19 @@ void BKE_tracking_context_free(MovieTrackingContext *context) /* zap channels from the imbuf that are disabled by the user. this can lead to * better tracks sometimes. however, instead of simply zeroing the channels * out, do a partial grayscale conversion so the display is better. */ -static void disable_imbuf_channels(ImBuf *ibuf, MovieTrackingTrack *track, int grayscale) +void BKE_tracking_disable_imbuf_channels(ImBuf *ibuf, int disable_red, int disable_green, int disable_blue, int grayscale) { int x, y; float scale; - if((track->flag&(TRACK_DISABLE_RED|TRACK_DISABLE_GREEN|TRACK_DISABLE_BLUE))==0 && !grayscale) + if(!disable_red && !disable_green && !disable_blue && !grayscale) return; /* If only some components are selected, it's important to rescale the result * appropriately so that e.g. if only blue is selected, it's not zeroed out. */ - scale = ((track->flag&TRACK_DISABLE_RED ) ? 0.0f : 0.2126f) + - ((track->flag&TRACK_DISABLE_GREEN) ? 0.0f : 0.7152f) + - ((track->flag&TRACK_DISABLE_BLUE) ? 0.0f : 0.0722f); + scale = (disable_red ? 0.0f : 0.2126f) + + (disable_green ? 0.0f : 0.7152f) + + (disable_blue ? 0.0f : 0.0722f); for(y= 0; y<ibuf->y; y++) { for (x= 0; x<ibuf->x; x++) { @@ -958,9 +1030,9 @@ static void disable_imbuf_channels(ImBuf *ibuf, MovieTrackingTrack *track, int g if(ibuf->rect_float) { float *rrgbf= ibuf->rect_float + pixel*4; - float r = (track->flag&TRACK_DISABLE_RED) ? 0.0f : rrgbf[0]; - float g = (track->flag&TRACK_DISABLE_GREEN) ? 0.0f : rrgbf[1]; - float b = (track->flag&TRACK_DISABLE_BLUE) ? 0.0f : rrgbf[2]; + float r = disable_red ? 0.0f : rrgbf[0]; + float g = disable_green ? 0.0f : rrgbf[1]; + float b = disable_blue ? 0.0f : rrgbf[2]; if (grayscale) { float gray = (0.2126f*r + 0.7152f*g + 0.0722f*b) / scale; rrgbf[0] = rrgbf[1] = rrgbf[2] = gray; @@ -971,9 +1043,9 @@ static void disable_imbuf_channels(ImBuf *ibuf, MovieTrackingTrack *track, int g } } else { char *rrgb= (char*)ibuf->rect + pixel*4; - char r = (track->flag&TRACK_DISABLE_RED) ? 0 : rrgb[0]; - char g = (track->flag&TRACK_DISABLE_GREEN) ? 0 : rrgb[1]; - char b = (track->flag&TRACK_DISABLE_BLUE) ? 0 : rrgb[2]; + char r = disable_red ? 0 : rrgb[0]; + char g = disable_green ? 0 : rrgb[1]; + char b = disable_blue ? 0 : rrgb[2]; if (grayscale) { float gray = (0.2126f*r + 0.7152f*g + 0.0722f*b) / scale; rrgb[0] = rrgb[1] = rrgb[2] = gray; @@ -987,12 +1059,18 @@ static void disable_imbuf_channels(ImBuf *ibuf, MovieTrackingTrack *track, int g } } +static void disable_imbuf_channels(ImBuf *ibuf, MovieTrackingTrack *track, int grayscale) +{ + BKE_tracking_disable_imbuf_channels(ibuf, track->flag&TRACK_DISABLE_RED, + track->flag&TRACK_DISABLE_GREEN, track->flag&TRACK_DISABLE_RED, grayscale); +} + static ImBuf *get_area_imbuf(ImBuf *ibuf, MovieTrackingTrack *track, MovieTrackingMarker *marker, float min[2], float max[2], int margin, int anchored, float pos[2], int origin[2]) { ImBuf *tmpibuf; int x, y; - int x1, y1, x2, y2, w, h; + int x1, y1, w, h; float mpos[2]; copy_v2_v2(mpos, marker->pos); @@ -1013,8 +1091,6 @@ static ImBuf *get_area_imbuf(ImBuf *ibuf, MovieTrackingTrack *track, MovieTracki x1= x-(int)(w/2.0f); y1= y-(int)(h/2.0f); - x2= x+(int)(w/2.0f); - y2= y+(int)(h/2.0f); /* dimensions should be odd */ tmpibuf= IMB_allocImBuf(w+margin*2, h+margin*2, 32, IB_rect); @@ -1038,9 +1114,6 @@ static ImBuf *get_area_imbuf(ImBuf *ibuf, MovieTrackingTrack *track, MovieTracki disable_imbuf_channels(tmpibuf, track, 1 /* grayscale */); } - tmpibuf->ftype= PNG; - IMB_saveiff(tmpibuf, "/tmp/1.png", IB_rect); - return tmpibuf; } @@ -1105,10 +1178,11 @@ static unsigned char *get_ucharbuf(ImBuf *ibuf) int pixel= ibuf->x*y + x; if(ibuf->rect_float) { - float *rrgbf= ibuf->rect_float + pixel*4; - *cp= FTOCHAR(0.2126f*rrgbf[0] + 0.7152f*rrgbf[1] + 0.0722f*rrgbf[2]); + const float *rrgbf= ibuf->rect_float + pixel*4; + const float grey_f= 0.2126f*rrgbf[0] + 0.7152f*rrgbf[1] + 0.0722f*rrgbf[2]; + *cp= FTOCHAR(grey_f); } else { - unsigned char *rrgb= (unsigned char*)ibuf->rect + pixel*4; + const unsigned char *rrgb= (unsigned char*)ibuf->rect + pixel*4; *cp= 0.2126f*rrgb[0] + 0.7152f*rrgb[1] + 0.0722f*rrgb[2]; } cp++; @@ -1454,7 +1528,7 @@ typedef struct MovieReconstructContext { struct libmv_Reconstruction *reconstruction; #endif - char object_name[32]; + char object_name[MAX_NAME]; int is_camera; float focal_length; @@ -1709,7 +1783,7 @@ MovieReconstructContext* BKE_tracking_reconstruction_context_new(MovieTracking * int sfra= INT_MAX, efra= INT_MIN; MovieTrackingTrack *track; - strcpy(context->object_name, object->name); + BLI_strncpy(context->object_name, object->name, sizeof(context->object_name)); context->is_camera = object->flag&TRACKING_OBJECT_CAMERA; context->tracks_map= tracks_map_new(context->object_name, context->is_camera, num_tracks, 0); diff --git a/source/blender/blenkernel/intern/writeavi.c b/source/blender/blenkernel/intern/writeavi.c index da64c464dce..dbb37ad9c1d 100644 --- a/source/blender/blenkernel/intern/writeavi.c +++ b/source/blender/blenkernel/intern/writeavi.c @@ -52,7 +52,8 @@ /* callbacks */ static int start_avi(Scene *scene, RenderData *rd, int rectx, int recty, ReportList *reports); static void end_avi(void); -static int append_avi(RenderData *rd, int frame, int *pixels, int rectx, int recty, ReportList *reports); +static int append_avi(RenderData *rd, int start_frame, int frame, int *pixels, + int rectx, int recty, ReportList *reports); static void filepath_avi(char *string, RenderData *rd); /* ********************** general blender movie support ***************************** */ @@ -121,7 +122,6 @@ bMovieHandle *BKE_get_movie_handle(const char imtype) static AviMovie *avi=NULL; -static int sframe; static void filepath_avi (char *string, RenderData *rd) { @@ -150,7 +150,6 @@ static int start_avi(Scene *scene, RenderData *rd, int rectx, int recty, ReportL filepath_avi(name, rd); - sframe = (rd->sfra); x = rectx; y = recty; @@ -183,7 +182,8 @@ static int start_avi(Scene *scene, RenderData *rd, int rectx, int recty, ReportL return 1; } -static int append_avi(RenderData *UNUSED(rd), int frame, int *pixels, int rectx, int recty, ReportList *UNUSED(reports)) +static int append_avi(RenderData *UNUSED(rd), int start_frame, int frame, int *pixels, + int rectx, int recty, ReportList *UNUSED(reports)) { unsigned int *rt1, *rt2, *rectot; int x, y; @@ -212,8 +212,8 @@ static int append_avi(RenderData *UNUSED(rd), int frame, int *pixels, int rectx, } } - AVI_write_frame (avi, (frame-sframe), AVI_FORMAT_RGB32, rectot, rectx*recty*4); -// printf ("added frame %3d (frame %3d in avi): ", frame, frame-sframe); + AVI_write_frame (avi, (frame-start_frame), AVI_FORMAT_RGB32, rectot, rectx*recty*4); +// printf ("added frame %3d (frame %3d in avi): ", frame, frame-start_frame); return 1; } diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c index bf547584b9e..0b043e26ab7 100644 --- a/source/blender/blenkernel/intern/writeffmpeg.c +++ b/source/blender/blenkernel/intern/writeffmpeg.c @@ -236,13 +236,13 @@ static const char** get_file_extensions(int format) } /* Write a frame to the output file */ -static int write_video_frame(RenderData *rd, AVFrame* frame, ReportList *reports) +static int write_video_frame(RenderData *rd, int cfra, AVFrame* frame, ReportList *reports) { int outsize = 0; int ret, success= 1; AVCodecContext* c = video_stream->codec; - frame->pts = rd->cfra - rd->sfra; + frame->pts = cfra; if (rd->mode & R_FIELDS) { frame->top_field_first = ((rd->mode & R_ODDFIELD) != 0); @@ -918,7 +918,7 @@ static void write_audio_frames(double to_pts) } #endif -int append_ffmpeg(RenderData *rd, int frame, int *pixels, int rectx, int recty, ReportList *reports) +int append_ffmpeg(RenderData *rd, int start_frame, int frame, int *pixels, int rectx, int recty, ReportList *reports) { AVFrame* avframe; int success = 1; @@ -933,7 +933,7 @@ int append_ffmpeg(RenderData *rd, int frame, int *pixels, int rectx, int recty, if(video_stream) { avframe= generate_video_frame((unsigned char*) pixels, reports); - success= (avframe && write_video_frame(rd, avframe, reports)); + success= (avframe && write_video_frame(rd, frame - start_frame, avframe, reports)); if (ffmpeg_autosplit) { if (avio_tell(outfile->pb) > FFMPEG_AUTOSPLIT_SIZE) { @@ -1077,9 +1077,9 @@ IDProperty *ffmpeg_property_add(RenderData *rd, const char *type, int opt_index, } if (parent_index) { - sprintf(name, "%s:%s", parent->name, o->name); + BLI_snprintf(name, sizeof(name), "%s:%s", parent->name, o->name); } else { - strcpy(name, o->name); + BLI_strncpy(name, o->name, sizeof(name)); } fprintf(stderr, "ffmpeg_property_add: %s %d %d %s\n", @@ -1200,6 +1200,56 @@ int ffmpeg_property_add_string(RenderData *rd, const char * type, const char * s return 1; } +static void ffmpeg_set_expert_options(RenderData *rd, int preset) +{ + if(rd->ffcodecdata.properties) + IDP_FreeProperty(rd->ffcodecdata.properties); + + if(preset == FFMPEG_PRESET_H264) { + /* + * All options here are for x264, but must be set via ffmpeg. + * The names are therefore different - Search for "x264 to FFmpeg option mapping" + * to get a list. + */ + + /* + * Use CABAC coder. Using "coder:1", which should be equivalent, + * crashes Blender for some reason. Either way - this is no big deal. + */ + ffmpeg_property_add_string(rd, "video", "coder:vlc"); + + /* + * The other options were taken from the libx264-default.preset + * included in the ffmpeg distribution. + */ + ffmpeg_property_add_string(rd, "video", "flags:loop"); + ffmpeg_property_add_string(rd, "video", "cmp:chroma"); + ffmpeg_property_add_string(rd, "video", "partitions:parti4x4"); + ffmpeg_property_add_string(rd, "video", "partitions:partp8x8"); + ffmpeg_property_add_string(rd, "video", "partitions:partb8x8"); + ffmpeg_property_add_string(rd, "video", "me:hex"); + ffmpeg_property_add_string(rd, "video", "subq:6"); + ffmpeg_property_add_string(rd, "video", "me_range:16"); + ffmpeg_property_add_string(rd, "video", "qdiff:4"); + ffmpeg_property_add_string(rd, "video", "keyint_min:25"); + ffmpeg_property_add_string(rd, "video", "sc_threshold:40"); + ffmpeg_property_add_string(rd, "video", "i_qfactor:0.71"); + ffmpeg_property_add_string(rd, "video", "b_strategy:1"); + ffmpeg_property_add_string(rd, "video", "bf:3"); + ffmpeg_property_add_string(rd, "video", "refs:2"); + ffmpeg_property_add_string(rd, "video", "qcomp:0.6"); + ffmpeg_property_add_string(rd, "video", "directpred:3"); + ffmpeg_property_add_string(rd, "video", "trellis:0"); + ffmpeg_property_add_string(rd, "video", "flags2:wpred"); + ffmpeg_property_add_string(rd, "video", "flags2:dct8x8"); + ffmpeg_property_add_string(rd, "video", "flags2:fastpskip"); + ffmpeg_property_add_string(rd, "video", "wpredp:2"); + + if(rd->ffcodecdata.flags & FFMPEG_LOSSLESS_OUTPUT) + ffmpeg_property_add_string(rd, "video", "cqp:0"); + } +} + void ffmpeg_set_preset(RenderData *rd, int preset) { int isntsc = (rd->frs_sec != 25); @@ -1267,47 +1317,7 @@ void ffmpeg_set_preset(RenderData *rd, int preset) rd->ffcodecdata.mux_packet_size = 2048; rd->ffcodecdata.mux_rate = 10080000; - /* - * All options here are for x264, but must be set via ffmpeg. - * The names are therefore different - Search for "x264 to FFmpeg option mapping" - * to get a list. - */ - - /* - * Use CABAC coder. Using "coder:1", which should be equivalent, - * crashes Blender for some reason. Either way - this is no big deal. - */ - ffmpeg_property_add_string(rd, "video", "coder:vlc"); - - /* - * The other options were taken from the libx264-default.preset - * included in the ffmpeg distribution. - */ - ffmpeg_property_add_string(rd, "video", "flags:loop"); - ffmpeg_property_add_string(rd, "video", "cmp:chroma"); - ffmpeg_property_add_string(rd, "video", "partitions:parti4x4"); - ffmpeg_property_add_string(rd, "video", "partitions:partp8x8"); - ffmpeg_property_add_string(rd, "video", "partitions:partb8x8"); - ffmpeg_property_add_string(rd, "video", "me:hex"); - ffmpeg_property_add_string(rd, "video", "subq:6"); - ffmpeg_property_add_string(rd, "video", "me_range:16"); - ffmpeg_property_add_string(rd, "video", "qdiff:4"); - ffmpeg_property_add_string(rd, "video", "keyint_min:25"); - ffmpeg_property_add_string(rd, "video", "sc_threshold:40"); - ffmpeg_property_add_string(rd, "video", "i_qfactor:0.71"); - ffmpeg_property_add_string(rd, "video", "b_strategy:1"); - ffmpeg_property_add_string(rd, "video", "bf:3"); - ffmpeg_property_add_string(rd, "video", "refs:2"); - ffmpeg_property_add_string(rd, "video", "qcomp:0.6"); - ffmpeg_property_add_string(rd, "video", "directpred:3"); - ffmpeg_property_add_string(rd, "video", "trellis:0"); - ffmpeg_property_add_string(rd, "video", "flags2:wpred"); - ffmpeg_property_add_string(rd, "video", "flags2:dct8x8"); - ffmpeg_property_add_string(rd, "video", "flags2:fastpskip"); - ffmpeg_property_add_string(rd, "video", "wpredp:2"); - - // This makes x264 output lossless. Will be a separate option later. - //ffmpeg_property_add_string(rd, "video", "cqp:0"); + ffmpeg_set_expert_options(rd, preset); break; case FFMPEG_PRESET_THEORA: @@ -1378,4 +1388,11 @@ void ffmpeg_verify_image_type(RenderData *rd, ImageFormatData *imf) } } +void ffmpeg_verify_lossless_format(RenderData *rd, ImageFormatData *imf) +{ + if(imf->imtype == R_IMF_IMTYPE_H264) { + ffmpeg_set_expert_options(rd, FFMPEG_PRESET_H264); + } +} + #endif diff --git a/source/blender/blenkernel/intern/writeframeserver.c b/source/blender/blenkernel/intern/writeframeserver.c index ae65b913283..c163155c8fb 100644 --- a/source/blender/blenkernel/intern/writeframeserver.c +++ b/source/blender/blenkernel/intern/writeframeserver.c @@ -310,7 +310,7 @@ int frameserver_loop(RenderData *rd, ReportList *UNUSED(reports)) } } - len = recv(connsock, buf, 4095, 0); + len = recv(connsock, buf, sizeof(buf) - 1, 0); if (len < 0) { return -1; @@ -362,7 +362,8 @@ static void serve_ppm(int *pixels, int rectx, int recty) connsock = -1; } -int append_frameserver(RenderData *UNUSED(rd), int frame, int *pixels, int rectx, int recty, ReportList *UNUSED(reports)) +int append_frameserver(RenderData *UNUSED(rd), int UNUSED(start_frame), int frame, int *pixels, + int rectx, int recty, ReportList *UNUSED(reports)) { fprintf(stderr, "Serving frame: %d\n", frame); if (write_ppm) { diff --git a/source/blender/blenlib/BLI_editVert.h b/source/blender/blenlib/BLI_editVert.h index ffe1d7e2b6e..8ebfa73cf6a 100644 --- a/source/blender/blenlib/BLI_editVert.h +++ b/source/blender/blenlib/BLI_editVert.h @@ -42,7 +42,6 @@ #include "BLO_sys_types.h" // for intptr_t support struct DerivedMesh; -struct RetopoPaintData; /* note; changing this also might affect the undo copy in editmesh.c */ typedef struct EditVert @@ -184,8 +183,6 @@ typedef struct EditMesh */ int lastDataMask; - struct RetopoPaintData *retopo_paint_data; - CustomData vdata, edata, fdata; } EditMesh; diff --git a/source/blender/blenlib/BLI_fnmatch.h b/source/blender/blenlib/BLI_fnmatch.h index c09a7c7c0d2..ac8960ff9c9 100644 --- a/source/blender/blenlib/BLI_fnmatch.h +++ b/source/blender/blenlib/BLI_fnmatch.h @@ -51,7 +51,7 @@ extern "C" { #define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */ #define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */ -#if !defined (_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined (_GNU_SOURCE) +#if !defined (_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined (_GNU_SOURCE) || defined( __SUNPRO_C) #define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */ #define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */ #define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */ diff --git a/source/blender/blenlib/BLI_math_color.h b/source/blender/blenlib/BLI_math_color.h index 7fbb4680b6d..6d37aabd6ab 100644 --- a/source/blender/blenlib/BLI_math_color.h +++ b/source/blender/blenlib/BLI_math_color.h @@ -69,8 +69,10 @@ void rgb_to_hsv_compat(float r, float g, float b, float *lh, float *ls, float *l unsigned int rgb_to_cpack(float r, float g, float b); unsigned int hsv_to_cpack(float h, float s, float v); -float rgb_to_grayscale(float rgb[3]); -unsigned char rgb_to_grayscale_byte(unsigned char rgb[3]); +float rgb_to_grayscale(const float rgb[3]); +unsigned char rgb_to_grayscale_byte(const unsigned char rgb[3]); +float rgb_to_luma(const float rgb[3]); +unsigned char rgb_to_luma_byte(const unsigned char rgb[3]); /**************** Profile Transformations *****************/ @@ -89,6 +91,8 @@ MINLINE void linearrgb_to_srgb_v4(float srgb[4], const float linear[4]); MINLINE void srgb_to_linearrgb_predivide_v4(float linear[4], const float srgb[4]); MINLINE void linearrgb_to_srgb_predivide_v4(float srgb[4], const float linear[4]); +void BLI_init_srgb_conversion(void); + /************************** Other *************************/ int constrain_rgb(float *r, float *g, float *b); @@ -97,13 +101,13 @@ void minmax_rgb(short c[3]); void rgb_float_set_hue_float_offset(float * rgb, float hue_offset); void rgb_byte_set_hue_float_offset(unsigned char * rgb, float hue_offset); +void rgb_byte_to_float(const unsigned char in[3], float out[3]); +void rgb_float_to_byte(const float in[3], unsigned char out[3]); + /***************** lift/gamma/gain / ASC-CDL conversion *****************/ void lift_gamma_gain_to_asc_cdl(float *lift, float *gamma, float *gain, float *offset, float *slope, float *power); -void rgb_byte_to_float(const unsigned char *in, float *out); -void rgb_float_to_byte(const float *in, unsigned char *out); - #ifdef BLI_MATH_INLINE_H #include "intern/math_color_inline.c" #endif diff --git a/source/blender/blenlib/BLI_utildefines.h b/source/blender/blenlib/BLI_utildefines.h index abe8fb7d8fe..6d9188c1848 100644 --- a/source/blender/blenlib/BLI_utildefines.h +++ b/source/blender/blenlib/BLI_utildefines.h @@ -108,6 +108,7 @@ #define FTOCHAR(val) ((val)<=0.0f)? 0 : (((val)>(1.0f-0.5f/255.0f))? 255 : (char)((255.0f*(val))+0.5f)) #define FTOUSHORT(val) ((val >= 1.0f-0.5f/65535)? 65535: (val <= 0.0f)? 0: (unsigned short)(val*65535.0f + 0.5f)) +#define USHORTTOUCHAR(val) ((unsigned char)(((val) >= 65535-128)? 255: ((val)+128)>>8)) #define F3TOCHAR3(v2, v1) { \ (v1)[0]= FTOCHAR((v2[0])); \ (v1)[1]= FTOCHAR((v2[1])); \ diff --git a/source/blender/blenlib/intern/boxpack2d.c b/source/blender/blenlib/intern/boxpack2d.c index 30bf69ba3b4..073b4b5d0c6 100644 --- a/source/blender/blenlib/intern/boxpack2d.c +++ b/source/blender/blenlib/intern/boxpack2d.c @@ -174,33 +174,33 @@ void boxPack2D(boxPack *boxarray, const int len, float *tot_width, float *tot_he for (box=boxarray, box_index=0, i=0; box_index < len; box_index++, box++) { - vert->blb = vert->brb = vert->tlb =\ - vert->isect_cache[0] = vert->isect_cache[1] =\ - vert->isect_cache[2] = vert->isect_cache[3] = NULL; + vert->blb = vert->brb = vert->tlb = + vert->isect_cache[0] = vert->isect_cache[1] = + vert->isect_cache[2] = vert->isect_cache[3] = NULL; vert->free = CORNERFLAGS &~ TRF; vert->trb = box; vert->index = i; i++; box->v[BL] = vert; vert++; - vert->trb= vert->brb = vert->tlb =\ - vert->isect_cache[0] = vert->isect_cache[1] =\ - vert->isect_cache[2] = vert->isect_cache[3] = NULL; + vert->trb= vert->brb = vert->tlb = + vert->isect_cache[0] = vert->isect_cache[1] = + vert->isect_cache[2] = vert->isect_cache[3] = NULL; vert->free = CORNERFLAGS &~ BLF; vert->blb = box; vert->index = i; i++; box->v[TR] = vert; vert++; - vert->trb = vert->blb = vert->tlb =\ - vert->isect_cache[0] = vert->isect_cache[1] =\ - vert->isect_cache[2] = vert->isect_cache[3] = NULL; + vert->trb = vert->blb = vert->tlb = + vert->isect_cache[0] = vert->isect_cache[1] = + vert->isect_cache[2] = vert->isect_cache[3] = NULL; vert->free = CORNERFLAGS &~ BRF; vert->brb = box; vert->index = i; i++; box->v[TL] = vert; vert++; - vert->trb = vert->blb = vert->brb =\ - vert->isect_cache[0] = vert->isect_cache[1] =\ - vert->isect_cache[2] = vert->isect_cache[3] = NULL; + vert->trb = vert->blb = vert->brb = + vert->isect_cache[0] = vert->isect_cache[1] = + vert->isect_cache[2] = vert->isect_cache[3] = NULL; vert->free = CORNERFLAGS &~ TLF; vert->tlb = box; vert->index = i; i++; diff --git a/source/blender/blenlib/intern/fileops.c b/source/blender/blenlib/intern/fileops.c index 95b6a970b49..ad0478060f2 100644 --- a/source/blender/blenlib/intern/fileops.c +++ b/source/blender/blenlib/intern/fileops.c @@ -82,7 +82,7 @@ int BLI_file_gzip(const char *from, const char *to) return -2; while(1) { - readsize = read(file, buffer, 10240); + readsize = read(file, buffer, sizeof(buffer)); if(readsize < 0) { rval= -2; /* error happened in reading */ diff --git a/source/blender/blenlib/intern/math_color.c b/source/blender/blenlib/intern/math_color.c index 8f5366b6317..20df893015d 100644 --- a/source/blender/blenlib/intern/math_color.c +++ b/source/blender/blenlib/intern/math_color.c @@ -30,7 +30,11 @@ #include <assert.h> +#include "MEM_guardedalloc.h" + #include "BLI_math.h" +#include "BLI_rand.h" +#include "BLI_utildefines.h" void hsv_to_rgb(float h, float s, float v, float *r, float *g, float *b) { @@ -333,14 +337,14 @@ void cpack_to_rgb(unsigned int col, float *r, float *g, float *b) *b /= 255.0f; } -void rgb_byte_to_float(const unsigned char *in, float *out) +void rgb_byte_to_float(const unsigned char in[3], float out[3]) { out[0]= ((float)in[0]) / 255.0f; out[1]= ((float)in[1]) / 255.0f; out[2]= ((float)in[2]) / 255.0f; } -void rgb_float_to_byte(const float *in, unsigned char *out) +void rgb_float_to_byte(const float in[3], unsigned char out[3]) { int r, g, b; @@ -430,16 +434,26 @@ int constrain_rgb(float *r, float *g, float *b) return 0; /* Color within RGB gamut */ } -float rgb_to_grayscale(float rgb[3]) +float rgb_to_grayscale(const float rgb[3]) { return 0.3f*rgb[0] + 0.58f*rgb[1] + 0.12f*rgb[2]; } -unsigned char rgb_to_grayscale_byte(unsigned char rgb[3]) +unsigned char rgb_to_grayscale_byte(const unsigned char rgb[3]) { return (76*(unsigned short)rgb[0] + 148*(unsigned short)rgb[1] + 31*(unsigned short)rgb[2]) / 255; } +float rgb_to_luma(const float rgb[3]) +{ + return 0.299f*rgb[0] + 0.587f*rgb[1] + 0.114f*rgb[2]; +} + +unsigned char rgb_to_luma_byte(const unsigned char rgb[3]) +{ + return (76*(unsigned short)rgb[0] + 150*(unsigned short)rgb[1] + 29*(unsigned short)rgb[2]) / 255; +} + /* ********************************* lift/gamma/gain / ASC-CDL conversion ********************************* */ void lift_gamma_gain_to_asc_cdl(float *lift, float *gamma, float *gain, float *offset, float *slope, float *power) @@ -480,3 +494,79 @@ void rgb_byte_set_hue_float_offset(unsigned char rgb[3], float hue_offset) rgb_float_set_hue_float_offset(rgb_float, hue_offset); rgb_float_to_byte(rgb_float, rgb); } + + +/* fast sRGB conversion + * LUT from linear float to 16-bit short + * based on http://mysite.verizon.net/spitzak/conversion/ + */ + +float BLI_color_from_srgb_table[256]; +unsigned short BLI_color_to_srgb_table[0x10000]; + +static unsigned short hipart(const float f) +{ + union { + float f; + unsigned short us[2]; + } tmp; + + tmp.f = f; + +#ifdef __BIG_ENDIAN__ + return tmp.us[0]; +#else + return tmp.us[1]; +#endif +} + +static float index_to_float(const unsigned short i) +{ + union { + float f; + unsigned short us[2]; + } tmp; + + /* positive and negative zeros, and all gradual underflow, turn into zero: */ + if (i<0x80 || (i >= 0x8000 && i < 0x8080)) return 0; + /* All NaN's and infinity turn into the largest possible legal float: */ + if (i>=0x7f80 && i<0x8000) return FLT_MAX; + if (i>=0xff80) return -FLT_MAX; + +#ifdef __BIG_ENDIAN__ + tmp.us[0] = i; + tmp.us[1] = 0x8000; +#else + tmp.us[0] = 0x8000; + tmp.us[1] = i; +#endif + + return tmp.f; +} + +void BLI_init_srgb_conversion(void) +{ + static int initialized= 0; + int i, b; + + if (initialized) return; + initialized = 1; + + /* Fill in the lookup table to convert floats to bytes: */ + for (i = 0; i < 0x10000; i++) { + float f = linearrgb_to_srgb(index_to_float(i))*255.0f; + if (f <= 0) BLI_color_to_srgb_table[i] = 0; + else if (f < 255) BLI_color_to_srgb_table[i] = (unsigned short)(f*0x100+.5); + else BLI_color_to_srgb_table[i] = 0xff00; + } + + /* Fill in the lookup table to convert bytes to float: */ + for (b = 0; b <= 255; b++) { + float f = srgb_to_linearrgb(((float)b)*(1.0f/255.0f)); + BLI_color_from_srgb_table[b] = f; + i = hipart(f); + /* replace entries so byte->float->byte does not change the data: */ + BLI_color_to_srgb_table[i] = b*0x100; + } +} + diff --git a/source/blender/blenlib/intern/math_color_inline.c b/source/blender/blenlib/intern/math_color_inline.c index aaaa065f14d..1247632cf79 100644 --- a/source/blender/blenlib/intern/math_color_inline.c +++ b/source/blender/blenlib/intern/math_color_inline.c @@ -105,5 +105,80 @@ MINLINE void linearrgb_to_srgb_predivide_v4(float srgb[4], const float linear[4] srgb[3] = linear[3]; } +/* LUT accelerated conversions */ + +extern float BLI_color_from_srgb_table[256]; +extern unsigned short BLI_color_to_srgb_table[0x10000]; + +MINLINE unsigned short to_srgb_table_lookup(const float f) +{ + union { + float f; + unsigned short us[2]; + } tmp; + tmp.f = f; +#ifdef __BIG_ENDIAN__ + return BLI_color_to_srgb_table[tmp.us[0]]; +#else + return BLI_color_to_srgb_table[tmp.us[1]]; +#endif +} + +MINLINE void linearrgb_to_srgb_ushort4(unsigned short srgb[4], const float linear[4]) +{ + srgb[0] = to_srgb_table_lookup(linear[0]); + srgb[1] = to_srgb_table_lookup(linear[1]); + srgb[2] = to_srgb_table_lookup(linear[2]); + srgb[3] = FTOUSHORT(linear[3]); +} + +MINLINE void linearrgb_to_srgb_ushort4_predivide(unsigned short srgb[4], const float linear[4]) +{ + float alpha, inv_alpha, t; + int i; + + if(linear[3] == 1.0f || linear[3] == 0.0f) { + linearrgb_to_srgb_ushort4(srgb, linear); + return; + } + + alpha = linear[3]; + inv_alpha = 1.0f/alpha; + + for(i=0; i<3; ++i) { + t = linear[i] * inv_alpha; + srgb[i] = (t < 1.0f)? to_srgb_table_lookup(t) * alpha : FTOUSHORT(linearrgb_to_srgb(t) * alpha); + } + + srgb[3] = FTOUSHORT(linear[3]); +} + +MINLINE void srgb_to_linearrgb_uchar4(float linear[4], const unsigned char srgb[4]) +{ + linear[0] = BLI_color_from_srgb_table[srgb[0]]; + linear[1] = BLI_color_from_srgb_table[srgb[1]]; + linear[2] = BLI_color_from_srgb_table[srgb[2]]; + linear[3] = srgb[3] * (1.0f/255.0f); +} + +MINLINE void srgb_to_linearrgb_uchar4_predivide(float linear[4], const unsigned char srgb[4]) +{ + float alpha, inv_alpha; + int i; + + if(srgb[3] == 255 || srgb[3] == 0) { + srgb_to_linearrgb_uchar4(linear, srgb); + return; + } + + alpha = srgb[3] * (1.0f/255.0f); + inv_alpha = 1.0f/alpha; + + for(i=0; i<3; ++i) + linear[i] = linearrgb_to_srgb(srgb[i] * inv_alpha) * alpha; + + linear[3] = alpha; +} + #endif /* BLI_MATH_COLOR_INLINE_H */ diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c index 9adb39f09ef..bbdb9bc5823 100644 --- a/source/blender/blenlib/intern/path_util.c +++ b/source/blender/blenlib/intern/path_util.c @@ -52,7 +52,7 @@ #include "GHOST_Path-api.h" -#if defined WIN32 && !defined _LIBC +#if defined WIN32 && !defined _LIBC || defined __sun # include "BLI_fnmatch.h" /* use fnmatch included in blenlib */ #else # ifndef _GNU_SOURCE @@ -627,8 +627,10 @@ int BLI_path_frame_range(char *path, int sta, int end, int digits) if (stringframe_chars(path, &ch_sta, &ch_end)) { /* warning, ch_end is the last # +1 */ char tmp[FILE_MAX]; - sprintf(tmp, "%.*s%.*d-%.*d%s", ch_sta, path, ch_end-ch_sta, sta, ch_end-ch_sta, end, path+ch_end); - strcpy(path, tmp); + BLI_snprintf(tmp, sizeof(tmp), + "%.*s%.*d-%.*d%s", + ch_sta, path, ch_end-ch_sta, sta, ch_end-ch_sta, end, path+ch_end); + BLI_strncpy(path, tmp, FILE_MAX); return 1; } return 0; diff --git a/source/blender/blenlib/intern/storage.c b/source/blender/blenlib/intern/storage.c index c5b6f46b3bc..df0634e4fcf 100644 --- a/source/blender/blenlib/intern/storage.c +++ b/source/blender/blenlib/intern/storage.c @@ -203,7 +203,7 @@ static void bli_builddir(const char *dirname, const char *relname) char buf[256]; DIR *dir; - strcpy(buf,relname); + BLI_strncpy(buf, relname, sizeof(buf)); rellen=strlen(relname); if (rellen){ @@ -220,7 +220,7 @@ static void bli_builddir(const char *dirname, const char *relname) while ((fname = (struct dirent*) readdir(dir)) != NULL) { dlink = (struct dirlink *)malloc(sizeof(struct dirlink)); if (dlink){ - strcpy(buf+rellen,fname->d_name); + BLI_strncpy(buf + rellen ,fname->d_name, sizeof(buf) - rellen); dlink->name = BLI_strdup(buf); BLI_addhead(dirbase,dlink); newnum++; @@ -343,8 +343,8 @@ static void bli_adddirstrings(void) tm= localtime(&file->s.st_mtime); // prevent impossible dates in windows if(tm==NULL) tm= localtime(&zero); - strftime(file->time, 8, "%H:%M", tm); - strftime(file->date, 16, "%d-%b-%y", tm); + strftime(file->time, sizeof(file->time), "%H:%M", tm); + strftime(file->date, sizeof(file->date), "%d-%b-%y", tm); /* * Seems st_size is signed 32-bit value in *nix and Windows. This @@ -354,38 +354,43 @@ static void bli_adddirstrings(void) st_size= file->s.st_size; if (st_size > 1024*1024*1024) { - sprintf(file->size, "%.2f GB", ((double)st_size)/(1024*1024*1024)); + BLI_snprintf(file->size, sizeof(file->size), "%.2f GB", ((double)st_size)/(1024*1024*1024)); } else if (st_size > 1024*1024) { - sprintf(file->size, "%.1f MB", ((double)st_size)/(1024*1024)); + BLI_snprintf(file->size, sizeof(file->size), "%.1f MB", ((double)st_size)/(1024*1024)); } else if (st_size > 1024) { - sprintf(file->size, "%d KB", (int)(st_size/1024)); + BLI_snprintf(file->size, sizeof(file->size), "%d KB", (int)(st_size/1024)); } else { - sprintf(file->size, "%d B", (int)st_size); + BLI_snprintf(file->size, sizeof(file->size), "%d B", (int)st_size); } - strftime(datum, 32, "%d-%b-%y %H:%M", tm); + strftime(datum, 32, "%d-%b-%y %H:%M", tm); /* XXX, is this used? - campbell */ if (st_size < 1000) { - sprintf(size, "%10d", (int) st_size); - } else if (st_size < 1000 * 1000) { - sprintf(size, "%6d %03d", (int) (st_size / 1000), (int) (st_size % 1000)); - } else if (st_size < 100 * 1000 * 1000) { - sprintf(size, "%2d %03d %03d", (int) (st_size / (1000 * 1000)), (int) ((st_size / 1000) % 1000), (int) ( st_size % 1000)); - } else { - sprintf(size, "> %4.1f M", (double) (st_size / (1024.0 * 1024.0))); - sprintf(size, "%10d", (int) st_size); + BLI_snprintf(size, sizeof(size), "%10d", + (int) st_size); + } + else if (st_size < 1000 * 1000) { + BLI_snprintf(size, sizeof(size), "%6d %03d", + (int) (st_size / 1000), (int) (st_size % 1000)); + } + else if (st_size < 100 * 1000 * 1000) { + BLI_snprintf(size, sizeof(size), "%2d %03d %03d", + (int) (st_size / (1000 * 1000)), (int) ((st_size / 1000) % 1000), (int) ( st_size % 1000)); + } + else { + /* XXX, whats going on here?. 2x calls - campbell */ + BLI_snprintf(size, sizeof(size), "> %4.1f M", (double) (st_size / (1024.0 * 1024.0))); + BLI_snprintf(size, sizeof(size), "%10d", (int) st_size); } - sprintf(buf,"%s %s %s %7s %s %s %10s %s", file->mode1, file->mode2, file->mode3, file->owner, file->date, file->time, size, - file->relname); + BLI_snprintf(buf, sizeof(buf), "%s %s %s %7s %s %s %10s %s", + file->mode1, file->mode2, file->mode3, file->owner, + file->date, file->time, size, file->relname); - file->string=MEM_mallocN(strlen(buf)+1, "filestring"); - if (file->string){ - strcpy(file->string,buf); - } + file->string = BLI_strdup(buf); } } diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 029e526c256..fffe6a737a4 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -5174,7 +5174,6 @@ static void lib_link_screen(FileData *fd, Main *main) } else if(sl->spacetype==SPACE_BUTS) { SpaceButs *sbuts= (SpaceButs *)sl; - sbuts->ri= NULL; sbuts->pinid= newlibadr(fd, sc->id.lib, sbuts->pinid); sbuts->mainbo= sbuts->mainb; sbuts->mainbuser= sbuts->mainb; @@ -6749,14 +6748,14 @@ static void customdata_version_242(Mesh *me) if (layer->type == CD_MTFACE) { if (layer->name[0] == 0) { if (mtfacen == 0) strcpy(layer->name, "UVMap"); - else sprintf(layer->name, "UVMap.%.3d", mtfacen); + else BLI_snprintf(layer->name, sizeof(layer->name), "UVMap.%.3d", mtfacen); } mtfacen++; } else if (layer->type == CD_MCOL) { if (layer->name[0] == 0) { if (mcoln == 0) strcpy(layer->name, "Col"); - else sprintf(layer->name, "Col.%.3d", mcoln); + else BLI_snprintf(layer->name, sizeof(layer->name), "Col.%.3d", mcoln); } mcoln++; } @@ -9251,8 +9250,9 @@ static void do_versions(FileData *fd, Library *lib, Main *main) strcpy(kb->name, "Basis"); } else { - if(kb->name[0]==0) - sprintf(kb->name, "Key %d", index); + if (kb->name[0]==0) { + BLI_snprintf(kb->name, sizeof(kb->name), "Key %d", index); + } kb->adrcode= index++; } } @@ -10245,7 +10245,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) BLI_addtail(&ob->particlesystem, psys); md= modifier_new(eModifierType_ParticleSystem); - sprintf(md->name, "ParticleSystem %i", BLI_countlist(&ob->particlesystem)); + BLI_snprintf(md->name, sizeof(md->name), "ParticleSystem %i", BLI_countlist(&ob->particlesystem)); psmd= (ParticleSystemModifierData*) md; psmd->psys=psys; BLI_addtail(&ob->modifiers, md); @@ -11092,7 +11092,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) sce->gm.dome.warptext = sce->r.dometext; //Stand Alone - sce->gm.fullscreen = sce->r.fullscreen; + sce->gm.playerflag |= (sce->r.fullscreen?GAME_PLAYER_FULLSCREEN:0); sce->gm.xplay = sce->r.xplay; sce->gm.yplay = sce->r.yplay; sce->gm.freqplay = sce->r.freqplay; @@ -13128,9 +13128,43 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } } + if (main->versionfile < 261 || (main->versionfile == 261 && main->subversionfile < 2)) + { + { + /* convert Camera Actuator values to defines */ + Object *ob; + bActuator *act; + for(ob = main->object.first; ob; ob= ob->id.next) { + for(act= ob->actuators.first; act; act= act->next) { + if (act->type == ACT_CAMERA) { + bCameraActuator *ba= act->data; + + if(ba->axis==(float) 'x') ba->axis=OB_POSX; + else if (ba->axis==(float)'y') ba->axis=OB_POSY; + /* don't do an if/else to avoid imediate subversion bump*/ +// ba->axis=((ba->axis == (float) 'x')?OB_POSX_X:OB_POSY); + } + } + } + } + + { + /* convert deprecated sculpt_paint_unified_* fields to + UnifiedPaintSettings */ + Scene *scene; + for(scene= main->scene.first; scene; scene= scene->id.next) { + ToolSettings *ts= scene->toolsettings; + UnifiedPaintSettings *ups= &ts->unified_paint_settings; + ups->size= ts->sculpt_paint_unified_size; + ups->unprojected_radius= ts->sculpt_paint_unified_unprojected_radius; + ups->alpha= ts->sculpt_paint_unified_alpha; + ups->flag= ts->sculpt_paint_settings; + } + } + } + /* put compatibility code here until next subversion bump */ { - } /* default values in Freestyle settings */ diff --git a/source/blender/editors/animation/anim_draw.c b/source/blender/editors/animation/anim_draw.c index 569125e1055..32e5fe82ed4 100644 --- a/source/blender/editors/animation/anim_draw.c +++ b/source/blender/editors/animation/anim_draw.c @@ -180,7 +180,7 @@ void ANIM_timecode_string_from_frame (char *str, Scene *scene, int power, short static void draw_cfra_number (Scene *scene, View2D *v2d, float cfra, short time) { float xscale, yscale, x, y; - char str[32] = " t"; /* t is the character to start replacing from */ + char numstr[32] = " t"; /* t is the character to start replacing from */ short slen; /* because the frame number text is subject to the same scaling as the contents of the view */ @@ -193,10 +193,10 @@ static void draw_cfra_number (Scene *scene, View2D *v2d, float cfra, short time) * but power = 1 is required for frames (to get integer frames) */ if (time) - ANIM_timecode_string_from_frame(&str[4], scene, 0, time, FRA2TIME(cfra)); + ANIM_timecode_string_from_frame(&numstr[4], scene, 0, time, FRA2TIME(cfra)); else - ANIM_timecode_string_from_frame(&str[4], scene, 1, time, cfra); - slen= (short)UI_GetStringWidth(str) - 1; + ANIM_timecode_string_from_frame(&numstr[4], scene, 1, time, cfra); + slen= (short)UI_GetStringWidth(numstr) - 1; /* get starting coordinates for drawing */ x= cfra * xscale; @@ -208,7 +208,7 @@ static void draw_cfra_number (Scene *scene, View2D *v2d, float cfra, short time) /* draw current frame number - black text */ UI_ThemeColor(TH_TEXT); - UI_DrawString(x-5, y+3, str); + UI_DrawString(x-5, y+3, numstr); /* restore view transform */ glScalef(xscale, 1.0, 1.0); diff --git a/source/blender/editors/animation/anim_ipo_utils.c b/source/blender/editors/animation/anim_ipo_utils.c index 8c4e0065a19..169d6b94413 100644 --- a/source/blender/editors/animation/anim_ipo_utils.c +++ b/source/blender/editors/animation/anim_ipo_utils.c @@ -134,8 +134,8 @@ int getname_anim_fcurve(char *name, ID *id, FCurve *fcu) char c= RNA_property_array_item_char(prop, fcu->array_index); /* we need to write the index to a temp buffer (in py syntax) */ - if (c) sprintf(arrayindbuf, "%c ", c); - else sprintf(arrayindbuf, "[%d]", fcu->array_index); + if (c) BLI_snprintf(arrayindbuf, sizeof(arrayindbuf), "%c ", c); + else BLI_snprintf(arrayindbuf, sizeof(arrayindbuf), "[%d]", fcu->array_index); arrayname= &arrayindbuf[0]; } diff --git a/source/blender/editors/animation/anim_ops.c b/source/blender/editors/animation/anim_ops.c index aa61afbac78..5b246e63a20 100644 --- a/source/blender/editors/animation/anim_ops.c +++ b/source/blender/editors/animation/anim_ops.c @@ -277,78 +277,12 @@ static void ANIM_OT_previewrange_clear(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } -/* ****************** time display toggle operator ****************************/ - -static int toggle_time_exec(bContext *C, wmOperator *UNUSED(op)) -{ - ScrArea *curarea= CTX_wm_area(C); - - if (curarea == NULL) - return OPERATOR_CANCELLED; - - /* simply toggle draw frames flag in applicable spaces */ - // XXX or should relevant spaces define their own version of this? - switch (curarea->spacetype) { - case SPACE_TIME: /* TimeLine */ - { - SpaceTime *stime= CTX_wm_space_time(C); - stime->flag ^= TIME_DRAWFRAMES; - } - break; - case SPACE_ACTION: /* Action Editor */ - { - SpaceAction *saction= CTX_wm_space_action(C); - saction->flag ^= SACTION_DRAWTIME; - } - break; - case SPACE_IPO: /* Graph Editor */ - { - SpaceIpo *sipo= CTX_wm_space_graph(C); - sipo->flag ^= SIPO_DRAWTIME; - } - break; - case SPACE_NLA: /* NLA Editor */ - { - SpaceNla *snla= CTX_wm_space_nla(C); - snla->flag ^= SNLA_DRAWTIME; - } - break; - case SPACE_SEQ: /* Sequencer */ - { - SpaceSeq *sseq= CTX_wm_space_seq(C); - sseq->flag ^= SEQ_DRAWFRAMES; - } - break; - - default: /* editor doesn't show frames */ - return OPERATOR_CANCELLED; // XXX or should we pass through instead? - } - - ED_area_tag_redraw(curarea); - - return OPERATOR_FINISHED; -} - -static void ANIM_OT_time_toggle(wmOperatorType *ot) -{ - /* identifiers */ - ot->name= "Toggle Frames/Seconds"; - ot->idname= "ANIM_OT_time_toggle"; - ot->description= "Toggle whether timing is displayed in frames or seconds for active timeline view"; - - /* api callbacks */ - ot->exec= toggle_time_exec; - - ot->poll= ED_operator_animview_active; -} - /* ************************** registration **********************************/ 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); @@ -382,11 +316,14 @@ void ED_operatortypes_anim(void) void ED_keymap_anim(wmKeyConfig *keyconf) { wmKeyMap *keymap= WM_keymap_find(keyconf, "Animation", 0, 0); + wmKeyMapItem *kmi; /* frame management */ /* NOTE: 'ACTIONMOUSE' not 'LEFTMOUSE', as user may have swapped mouse-buttons */ 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); + + kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", TKEY, KM_PRESS, KM_CTRL, 0); + RNA_string_set(kmi->ptr, "data_path", "space_data.show_seconds"); /* preview range */ WM_keymap_verify_item(keymap, "ANIM_OT_previewrange_set", PKEY, KM_PRESS, 0, 0); diff --git a/source/blender/editors/armature/armature_intern.h b/source/blender/editors/armature/armature_intern.h index 87254c20c0f..40d909380a0 100644 --- a/source/blender/editors/armature/armature_intern.h +++ b/source/blender/editors/armature/armature_intern.h @@ -99,7 +99,6 @@ void POSE_OT_copy(struct wmOperatorType *ot); void POSE_OT_paste(struct wmOperatorType *ot); void POSE_OT_select_all(struct wmOperatorType *ot); -void POSE_OT_select_inverse(struct wmOperatorType *ot); void POSE_OT_select_parent(struct wmOperatorType *ot); void POSE_OT_select_hierarchy(struct wmOperatorType *ot); void POSE_OT_select_linked(struct wmOperatorType *ot); diff --git a/source/blender/editors/armature/armature_ops.c b/source/blender/editors/armature/armature_ops.c index d559aef6fe2..81482466a30 100644 --- a/source/blender/editors/armature/armature_ops.c +++ b/source/blender/editors/armature/armature_ops.c @@ -114,7 +114,6 @@ void ED_operatortypes_armature(void) WM_operatortype_append(POSE_OT_paste); WM_operatortype_append(POSE_OT_select_all); - WM_operatortype_append(POSE_OT_select_inverse); WM_operatortype_append(POSE_OT_select_parent); WM_operatortype_append(POSE_OT_select_hierarchy); @@ -227,9 +226,10 @@ void ED_keymap_armature(wmKeyConfig *keyconf) RNA_boolean_set(kmi->ptr, "snap", 1); /* only set in editmode armature, by space_view3d listener */ - WM_keymap_add_item(keymap, "ARMATURE_OT_hide", HKEY, KM_PRESS, 0, 0); + kmi = WM_keymap_add_item(keymap, "ARMATURE_OT_hide", HKEY, KM_PRESS, 0, 0); + RNA_boolean_set(kmi->ptr, "unselected", FALSE); kmi= WM_keymap_add_item(keymap, "ARMATURE_OT_hide", HKEY, KM_PRESS, KM_SHIFT, 0); - RNA_boolean_set(kmi->ptr, "unselected", 1); + RNA_boolean_set(kmi->ptr, "unselected", TRUE); WM_keymap_add_item(keymap, "ARMATURE_OT_reveal", HKEY, KM_PRESS, KM_ALT, 0); WM_keymap_add_item(keymap, "ARMATURE_OT_align", AKEY, KM_PRESS, KM_CTRL|KM_ALT, 0); WM_keymap_add_item(keymap, "ARMATURE_OT_calculate_roll", NKEY, KM_PRESS, KM_CTRL, 0); @@ -241,20 +241,24 @@ void ED_keymap_armature(wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "ARMATURE_OT_parent_set", PKEY, KM_PRESS, KM_CTRL, 0); WM_keymap_add_item(keymap, "ARMATURE_OT_parent_clear", PKEY, KM_PRESS, KM_ALT, 0); - WM_keymap_add_item(keymap, "ARMATURE_OT_select_all", AKEY, KM_PRESS, 0, 0); - WM_keymap_add_item(keymap, "ARMATURE_OT_select_inverse", IKEY, KM_PRESS, KM_CTRL, 0); + kmi = WM_keymap_add_item(keymap, "ARMATURE_OT_select_all", AKEY, KM_PRESS, 0, 0); + RNA_enum_set(kmi->ptr, "action", SEL_TOGGLE); + kmi = WM_keymap_add_item(keymap, "ARMATURE_OT_select_all", IKEY, KM_PRESS, KM_CTRL, 0); + RNA_enum_set(kmi->ptr, "action", SEL_INVERT); kmi= WM_keymap_add_item(keymap, "ARMATURE_OT_select_hierarchy", LEFTBRACKETKEY, KM_PRESS, 0, 0); RNA_enum_set(kmi->ptr, "direction", BONE_SELECT_PARENT); + RNA_boolean_set(kmi->ptr, "extend", FALSE); kmi= WM_keymap_add_item(keymap, "ARMATURE_OT_select_hierarchy", LEFTBRACKETKEY, KM_PRESS, KM_SHIFT, 0); RNA_enum_set(kmi->ptr, "direction", BONE_SELECT_PARENT); - RNA_boolean_set(kmi->ptr, "extend", 1); + RNA_boolean_set(kmi->ptr, "extend", TRUE); kmi= WM_keymap_add_item(keymap, "ARMATURE_OT_select_hierarchy", RIGHTBRACKETKEY, KM_PRESS, 0, 0); RNA_enum_set(kmi->ptr, "direction", BONE_SELECT_CHILD); + RNA_boolean_set(kmi->ptr, "extend", FALSE); kmi= WM_keymap_add_item(keymap, "ARMATURE_OT_select_hierarchy", RIGHTBRACKETKEY, KM_PRESS, KM_SHIFT, 0); RNA_enum_set(kmi->ptr, "direction", BONE_SELECT_CHILD); - RNA_boolean_set(kmi->ptr, "extend", 1); + RNA_boolean_set(kmi->ptr, "extend", TRUE); WM_keymap_add_item(keymap, "ARMATURE_OT_select_linked", LKEY, KM_PRESS, 0, 0); @@ -321,22 +325,26 @@ void ED_keymap_armature(wmKeyConfig *keyconf) kmi= WM_keymap_add_item(keymap, "POSE_OT_paste", VKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0); RNA_boolean_set(kmi->ptr, "flipped", 1); - WM_keymap_add_item(keymap, "POSE_OT_select_all", AKEY, KM_PRESS, 0, 0); - WM_keymap_add_item(keymap, "POSE_OT_select_inverse", IKEY, KM_PRESS, KM_CTRL, 0); + kmi = WM_keymap_add_item(keymap, "POSE_OT_select_all", AKEY, KM_PRESS, 0, 0); + RNA_enum_set(kmi->ptr, "action", SEL_TOGGLE); + kmi = WM_keymap_add_item(keymap, "POSE_OT_select_all", IKEY, KM_PRESS, KM_CTRL, 0); + RNA_enum_set(kmi->ptr, "action", SEL_INVERT); WM_keymap_add_item(keymap, "POSE_OT_select_parent", PKEY, KM_PRESS, KM_SHIFT, 0); kmi= WM_keymap_add_item(keymap, "POSE_OT_select_hierarchy", LEFTBRACKETKEY, KM_PRESS, 0, 0); RNA_enum_set(kmi->ptr, "direction", BONE_SELECT_PARENT); + RNA_boolean_set(kmi->ptr, "extend", FALSE); kmi= WM_keymap_add_item(keymap, "POSE_OT_select_hierarchy", LEFTBRACKETKEY, KM_PRESS, KM_SHIFT, 0); RNA_enum_set(kmi->ptr, "direction", BONE_SELECT_PARENT); - RNA_boolean_set(kmi->ptr, "extend", 1); + RNA_boolean_set(kmi->ptr, "extend", TRUE); kmi= WM_keymap_add_item(keymap, "POSE_OT_select_hierarchy", RIGHTBRACKETKEY, KM_PRESS, 0, 0); RNA_enum_set(kmi->ptr, "direction", BONE_SELECT_CHILD); + RNA_boolean_set(kmi->ptr, "extend", FALSE); kmi= WM_keymap_add_item(keymap, "POSE_OT_select_hierarchy", RIGHTBRACKETKEY, KM_PRESS, KM_SHIFT, 0); RNA_enum_set(kmi->ptr, "direction", BONE_SELECT_CHILD); - RNA_boolean_set(kmi->ptr, "extend", 1); + RNA_boolean_set(kmi->ptr, "extend", TRUE); WM_keymap_add_item(keymap, "POSE_OT_select_linked", LKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "POSE_OT_select_grouped", GKEY, KM_PRESS, KM_SHIFT, 0); diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c index becc7e9b68f..5df4d42ad96 100644 --- a/source/blender/editors/armature/editarmature.c +++ b/source/blender/editors/armature/editarmature.c @@ -3457,7 +3457,7 @@ static int armature_bone_primitive_add_exec(bContext *C, wmOperator *op) Object *obedit = CTX_data_edit_object(C); EditBone *bone; float obmat[3][3], curs[3], viewmat[3][3], totmat[3][3], imat[3][3]; - char name[32]; + char name[MAXBONENAME]; RNA_string_get(op->ptr, "name", name); @@ -3507,7 +3507,7 @@ void ARMATURE_OT_bone_primitive_add(wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - RNA_def_string(ot->srna, "name", "Bone", 32, "Name", "Name of the newly created bone"); + RNA_def_string(ot->srna, "name", "Bone", MAXBONENAME, "Name", "Name of the newly created bone"); } @@ -5031,38 +5031,6 @@ void POSE_OT_transforms_clear(wmOperatorType *ot) /* ***************** selections ********************** */ -static int pose_select_inverse_exec(bContext *C, wmOperator *UNUSED(op)) -{ - - /* Set the flags */ - CTX_DATA_BEGIN(C, bPoseChannel *, pchan, visible_pose_bones) - { - if ((pchan->bone->flag & BONE_UNSELECTABLE) == 0) { - pchan->bone->flag ^= (BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL); - } - } - CTX_DATA_END; - - WM_event_add_notifier(C, NC_OBJECT|ND_BONE_SELECT, NULL); - - return OPERATOR_FINISHED; -} - -void POSE_OT_select_inverse(wmOperatorType *ot) -{ - /* identifiers */ - ot->name= "Select Inverse"; - ot->idname= "POSE_OT_select_inverse"; - ot->description= "Flip the selection status of bones (selected -> unselected, unselected -> selected)"; - - /* api callbacks */ - ot->exec= pose_select_inverse_exec; - ot->poll= ED_operator_posemode; - - /* flags */ - ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - -} static int pose_de_select_all_exec(bContext *C, wmOperator *op) { int action = RNA_enum_get(op->ptr, "action"); @@ -5499,7 +5467,7 @@ static int armature_autoside_names_exec (bContext *C, wmOperator *op) { Object *ob= CTX_data_edit_object(C); bArmature *arm; - char newname[32]; + char newname[MAXBONENAME]; short axis= RNA_enum_get(op->ptr, "type"); /* paranoia checks */ diff --git a/source/blender/editors/armature/editarmature_retarget.c b/source/blender/editors/armature/editarmature_retarget.c index 451e672da7c..9ec27b69835 100644 --- a/source/blender/editors/armature/editarmature_retarget.c +++ b/source/blender/editors/armature/editarmature_retarget.c @@ -450,7 +450,7 @@ static void renameTemplateBone(char *name, char *template_name, ListBase *editbo { int i, j; - for (i = 0, j = 0; template_name[i] != '\0' && i < 31 && j < 31; i++) + for (i = 0, j = 0; template_name[i] != '\0' && i < (MAXBONENAME-1) && j < (MAXBONENAME-1); i++) { if (template_name[i] == '&') { @@ -485,7 +485,7 @@ static void renameTemplateBone(char *name, char *template_name, ListBase *editbo static RigControl *cloneControl(RigGraph *rg, RigGraph *src_rg, RigControl *src_ctrl, GHash *ptr_hash, char *side_string, char *num_string) { RigControl *ctrl; - char name[32]; + char name[MAXBONENAME]; ctrl = newRigControl(rg); @@ -541,7 +541,7 @@ static RigArc *cloneArc(RigGraph *rg, RigGraph *src_rg, RigArc *src_arc, GHash * if (src_edge->bone != NULL) { - char name[32]; + char name[MAXBONENAME]; renameTemplateBone(name, src_edge->bone->name, rg->editbones, side_string, num_string); edge->bone = duplicateEditBoneObjects(src_edge->bone, name, rg->editbones, src_rg->ob, rg->ob); edge->bone->flag &= ~(BONE_TIPSEL|BONE_SELECTED|BONE_ROOTSEL); @@ -1453,7 +1453,7 @@ static void RIG_printCtrl(RigControl *ctrl, char *indent) printf("%sBone: %s\n", indent, ctrl->bone->name); printf("%sLink: %s\n", indent, ctrl->link ? ctrl->link->name : "!NONE!"); - sprintf(text, "%soffset", indent); + BLI_snprintf(text, sizeof(text), "%soffset", indent); print_v3(text, ctrl->offset); printf("%sFlag: %i\n", indent, ctrl->flag); diff --git a/source/blender/editors/armature/meshlaplacian.c b/source/blender/editors/armature/meshlaplacian.c index 502da1be8ac..e33b778a168 100644 --- a/source/blender/editors/armature/meshlaplacian.c +++ b/source/blender/editors/armature/meshlaplacian.c @@ -45,6 +45,7 @@ #include "BLI_edgehash.h" #include "BLI_memarena.h" #include "BLI_utildefines.h" +#include "BLI_string.h" #include "BKE_DerivedMesh.h" #include "BKE_modifier.h" @@ -1613,7 +1614,7 @@ static void meshdeform_matrix_solve(MeshDeformModifierData *mmd, MeshDeformBind NLContext *context; float vec[3], gridvec[3]; int a, b, x, y, z, totvar; - char message[1024]; + char message[256]; /* setup variable indices */ mdb->varidx= MEM_callocN(sizeof(int)*mdb->size3, "MeshDeformDSvaridx"); @@ -1715,7 +1716,7 @@ static void meshdeform_matrix_solve(MeshDeformModifierData *mmd, MeshDeformBind break; } - sprintf(message, "Mesh deform solve %d / %d |||", a+1, mdb->totcagevert); + BLI_snprintf(message, sizeof(message), "Mesh deform solve %d / %d |||", a+1, mdb->totcagevert); progress_bar((float)(a+1)/(float)(mdb->totcagevert), message); } diff --git a/source/blender/editors/armature/poseSlide.c b/source/blender/editors/armature/poseSlide.c index efc8ffe4c7d..c28b688e377 100644 --- a/source/blender/editors/armature/poseSlide.c +++ b/source/blender/editors/armature/poseSlide.c @@ -523,28 +523,28 @@ static void pose_slide_reset (tPoseSlideOp *pso) /* draw percentage indicator in header */ static void pose_slide_draw_status (tPoseSlideOp *pso) { - char statusStr[32]; - char mode[32]; + char status_str[32]; + char mode_str[32]; switch (pso->mode) { case POSESLIDE_PUSH: - strcpy(mode, "Push Pose"); + strcpy(mode_str, "Push Pose"); break; case POSESLIDE_RELAX: - strcpy(mode, "Relax Pose"); + strcpy(mode_str, "Relax Pose"); break; case POSESLIDE_BREAKDOWN: - strcpy(mode, "Breakdown"); + strcpy(mode_str, "Breakdown"); break; default: // unknown - strcpy(mode, "Sliding-Tool"); + strcpy(mode_str, "Sliding-Tool"); break; } - sprintf(statusStr, "%s: %d %%", mode, (int)(pso->percentage*100.0f)); - ED_area_headerprint(pso->sa, statusStr); + BLI_snprintf(status_str, sizeof(status_str), "%s: %d %%", mode_str, (int)(pso->percentage*100.0f)); + ED_area_headerprint(pso->sa, status_str); } /* common code for invoke() methods */ diff --git a/source/blender/editors/armature/poselib.c b/source/blender/editors/armature/poselib.c index 5cdb9c76396..dcddde207f0 100644 --- a/source/blender/editors/armature/poselib.c +++ b/source/blender/editors/armature/poselib.c @@ -977,7 +977,9 @@ static void poselib_preview_apply (bContext *C, wmOperator *op) /* do header print - if interactively previewing */ if (pld->state == PL_PREVIEW_RUNNING) { if (pld->flag & PL_PREVIEW_SHOWORIGINAL) { - sprintf(pld->headerstr, "PoseLib Previewing Pose: [Showing Original Pose] | Use Tab to start previewing poses again"); + BLI_strncpy(pld->headerstr, + "PoseLib Previewing Pose: [Showing Original Pose] | Use Tab to start previewing poses again", + sizeof(pld->headerstr)); ED_area_headerprint(pld->sa, pld->headerstr); } else if (pld->searchstr[0]) { @@ -988,10 +990,10 @@ static void poselib_preview_apply (bContext *C, wmOperator *op) /* get search-string */ index= pld->search_cursor; - if (index >= 0 && index <= 64) { + if (index >= 0 && index <= sizeof(tempstr) - 1) { memcpy(&tempstr[0], &pld->searchstr[0], index); tempstr[index]= '|'; - memcpy(&tempstr[index+1], &pld->searchstr[index], 64-index); + memcpy(&tempstr[index+1], &pld->searchstr[index], (sizeof(tempstr) - 1) - index); } else { BLI_strncpy(tempstr, pld->searchstr, sizeof(tempstr)); @@ -1000,11 +1002,18 @@ static void poselib_preview_apply (bContext *C, wmOperator *op) /* get marker name */ BLI_strncpy(markern, pld->marker ? pld->marker->name : "No Matches", sizeof(markern)); - sprintf(pld->headerstr, "PoseLib Previewing Pose: Filter - [%s] | Current Pose - \"%s\" | Use ScrollWheel or PageUp/Down to change", tempstr, markern); + BLI_snprintf(pld->headerstr, sizeof(pld->headerstr), + "PoseLib Previewing Pose: Filter - [%s] | " + "Current Pose - \"%s\" | " + "Use ScrollWheel or PageUp/Down to change", + tempstr, markern); ED_area_headerprint(pld->sa, pld->headerstr); } else { - sprintf(pld->headerstr, "PoseLib Previewing Pose: \"%s\" | Use ScrollWheel or PageUp/Down to change", pld->marker->name); + BLI_snprintf(pld->headerstr, sizeof(pld->headerstr), + "PoseLib Previewing Pose: \"%s\" | " + "Use ScrollWheel or PageUp/Down to change", + pld->marker->name); ED_area_headerprint(pld->sa, pld->headerstr); } } diff --git a/source/blender/editors/armature/poseobject.c b/source/blender/editors/armature/poseobject.c index 832ee55997b..b14ce7e4690 100644 --- a/source/blender/editors/armature/poseobject.c +++ b/source/blender/editors/armature/poseobject.c @@ -1777,7 +1777,7 @@ static int pose_autoside_names_exec (bContext *C, wmOperator *op) { Object *ob= object_pose_armature_get(CTX_data_active_object(C)); bArmature *arm; - char newname[32]; + char newname[MAXBONENAME]; short axis= RNA_enum_get(op->ptr, "axis"); /* paranoia checks */ diff --git a/source/blender/editors/armature/reeb.c b/source/blender/editors/armature/reeb.c index 80278c95d05..fe9eb6dcd01 100644 --- a/source/blender/editors/armature/reeb.c +++ b/source/blender/editors/armature/reeb.c @@ -2035,10 +2035,9 @@ void REEB_exportGraph(ReebGraph *rg, int count) if (count == -1) { - sprintf(filename, "test.txt"); + strcpy(filename, "test.txt"); } - else - { + else { sprintf(filename, "test%05i.txt", count); } f = fopen(filename, "w"); diff --git a/source/blender/editors/curve/curve_intern.h b/source/blender/editors/curve/curve_intern.h index 3287ebfb92f..2014345e163 100644 --- a/source/blender/editors/curve/curve_intern.h +++ b/source/blender/editors/curve/curve_intern.h @@ -106,7 +106,6 @@ void SURFACE_OT_primitive_nurbs_surface_torus_add(struct wmOperatorType *ot); void CURVE_OT_de_select_first(struct wmOperatorType *ot); void CURVE_OT_de_select_last(struct wmOperatorType *ot); void CURVE_OT_select_all(struct wmOperatorType *ot); -void CURVE_OT_select_inverse(struct wmOperatorType *ot); void CURVE_OT_select_linked(struct wmOperatorType *ot); void CURVE_OT_select_linked_pick(struct wmOperatorType *ot); void CURVE_OT_select_row(struct wmOperatorType *ot); diff --git a/source/blender/editors/curve/curve_ops.c b/source/blender/editors/curve/curve_ops.c index 1384b86065b..60fca7ae4bd 100644 --- a/source/blender/editors/curve/curve_ops.c +++ b/source/blender/editors/curve/curve_ops.c @@ -116,7 +116,6 @@ void ED_operatortypes_curve(void) WM_operatortype_append(CURVE_OT_de_select_first); WM_operatortype_append(CURVE_OT_de_select_last); WM_operatortype_append(CURVE_OT_select_all); - WM_operatortype_append(CURVE_OT_select_inverse); WM_operatortype_append(CURVE_OT_select_linked); WM_operatortype_append(CURVE_OT_select_linked_pick); WM_operatortype_append(CURVE_OT_select_row); @@ -159,7 +158,7 @@ void ED_operatormacros_curve(void) void ED_keymap_curve(wmKeyConfig *keyconf) { wmKeyMap *keymap; -// wmKeyMapItem *kmi; + wmKeyMapItem *kmi; keymap= WM_keymap_find(keyconf, "Font", 0, 0); keymap->poll= ED_operator_editfont; @@ -223,11 +222,14 @@ void ED_keymap_curve(wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "CURVE_OT_vertex_add", LEFTMOUSE, KM_CLICK, KM_CTRL, 0); - WM_keymap_add_item(keymap, "CURVE_OT_select_all", AKEY, KM_PRESS, 0, 0); + kmi = WM_keymap_add_item(keymap, "CURVE_OT_select_all", AKEY, KM_PRESS, 0, 0); + RNA_enum_set(kmi->ptr, "action", SEL_TOGGLE); + kmi = WM_keymap_add_item(keymap, "CURVE_OT_select_all", IKEY, KM_PRESS, KM_CTRL, 0); + RNA_enum_set(kmi->ptr, "action", SEL_INVERT); + WM_keymap_add_item(keymap, "CURVE_OT_select_row", RKEY, KM_PRESS, KM_SHIFT, 0); WM_keymap_add_item(keymap, "CURVE_OT_select_more", PADPLUSKEY, KM_PRESS, KM_CTRL, 0); WM_keymap_add_item(keymap, "CURVE_OT_select_less", PADMINUS, KM_PRESS, KM_CTRL, 0); - WM_keymap_add_item(keymap, "CURVE_OT_select_inverse", IKEY, KM_PRESS, KM_CTRL, 0); WM_keymap_add_item(keymap, "CURVE_OT_select_linked", LKEY, KM_PRESS, KM_CTRL, 0); WM_keymap_add_item(keymap, "CURVE_OT_select_linked_pick", LKEY, KM_PRESS, 0, 0); RNA_boolean_set(WM_keymap_add_item(keymap, "CURVE_OT_select_linked_pick", LKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "deselect", 1); diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index 762564c1cc9..a20fbad874e 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -1069,17 +1069,17 @@ static void curve_rename_fcurves(Object *obedit, ListBase *orig_curves) while (a--) { keyIndex= getCVKeyIndex(editnurb, bezt); if(keyIndex) { - sprintf(rna_path, "splines[%d].bezier_points[%d]", nu_index, pt_index); - sprintf(orig_rna_path, "splines[%d].bezier_points[%d]", keyIndex->nu_index, keyIndex->pt_index); + BLI_snprintf(rna_path, sizeof(rna_path), "splines[%d].bezier_points[%d]", nu_index, pt_index); + BLI_snprintf(orig_rna_path, sizeof(orig_rna_path), "splines[%d].bezier_points[%d]", keyIndex->nu_index, keyIndex->pt_index); if(keyIndex->switched) { char handle_path[64], orig_handle_path[64]; - sprintf(orig_handle_path, "%s.handle_left", orig_rna_path); - sprintf(handle_path, "%s.handle_right", rna_path); + BLI_snprintf(orig_handle_path, sizeof(orig_rna_path), "%s.handle_left", orig_rna_path); + BLI_snprintf(handle_path, sizeof(rna_path), "%s.handle_right", rna_path); fcurve_path_rename(ad, orig_handle_path, handle_path, orig_curves, &curves); - sprintf(orig_handle_path, "%s.handle_right", orig_rna_path); - sprintf(handle_path, "%s.handle_left", rna_path); + BLI_snprintf(orig_handle_path, sizeof(orig_rna_path), "%s.handle_right", orig_rna_path); + BLI_snprintf(handle_path, sizeof(rna_path), "%s.handle_left", rna_path); fcurve_path_rename(ad, orig_handle_path, handle_path, orig_curves, &curves); } @@ -1100,8 +1100,8 @@ static void curve_rename_fcurves(Object *obedit, ListBase *orig_curves) while (a--) { keyIndex= getCVKeyIndex(editnurb, bp); if(keyIndex) { - sprintf(rna_path, "splines[%d].points[%d]", nu_index, pt_index); - sprintf(orig_rna_path, "splines[%d].points[%d]", keyIndex->nu_index, keyIndex->pt_index); + BLI_snprintf(rna_path, sizeof(rna_path), "splines[%d].points[%d]", nu_index, pt_index); + BLI_snprintf(orig_rna_path, sizeof(orig_rna_path), "splines[%d].points[%d]", keyIndex->nu_index, keyIndex->pt_index); fcurve_path_rename(ad, orig_rna_path, rna_path, orig_curves, &curves); keyIndex->nu_index= nu_index; @@ -1140,8 +1140,8 @@ static void curve_rename_fcurves(Object *obedit, ListBase *orig_curves) } if(keyIndex) { - sprintf(rna_path, "splines[%d]", nu_index); - sprintf(orig_rna_path, "splines[%d]", keyIndex->nu_index); + BLI_snprintf(rna_path, sizeof(rna_path), "splines[%d]", nu_index); + BLI_snprintf(orig_rna_path, sizeof(orig_rna_path), "splines[%d]", keyIndex->nu_index); fcurve_path_rename(ad, orig_rna_path, rna_path, orig_curves, &curves); } @@ -2749,64 +2749,6 @@ void CURVE_OT_reveal(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } -/********************** select invert operator *********************/ - -static int select_inverse_exec(bContext *C, wmOperator *UNUSED(op)) -{ - Object *obedit= CTX_data_edit_object(C); - Curve *cu= obedit->data; - ListBase *editnurb= object_editcurve_get(obedit); - Nurb *nu; - BPoint *bp; - BezTriple *bezt; - int a; - - cu->lastsel= NULL; - - for(nu= editnurb->first; nu; nu= nu->next) { - if(nu->type == CU_BEZIER) { - bezt= nu->bezt; - a= nu->pntsu; - while(a--) { - if(bezt->hide==0) { - bezt->f2 ^= SELECT; /* always do the center point */ - if((cu->drawflag & CU_HIDE_HANDLES)==0) { - bezt->f1 ^= SELECT; - bezt->f3 ^= SELECT; - } - } - bezt++; - } - } - else { - bp= nu->bp; - a= nu->pntsu*nu->pntsv; - while(a--) { - swap_selection_bpoint(bp); - bp++; - } - } - } - - WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); - - return OPERATOR_FINISHED; -} - -void CURVE_OT_select_inverse(wmOperatorType *ot) -{ - /* identifiers */ - ot->name= "Select Inverse"; - ot->idname= "CURVE_OT_select_inverse"; - - /* api callbacks */ - ot->exec= select_inverse_exec; - ot->poll= ED_operator_editsurfcurve; - - /* flags */ - ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; -} - /********************** subdivide operator *********************/ /** Divide the line segments associated with the currently selected @@ -4607,8 +4549,6 @@ static int addvert_Nurb(bContext *C, short mode, float location[3]) } } - // XXX retopo_do_all(); - if(ok) { test2DNurb(nu); @@ -4636,7 +4576,7 @@ static int add_vertex_invoke(bContext *C, wmOperator *op, wmEvent *event) { RegionView3D *rv3d= CTX_wm_region_view3d(C); - if(rv3d && !RNA_property_is_set(op->ptr, "location")) { + if(rv3d && !RNA_struct_property_is_set(op->ptr, "location")) { Curve *cu; ViewContext vc; float location[3]; diff --git a/source/blender/editors/curve/editfont.c b/source/blender/editors/curve/editfont.c index 40812808d06..a2cbe6f7def 100644 --- a/source/blender/editors/curve/editfont.c +++ b/source/blender/editors/curve/editfont.c @@ -398,7 +398,7 @@ static int paste_file_exec(bContext *C, wmOperator *op) static int paste_file_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { - if(RNA_property_is_set(op->ptr, "filepath")) + if(RNA_struct_property_is_set(op->ptr, "filepath")) return paste_file_exec(C, op); WM_event_add_fileselect(C, op); @@ -1190,7 +1190,7 @@ static int insert_text_exec(bContext *C, wmOperator *op) wchar_t *inserted_text; int a, len; - if(!RNA_property_is_set(op->ptr, "text")) + if(!RNA_struct_property_is_set(op->ptr, "text")) return OPERATOR_CANCELLED; inserted_utf8= RNA_string_get_alloc(op->ptr, "text", NULL, 0); @@ -1223,10 +1223,10 @@ static int insert_text_invoke(bContext *C, wmOperator *op, wmEvent *evt) int event= evt->type, val= evt->val; wchar_t inserted_text[2]= {0}; - if(RNA_property_is_set(op->ptr, "text")) + if(RNA_struct_property_is_set(op->ptr, "text")) return insert_text_exec(C, op); - if(RNA_property_is_set(op->ptr, "accent")) { + if(RNA_struct_property_is_set(op->ptr, "accent")) { if(cu->len!=0 && cu->pos>0) accentcode= 1; return OPERATOR_FINISHED; @@ -1673,7 +1673,7 @@ static int open_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) path = (font && strcmp(font->name, FO_BUILTIN_NAME) != 0)? font->name: U.fontdir; - if(RNA_property_is_set(op->ptr, "filepath")) + if(RNA_struct_property_is_set(op->ptr, "filepath")) return font_open_exec(C, op); RNA_string_set(op->ptr, "filepath", path); diff --git a/source/blender/editors/datafiles/Bfont.c b/source/blender/editors/datafiles/Bfont.c index 8a9e2748983..7f40f579ff9 100644 --- a/source/blender/editors/datafiles/Bfont.c +++ b/source/blender/editors/datafiles/Bfont.c @@ -34,4 +34,1579 @@ int datatoc_Bfont_size= 25181; -char datatoc_Bfont[25181]= {128, 1, 228, 1, 0, 0, 37, 33, 80, 83, 45, 65, 100, 111, 98, 101, 70, 111, 110, 116, 45, 49, 46, 48, 58, 32, 66, 102, 111, 110, 116, 32, 48, 48, 49, 46, 48, 48, 49, 10, 49, 49, 32, 100, 105, 99, 116, 32, 98, 101, 103, 105, 110, 10, 47, 70, 111, 110, 116, 73, 110, 102, 111, 32, 49, 48, 32, 100, 105, 99, 116, 32, 100, 117, 112, 32, 98, 101, 103, 105, 110, 10, 47, 118, 101, 114, 115, 105, 111, 110, 32, 40, 48, 48, 49, 46, 48, 48, 49, 41, 32, 114, 101, 97, 100, 111, 110, 108, 121, 32, 100, 101, 102, 10, 47, 70, 117, 108, 108, 78, 97, 109, 101, 32, 40, 66, 102, 111, 110, 116, 41, 32, 114, 101, 97, 100, 111, 110, 108, 121, 32, 100, 101, 102, 10, 47, 70, 97, 109, 105, 108, 121, 78, 97, 109, 101, 32, 40, 66, 102, 111, 110, 116, 41, 32, 114, 101, 97, 100, 111, 110, 108, 121, 32, 100, 101, 102, 10, 47, 87, 101, 105, 103, 104, 116, 32, 40, 82, 101, 103, 117, 108, 97, 114, 41, 32, 114, 101, 97, 100, 111, 110, 108, 121, 32, 100, 101, 102, 10, 47, 73, 116, 97, 108, 105, 99, 65, 110, 103, 108, 101, 32, 48, 32, 100, 101, 102, 10, 47, 105, 115, 70, 105, 120, 101, 100, 80, 105, 116, 99, 104, 32, 102, 97, 108, 115, 101, 32, 100, 101, 102, 10, 47, 85, 110, 100, 101, 114, 108, 105, 110, 101, 80, 111, 115, 105, 116, 105, 111, 110, 32, 45, 49, 48, 48, 32, 100, 101, 102, 10, 47, 85, 110, 100, 101, 114, 108, 105, 110, 101, 84, 104, 105, 99, 107, 110, 101, 115, 115, 32, 53, 48, 32, 100, 101, 102, 10, 101, 110, 100, 32, 114, 101, 97, 100, 111, 110, 108, 121, 32, 100, 101, 102, 10, 47, 70, 111, 110, 116, 78, 97, 109, 101, 32, 47, 66, 102, 111, 110, 116, 32, 100, 101, 102, 10, 47, 69, 110, 99, 111, 100, 105, 110, 103, 32, 83, 116, 97, 110, 100, 97, 114, 100, 69, 110, 99, 111, 100, 105, 110, 103, 32, 100, 101, 102, 10, 47, 80, 97, 105, 110, 116, 84, 121, 112, 101, 32, 48, 32, 100, 101, 102, 10, 47, 70, 111, 110, 116, 84, 121, 112, 101, 32, 49, 32, 100, 101, 102, 10, 47, 70, 111, 110, 116, 77, 97, 116, 114, 105, 120, 32, 91, 48, 46, 48, 48, 49, 32, 48, 32, 48, 32, 48, 46, 48, 48, 49, 32, 48, 32, 48, 93, 32, 114, 101, 97, 100, 111, 110, 108, 121, 32, 100, 101, 102, 10, 99, 117, 114, 114, 101, 110, 116, 100, 105, 99, 116, 32, 101, 110, 100, 10, 99, 117, 114, 114, 101, 110, 116, 102, 105, 108, 101, 32, 101, 101, 120, 101, 99, 10, 128, 2, 146, 94, 0, 0, 217, 214, 111, 99, 59, 132, 106, 152, 155, 153, 116, 176, 23, 159, 198, 204, 68, 91, 194, 192, 49, 3, 198, 133, 112, 167, 179, 84, 164, 162, 128, 174, 111, 191, 127, 152, 247, 90, 132, 186, 206, 45, 3, 106, 107, 81, 184, 72, 73, 49, 89, 29, 146, 229, 6, 158, 98, 38, 213, 173, 204, 93, 228, 248, 16, 122, 166, 154, 53, 181, 95, 106, 155, 75, 79, 147, 197, 108, 35, 188, 198, 29, 215, 191, 143, 50, 242, 29, 88, 228, 26, 95, 121, 12, 238, 47, 2, 175, 73, 134, 149, 233, 12, 29, 11, 210, 89, 231, 91, 2, 25, 48, 11, 15, 105, 44, 51, 119, 156, 42, 166, 122, 232, 81, 122, 190, 18, 48, 8, 69, 34, 74, 246, 173, 93, 169, 219, 154, 26, 58, 64, 251, 6, 179, 106, 156, 205, 105, 18, 85, 7, 252, 45, 233, 208, 65, 132, 199, 96, 66, 240, 63, 207, 209, 83, 132, 0, 35, 151, 42, 129, 42, 185, 179, 203, 86, 112, 193, 206, 39, 89, 113, 28, 117, 41, 66, 98, 214, 242, 145, 175, 155, 124, 118, 7, 30, 218, 126, 122, 208, 38, 33, 98, 50, 34, 185, 54, 8, 122, 178, 127, 254, 95, 7, 134, 71, 6, 101, 146, 24, 61, 195, 71, 174, 146, 230, 191, 86, 177, 123, 237, 206, 19, 104, 70, 246, 162, 163, 118, 171, 140, 11, 192, 255, 78, 52, 125, 32, 253, 14, 199, 126, 250, 177, 240, 99, 49, 0, 20, 141, 42, 125, 47, 210, 31, 18, 90, 170, 205, 143, 219, 153, 121, 131, 43, 103, 13, 138, 170, 118, 210, 18, 186, 181, 97, 70, 25, 144, 150, 12, 53, 110, 184, 216, 233, 243, 198, 93, 157, 254, 127, 140, 44, 138, 123, 43, 233, 158, 99, 255, 108, 134, 136, 60, 29, 229, 7, 141, 163, 185, 30, 3, 228, 132, 13, 221, 109, 48, 227, 60, 227, 135, 117, 220, 128, 67, 195, 147, 32, 118, 71, 190, 131, 11, 245, 200, 93, 30, 226, 32, 114, 26, 39, 232, 138, 33, 109, 232, 1, 11, 233, 212, 78, 221, 88, 158, 135, 95, 159, 14, 38, 31, 12, 106, 255, 51, 147, 42, 139, 254, 210, 119, 6, 96, 221, 226, 140, 183, 213, 222, 5, 205, 13, 140, 253, 214, 125, 103, 227, 52, 60, 102, 31, 250, 163, 147, 228, 167, 58, 207, 156, 68, 166, 150, 167, 169, 116, 83, 194, 150, 104, 152, 31, 7, 157, 38, 76, 29, 10, 247, 63, 57, 194, 106, 230, 183, 120, 135, 187, 201, 211, 82, 234, 168, 182, 167, 90, 56, 37, 109, 160, 144, 13, 48, 204, 190, 14, 169, 103, 127, 136, 102, 24, 81, 61, 32, 233, 228, 158, 18, 235, 189, 28, 0, 222, 67, 17, 110, 143, 71, 223, 181, 33, 17, 66, 81, 210, 7, 23, 186, 245, 229, 198, 143, 62, 113, 33, 80, 236, 87, 148, 65, 42, 27, 111, 128, 223, 196, 140, 45, 32, 91, 123, 158, 136, 153, 166, 144, 126, 115, 133, 220, 254, 234, 192, 123, 14, 239, 75, 199, 116, 28, 241, 25, 30, 66, 226, 248, 159, 142, 46, 41, 10, 237, 111, 205, 31, 230, 72, 196, 49, 200, 50, 29, 115, 153, 141, 198, 225, 218, 157, 86, 56, 67, 249, 99, 50, 25, 151, 14, 200, 35, 186, 250, 204, 151, 187, 209, 51, 129, 161, 68, 118, 130, 31, 25, 134, 255, 75, 170, 240, 225, 113, 144, 5, 178, 133, 45, 85, 242, 66, 10, 10, 65, 138, 93, 147, 72, 210, 250, 209, 123, 148, 135, 12, 156, 94, 13, 250, 31, 211, 157, 82, 128, 132, 143, 11, 155, 47, 211, 151, 232, 142, 253, 82, 104, 234, 231, 190, 169, 78, 32, 90, 2, 41, 201, 122, 142, 205, 144, 234, 204, 198, 227, 56, 57, 6, 63, 8, 237, 89, 199, 30, 226, 169, 48, 198, 191, 38, 114, 87, 135, 189, 98, 251, 224, 210, 154, 58, 87, 26, 56, 41, 219, 119, 124, 109, 83, 182, 169, 166, 123, 255, 190, 35, 121, 177, 37, 92, 128, 242, 247, 132, 218, 149, 140, 116, 184, 163, 13, 248, 138, 68, 124, 229, 211, 89, 210, 101, 172, 149, 221, 182, 113, 36, 182, 46, 5, 141, 127, 147, 54, 118, 67, 107, 105, 187, 40, 53, 208, 170, 25, 45, 113, 216, 110, 135, 56, 7, 26, 14, 225, 61, 79, 228, 72, 30, 39, 220, 195, 227, 229, 153, 196, 28, 6, 107, 240, 54, 67, 6, 94, 143, 0, 34, 180, 49, 14, 41, 111, 9, 41, 94, 203, 184, 139, 142, 34, 140, 138, 90, 25, 216, 89, 252, 45, 46, 132, 169, 154, 230, 131, 15, 20, 100, 99, 235, 106, 73, 185, 89, 6, 66, 230, 171, 202, 22, 213, 227, 183, 32, 138, 116, 253, 208, 230, 121, 16, 63, 238, 132, 69, 28, 135, 88, 115, 18, 21, 11, 102, 172, 200, 37, 222, 255, 100, 221, 80, 173, 218, 53, 210, 250, 148, 211, 241, 97, 150, 185, 43, 250, 138, 14, 122, 133, 30, 191, 54, 158, 118, 22, 12, 232, 25, 228, 60, 101, 206, 119, 29, 57, 12, 99, 36, 167, 182, 153, 86, 195, 21, 70, 154, 102, 106, 45, 236, 70, 151, 143, 185, 207, 252, 106, 46, 168, 80, 216, 206, 157, 171, 118, 77, 82, 153, 24, 54, 165, 128, 160, 27, 195, 117, 241, 141, 93, 151, 233, 239, 244, 73, 123, 133, 42, 138, 123, 68, 159, 225, 209, 171, 242, 70, 212, 6, 168, 19, 116, 228, 0, 14, 148, 191, 132, 10, 254, 83, 125, 20, 17, 71, 126, 142, 56, 80, 55, 48, 125, 184, 172, 156, 163, 161, 72, 249, 105, 204, 207, 179, 217, 115, 177, 2, 82, 220, 142, 14, 180, 138, 254, 83, 139, 36, 70, 203, 91, 81, 82, 229, 20, 253, 78, 132, 213, 64, 154, 163, 59, 93, 245, 168, 38, 148, 48, 228, 13, 186, 204, 95, 140, 184, 118, 22, 130, 111, 27, 38, 139, 127, 106, 172, 161, 254, 136, 187, 166, 48, 162, 152, 124, 69, 27, 186, 50, 126, 7, 144, 43, 75, 176, 145, 159, 202, 244, 7, 78, 203, 250, 32, 42, 195, 71, 186, 90, 92, 162, 126, 98, 44, 195, 163, 47, 88, 124, 43, 177, 122, 251, 254, 29, 161, 70, 98, 235, 133, 52, 12, 28, 184, 67, 145, 73, 88, 99, 69, 60, 227, 142, 15, 218, 82, 167, 57, 225, 230, 218, 131, 251, 171, 11, 63, 191, 65, 236, 178, 63, 159, 213, 211, 114, 64, 200, 85, 73, 40, 94, 123, 108, 171, 89, 169, 206, 99, 196, 31, 15, 152, 138, 77, 137, 210, 197, 228, 255, 73, 126, 120, 249, 214, 170, 212, 168, 73, 54, 125, 113, 78, 226, 37, 137, 249, 188, 239, 33, 231, 244, 125, 116, 137, 126, 187, 31, 193, 194, 118, 121, 19, 80, 250, 87, 48, 80, 62, 246, 29, 121, 247, 135, 198, 193, 253, 148, 211, 17, 210, 17, 247, 44, 205, 91, 1, 190, 195, 236, 66, 95, 144, 58, 235, 2, 42, 79, 25, 82, 164, 167, 244, 114, 188, 192, 101, 23, 55, 69, 141, 168, 28, 89, 60, 116, 91, 162, 121, 28, 123, 96, 252, 165, 180, 69, 56, 232, 54, 122, 138, 223, 158, 131, 94, 171, 82, 4, 112, 13, 160, 117, 170, 146, 28, 241, 154, 211, 119, 16, 233, 141, 96, 94, 167, 13, 37, 118, 105, 73, 211, 97, 109, 148, 131, 190, 119, 45, 124, 208, 225, 39, 94, 48, 62, 33, 188, 248, 154, 233, 46, 158, 7, 144, 1, 121, 0, 235, 71, 25, 52, 13, 46, 1, 25, 171, 27, 179, 170, 164, 231, 2, 25, 182, 226, 250, 96, 192, 23, 185, 218, 218, 16, 140, 36, 180, 216, 59, 95, 49, 165, 162, 134, 252, 47, 168, 65, 242, 178, 211, 62, 10, 239, 153, 65, 219, 247, 72, 17, 105, 49, 254, 85, 136, 211, 117, 240, 218, 77, 221, 166, 41, 145, 198, 4, 104, 136, 241, 48, 0, 158, 210, 236, 207, 26, 145, 140, 95, 164, 117, 198, 0, 183, 104, 161, 59, 9, 189, 8, 32, 44, 26, 255, 157, 119, 245, 250, 49, 176, 156, 227, 102, 228, 105, 83, 24, 153, 85, 196, 129, 133, 128, 208, 129, 202, 62, 204, 173, 137, 91, 223, 112, 208, 243, 87, 180, 109, 82, 141, 56, 239, 210, 40, 86, 200, 173, 31, 32, 230, 140, 202, 61, 220, 176, 92, 108, 207, 177, 213, 169, 238, 172, 158, 254, 38, 242, 141, 6, 115, 217, 193, 134, 166, 227, 36, 208, 119, 86, 44, 34, 195, 71, 119, 94, 234, 241, 122, 79, 169, 173, 36, 221, 120, 68, 23, 3, 44, 125, 38, 78, 72, 230, 25, 62, 18, 205, 206, 66, 140, 79, 125, 229, 223, 0, 92, 25, 118, 253, 161, 219, 51, 228, 229, 212, 13, 155, 26, 50, 54, 105, 54, 38, 85, 152, 49, 150, 233, 88, 191, 111, 0, 122, 147, 95, 215, 50, 33, 176, 209, 77, 136, 198, 6, 71, 97, 100, 152, 0, 159, 94, 91, 202, 7, 148, 125, 254, 58, 38, 107, 49, 101, 14, 194, 163, 12, 79, 253, 153, 150, 54, 30, 37, 140, 189, 241, 141, 47, 57, 139, 145, 74, 88, 15, 178, 179, 63, 241, 91, 129, 30, 79, 19, 104, 72, 56, 215, 37, 124, 242, 77, 81, 109, 155, 0, 233, 122, 186, 107, 91, 145, 92, 162, 90, 4, 113, 170, 84, 211, 132, 142, 64, 27, 93, 152, 248, 107, 94, 93, 160, 109, 249, 241, 251, 102, 130, 66, 96, 51, 112, 140, 245, 151, 65, 45, 189, 157, 117, 188, 91, 97, 49, 138, 107, 106, 135, 204, 203, 38, 119, 33, 149, 87, 122, 158, 198, 8, 142, 218, 3, 56, 249, 80, 86, 253, 82, 246, 203, 231, 57, 160, 50, 52, 187, 24, 108, 130, 253, 193, 24, 51, 201, 50, 3, 67, 176, 187, 124, 165, 172, 142, 252, 156, 155, 220, 252, 51, 237, 105, 94, 48, 44, 233, 187, 188, 123, 100, 218, 223, 36, 114, 54, 219, 223, 39, 156, 112, 206, 46, 19, 10, 213, 139, 69, 12, 138, 134, 44, 130, 94, 136, 4, 111, 77, 21, 115, 225, 162, 15, 38, 159, 218, 138, 102, 171, 2, 142, 48, 158, 57, 94, 59, 182, 17, 127, 190, 223, 196, 66, 238, 107, 50, 154, 2, 142, 167, 152, 18, 25, 226, 1, 253, 251, 17, 102, 20, 111, 28, 97, 136, 15, 60, 65, 230, 39, 49, 25, 166, 31, 18, 54, 4, 24, 89, 211, 226, 250, 74, 226, 185, 67, 138, 29, 18, 85, 156, 124, 145, 84, 17, 175, 167, 51, 13, 54, 82, 97, 64, 206, 201, 111, 199, 214, 210, 235, 148, 55, 181, 241, 136, 86, 254, 219, 122, 64, 103, 179, 79, 113, 163, 126, 75, 107, 79, 102, 244, 21, 147, 198, 210, 251, 35, 136, 73, 15, 32, 45, 150, 134, 253, 113, 83, 111, 161, 110, 212, 242, 33, 12, 12, 16, 143, 194, 199, 37, 228, 251, 110, 7, 213, 198, 55, 80, 32, 209, 140, 34, 47, 102, 249, 217, 166, 118, 31, 106, 2, 18, 106, 46, 146, 148, 125, 0, 208, 89, 209, 247, 55, 143, 177, 19, 183, 127, 71, 118, 20, 136, 3, 233, 109, 119, 181, 115, 223, 110, 139, 182, 171, 109, 104, 72, 62, 152, 143, 14, 157, 82, 154, 253, 142, 215, 59, 1, 11, 98, 107, 140, 12, 240, 144, 56, 38, 14, 220, 237, 154, 174, 151, 179, 207, 104, 234, 222, 84, 126, 157, 90, 52, 118, 126, 96, 23, 203, 135, 134, 41, 16, 196, 210, 44, 125, 68, 145, 232, 236, 52, 222, 102, 131, 80, 101, 237, 218, 244, 215, 205, 95, 58, 96, 18, 66, 213, 91, 247, 58, 44, 57, 150, 193, 139, 135, 36, 143, 236, 94, 209, 236, 213, 227, 42, 176, 173, 206, 87, 151, 240, 145, 185, 45, 209, 177, 201, 123, 32, 196, 44, 158, 83, 203, 202, 6, 106, 54, 93, 43, 209, 12, 114, 76, 100, 242, 104, 165, 138, 15, 143, 5, 33, 228, 195, 243, 111, 81, 249, 174, 15, 167, 40, 165, 51, 97, 185, 215, 150, 118, 253, 22, 103, 9, 21, 185, 238, 189, 94, 49, 104, 100, 98, 165, 196, 31, 148, 112, 125, 199, 46, 103, 252, 79, 100, 165, 112, 104, 82, 249, 219, 205, 34, 198, 31, 198, 191, 181, 72, 212, 182, 62, 87, 13, 53, 171, 84, 222, 156, 131, 201, 162, 173, 47, 44, 187, 105, 119, 132, 47, 228, 184, 36, 85, 218, 11, 251, 242, 124, 205, 168, 252, 24, 245, 49, 84, 161, 107, 211, 21, 63, 219, 89, 15, 116, 192, 18, 208, 86, 95, 75, 71, 239, 247, 105, 124, 85, 174, 144, 220, 24, 188, 94, 40, 209, 132, 234, 225, 53, 69, 240, 42, 47, 92, 18, 240, 120, 210, 140, 168, 218, 105, 60, 246, 247, 238, 188, 247, 10, 162, 24, 136, 226, 91, 107, 157, 168, 51, 186, 15, 79, 68, 154, 225, 52, 41, 228, 127, 35, 41, 224, 97, 225, 44, 85, 16, 225, 99, 198, 48, 182, 98, 235, 255, 178, 24, 210, 58, 14, 200, 84, 18, 132, 137, 35, 171, 63, 195, 238, 195, 167, 167, 8, 207, 232, 214, 100, 91, 195, 90, 233, 86, 98, 207, 185, 229, 196, 140, 253, 236, 219, 150, 62, 62, 2, 15, 51, 232, 157, 44, 234, 107, 188, 220, 214, 209, 42, 165, 18, 94, 143, 235, 241, 192, 254, 106, 155, 48, 246, 239, 123, 17, 140, 12, 101, 251, 102, 156, 126, 130, 2, 38, 62, 255, 27, 134, 182, 120, 23, 158, 103, 4, 48, 154, 78, 236, 14, 254, 222, 239, 42, 228, 224, 138, 87, 211, 236, 78, 212, 1, 107, 139, 81, 5, 238, 185, 84, 205, 51, 83, 67, 52, 42, 135, 255, 244, 123, 157, 185, 116, 114, 160, 116, 246, 30, 147, 127, 129, 156, 51, 229, 39, 122, 2, 122, 145, 229, 25, 122, 2, 151, 7, 125, 246, 76, 129, 209, 110, 138, 246, 211, 33, 183, 60, 192, 108, 167, 161, 157, 173, 188, 134, 192, 179, 203, 195, 136, 84, 41, 110, 193, 122, 131, 11, 75, 124, 83, 139, 80, 12, 71, 93, 214, 179, 43, 70, 139, 91, 53, 228, 97, 105, 67, 230, 118, 92, 183, 131, 114, 231, 74, 140, 48, 135, 180, 10, 184, 148, 46, 75, 182, 205, 83, 47, 151, 206, 84, 243, 232, 233, 126, 142, 30, 11, 113, 219, 252, 153, 18, 16, 215, 238, 121, 155, 255, 21, 214, 89, 6, 196, 3, 201, 131, 48, 187, 159, 235, 14, 27, 155, 245, 77, 229, 130, 112, 168, 164, 253, 69, 23, 253, 242, 175, 19, 232, 155, 161, 27, 158, 95, 160, 90, 79, 109, 133, 203, 42, 70, 181, 120, 247, 244, 85, 191, 167, 255, 36, 251, 115, 54, 191, 78, 211, 182, 252, 5, 12, 100, 32, 48, 200, 26, 234, 123, 25, 161, 253, 134, 168, 60, 15, 187, 62, 24, 239, 177, 98, 92, 109, 195, 112, 78, 242, 161, 250, 224, 210, 94, 111, 34, 100, 196, 71, 103, 74, 123, 216, 217, 180, 160, 33, 64, 105, 123, 183, 125, 84, 77, 80, 99, 109, 247, 173, 168, 239, 122, 88, 233, 117, 237, 148, 43, 144, 195, 255, 222, 124, 214, 133, 156, 117, 244, 7, 73, 13, 100, 164, 68, 175, 191, 93, 225, 252, 128, 96, 77, 231, 196, 150, 223, 120, 56, 23, 101, 94, 23, 50, 76, 38, 27, 89, 184, 93, 140, 37, 79, 249, 66, 199, 27, 220, 230, 114, 176, 179, 228, 201, 12, 56, 113, 1, 25, 207, 104, 177, 191, 79, 237, 143, 226, 104, 92, 21, 249, 98, 205, 22, 105, 215, 184, 142, 178, 107, 8, 194, 13, 32, 156, 84, 109, 146, 152, 57, 241, 72, 62, 74, 122, 212, 88, 179, 57, 23, 186, 74, 73, 82, 37, 80, 182, 165, 40, 89, 30, 244, 209, 110, 163, 24, 182, 201, 139, 145, 225, 148, 219, 184, 1, 109, 99, 156, 37, 247, 177, 111, 50, 209, 221, 208, 78, 0, 72, 6, 236, 76, 79, 63, 132, 26, 227, 72, 142, 229, 248, 120, 160, 148, 155, 91, 51, 61, 40, 22, 192, 96, 139, 193, 192, 41, 116, 79, 140, 116, 158, 248, 64, 168, 227, 174, 56, 114, 92, 160, 31, 200, 94, 82, 99, 139, 67, 95, 47, 76, 180, 152, 43, 131, 149, 177, 4, 212, 56, 209, 190, 209, 102, 122, 224, 72, 234, 244, 111, 175, 138, 120, 23, 203, 9, 146, 234, 239, 94, 241, 28, 21, 170, 51, 2, 176, 125, 179, 217, 99, 83, 17, 16, 113, 123, 111, 68, 94, 156, 200, 90, 117, 30, 174, 131, 42, 161, 91, 76, 85, 199, 44, 75, 199, 0, 159, 111, 158, 236, 63, 252, 73, 67, 220, 113, 169, 158, 74, 7, 81, 214, 149, 155, 222, 129, 91, 63, 169, 196, 168, 208, 230, 83, 168, 4, 19, 27, 176, 157, 146, 56, 42, 254, 143, 171, 119, 60, 127, 57, 37, 107, 84, 255, 246, 76, 159, 38, 176, 233, 13, 97, 107, 64, 55, 206, 201, 204, 218, 3, 139, 123, 150, 151, 110, 28, 198, 99, 247, 167, 155, 37, 184, 253, 214, 21, 253, 250, 179, 26, 233, 98, 205, 117, 109, 94, 222, 15, 151, 184, 119, 219, 159, 26, 52, 234, 55, 66, 100, 108, 175, 174, 17, 111, 135, 189, 244, 238, 173, 23, 17, 241, 136, 78, 124, 75, 203, 114, 135, 228, 221, 79, 244, 180, 84, 215, 120, 58, 193, 234, 17, 21, 132, 110, 10, 93, 93, 0, 183, 245, 134, 61, 95, 68, 191, 141, 237, 95, 126, 87, 58, 149, 134, 213, 110, 116, 216, 192, 10, 112, 38, 232, 50, 35, 120, 57, 45, 172, 232, 37, 77, 226, 153, 110, 131, 253, 210, 168, 180, 83, 56, 51, 56, 189, 222, 97, 193, 136, 138, 42, 148, 50, 111, 24, 19, 254, 177, 109, 42, 4, 65, 172, 96, 251, 160, 54, 58, 165, 202, 64, 75, 38, 58, 75, 176, 216, 98, 146, 125, 118, 248, 14, 106, 228, 226, 81, 241, 251, 127, 27, 23, 92, 157, 140, 12, 59, 86, 252, 122, 13, 128, 14, 184, 55, 155, 44, 253, 29, 47, 123, 191, 185, 154, 163, 114, 250, 216, 48, 218, 24, 41, 137, 186, 200, 209, 147, 86, 234, 11, 251, 42, 56, 181, 243, 238, 166, 135, 92, 151, 86, 174, 89, 79, 71, 14, 24, 5, 179, 87, 131, 135, 102, 59, 186, 66, 1, 6, 72, 5, 28, 79, 49, 186, 194, 62, 179, 53, 186, 31, 143, 15, 105, 32, 251, 188, 138, 11, 244, 36, 100, 101, 80, 187, 253, 53, 90, 154, 212, 181, 126, 209, 58, 10, 55, 168, 27, 236, 115, 101, 224, 193, 103, 231, 231, 76, 130, 169, 64, 247, 143, 160, 6, 12, 187, 62, 115, 85, 133, 97, 131, 157, 164, 5, 18, 51, 69, 53, 226, 170, 32, 248, 133, 194, 58, 114, 243, 156, 53, 219, 228, 37, 51, 150, 240, 227, 74, 100, 66, 140, 115, 100, 103, 47, 160, 145, 39, 160, 75, 222, 218, 28, 108, 232, 107, 91, 0, 57, 250, 136, 6, 33, 118, 115, 103, 179, 221, 108, 40, 142, 175, 185, 2, 12, 192, 66, 213, 152, 41, 233, 223, 41, 212, 85, 17, 52, 58, 211, 181, 46, 211, 206, 189, 26, 8, 90, 115, 224, 151, 195, 224, 213, 34, 162, 189, 222, 218, 155, 78, 201, 101, 242, 9, 56, 215, 152, 239, 247, 121, 3, 16, 221, 56, 45, 35, 243, 146, 128, 44, 114, 215, 132, 101, 220, 233, 180, 2, 29, 87, 203, 185, 144, 16, 37, 113, 60, 244, 214, 140, 191, 24, 192, 37, 255, 161, 147, 216, 30, 40, 155, 88, 60, 186, 135, 11, 23, 228, 43, 157, 203, 102, 196, 197, 1, 1, 87, 218, 126, 80, 76, 30, 182, 207, 153, 135, 248, 6, 181, 215, 77, 128, 200, 10, 19, 107, 138, 202, 84, 120, 191, 140, 117, 50, 32, 27, 105, 174, 224, 170, 123, 53, 76, 48, 210, 6, 227, 195, 114, 235, 87, 145, 150, 26, 21, 17, 214, 198, 245, 125, 109, 156, 170, 204, 143, 228, 62, 196, 128, 21, 243, 153, 91, 71, 164, 113, 164, 255, 48, 36, 238, 105, 220, 163, 93, 3, 33, 47, 150, 241, 211, 190, 111, 157, 234, 189, 25, 58, 247, 75, 118, 247, 167, 171, 118, 223, 1, 180, 98, 83, 0, 2, 109, 17, 255, 116, 244, 107, 101, 220, 100, 70, 21, 133, 179, 90, 210, 116, 32, 197, 24, 82, 114, 120, 218, 14, 147, 80, 194, 80, 69, 78, 223, 157, 183, 130, 49, 139, 162, 34, 12, 176, 45, 242, 103, 232, 128, 68, 88, 225, 181, 149, 3, 210, 20, 38, 155, 6, 206, 136, 22, 170, 92, 156, 165, 116, 142, 250, 72, 203, 235, 193, 116, 244, 4, 209, 55, 186, 29, 8, 33, 193, 221, 73, 27, 212, 204, 22, 197, 179, 8, 122, 134, 8, 255, 96, 51, 2, 169, 193, 96, 128, 178, 109, 143, 131, 50, 219, 208, 58, 159, 103, 233, 100, 26, 2, 177, 129, 122, 168, 120, 71, 39, 115, 228, 108, 114, 161, 243, 24, 10, 221, 105, 0, 32, 230, 75, 208, 233, 4, 70, 249, 98, 37, 46, 87, 158, 145, 60, 85, 229, 199, 236, 126, 80, 183, 181, 12, 68, 3, 15, 23, 36, 92, 146, 109, 61, 24, 128, 78, 239, 88, 230, 215, 204, 90, 147, 118, 171, 51, 168, 95, 93, 23, 90, 244, 164, 172, 201, 222, 112, 143, 193, 209, 130, 201, 207, 118, 175, 51, 3, 83, 144, 53, 7, 2, 223, 146, 50, 101, 168, 159, 133, 28, 66, 29, 64, 233, 76, 182, 133, 172, 68, 223, 114, 254, 236, 111, 30, 73, 137, 130, 164, 131, 196, 189, 111, 155, 147, 217, 64, 194, 115, 143, 201, 77, 22, 153, 228, 83, 191, 53, 210, 87, 234, 21, 34, 187, 184, 28, 63, 179, 214, 83, 14, 112, 32, 169, 159, 133, 207, 19, 169, 188, 147, 111, 186, 114, 43, 118, 152, 25, 71, 184, 247, 239, 62, 39, 125, 8, 176, 91, 46, 127, 37, 169, 247, 186, 170, 231, 106, 124, 93, 82, 203, 135, 50, 177, 85, 74, 115, 219, 76, 96, 173, 44, 242, 38, 163, 171, 14, 0, 95, 76, 99, 75, 14, 39, 213, 116, 182, 72, 2, 234, 176, 65, 98, 150, 36, 70, 86, 137, 151, 218, 245, 141, 17, 24, 233, 41, 185, 58, 178, 56, 54, 122, 148, 231, 151, 41, 214, 96, 4, 243, 46, 63, 200, 233, 128, 161, 95, 138, 244, 183, 141, 145, 14, 25, 91, 197, 70, 3, 227, 187, 203, 223, 48, 120, 113, 7, 0, 130, 193, 160, 67, 108, 185, 71, 237, 171, 101, 159, 96, 98, 34, 4, 142, 114, 155, 160, 147, 193, 170, 48, 115, 253, 172, 245, 59, 145, 176, 55, 203, 245, 60, 24, 247, 235, 79, 12, 117, 74, 18, 151, 14, 208, 7, 227, 230, 138, 182, 107, 33, 172, 211, 232, 244, 91, 86, 80, 237, 55, 154, 175, 32, 221, 17, 151, 79, 104, 238, 25, 226, 76, 155, 72, 39, 90, 209, 93, 119, 54, 17, 9, 222, 62, 18, 136, 25, 15, 59, 194, 203, 57, 150, 0, 52, 122, 104, 84, 199, 104, 180, 154, 180, 177, 141, 173, 169, 154, 113, 35, 75, 198, 157, 150, 80, 44, 212, 248, 174, 232, 251, 140, 74, 214, 189, 41, 120, 113, 156, 65, 16, 15, 201, 18, 45, 16, 210, 104, 247, 38, 33, 40, 249, 61, 119, 153, 179, 72, 88, 122, 109, 208, 91, 186, 231, 246, 201, 154, 26, 36, 115, 126, 217, 44, 194, 140, 103, 229, 15, 250, 227, 140, 106, 204, 118, 169, 157, 84, 150, 31, 128, 194, 254, 144, 221, 84, 79, 211, 148, 33, 60, 107, 211, 170, 159, 248, 105, 63, 114, 0, 23, 234, 92, 230, 240, 118, 6, 250, 181, 184, 227, 64, 186, 40, 94, 67, 225, 133, 89, 15, 16, 174, 144, 165, 59, 6, 73, 13, 18, 29, 10, 46, 237, 23, 51, 33, 27, 193, 212, 63, 194, 5, 79, 66, 177, 81, 200, 84, 254, 225, 36, 110, 208, 225, 202, 213, 89, 214, 140, 142, 227, 223, 60, 214, 19, 145, 92, 92, 164, 207, 222, 158, 250, 12, 146, 150, 67, 204, 120, 211, 109, 95, 186, 40, 167, 178, 90, 34, 46, 234, 28, 109, 171, 182, 83, 197, 36, 51, 69, 152, 168, 121, 48, 71, 179, 22, 218, 168, 182, 160, 147, 195, 177, 176, 201, 234, 213, 209, 135, 222, 9, 1, 157, 170, 240, 175, 246, 218, 255, 92, 53, 102, 171, 22, 235, 180, 248, 118, 10, 85, 14, 24, 218, 184, 132, 191, 225, 112, 66, 3, 231, 36, 235, 34, 214, 181, 57, 104, 151, 76, 69, 101, 83, 20, 39, 170, 108, 161, 239, 236, 126, 9, 144, 27, 117, 209, 174, 173, 92, 16, 185, 25, 8, 65, 29, 134, 67, 1, 248, 62, 221, 239, 134, 12, 15, 252, 203, 140, 179, 52, 247, 3, 230, 34, 184, 102, 82, 118, 76, 218, 254, 242, 24, 115, 22, 119, 90, 4, 149, 236, 176, 116, 68, 77, 123, 201, 192, 255, 188, 107, 195, 3, 217, 184, 106, 219, 116, 81, 207, 193, 227, 101, 41, 29, 232, 72, 85, 236, 151, 74, 93, 150, 166, 171, 155, 81, 131, 81, 109, 171, 184, 37, 190, 114, 106, 113, 144, 234, 76, 143, 92, 98, 190, 112, 151, 198, 151, 181, 99, 7, 182, 50, 190, 157, 141, 17, 199, 148, 230, 14, 240, 95, 238, 139, 161, 96, 85, 137, 154, 79, 67, 168, 101, 253, 126, 23, 165, 143, 47, 33, 157, 100, 6, 130, 253, 188, 66, 21, 205, 243, 116, 62, 241, 161, 177, 199, 234, 61, 135, 55, 113, 25, 153, 27, 129, 149, 189, 140, 112, 211, 49, 176, 38, 44, 110, 29, 135, 178, 122, 233, 3, 166, 97, 175, 61, 159, 98, 61, 54, 46, 62, 246, 137, 17, 150, 249, 165, 99, 211, 172, 76, 7, 104, 39, 106, 119, 221, 159, 210, 96, 33, 236, 87, 164, 112, 47, 226, 247, 236, 140, 185, 182, 20, 201, 51, 88, 97, 52, 198, 70, 49, 248, 96, 51, 82, 115, 169, 78, 73, 112, 123, 106, 120, 113, 184, 93, 194, 224, 68, 211, 200, 237, 209, 41, 160, 127, 89, 163, 55, 9, 27, 252, 78, 93, 147, 141, 12, 156, 44, 226, 106, 126, 159, 181, 106, 84, 25, 39, 220, 41, 134, 184, 173, 69, 141, 128, 221, 57, 194, 56, 41, 148, 107, 242, 241, 174, 129, 152, 123, 81, 101, 1, 204, 9, 109, 154, 97, 169, 63, 167, 52, 96, 239, 63, 116, 163, 122, 158, 94, 221, 35, 90, 184, 69, 186, 220, 155, 205, 65, 191, 31, 209, 62, 120, 156, 77, 154, 212, 58, 165, 208, 254, 65, 204, 148, 200, 121, 78, 129, 79, 121, 39, 34, 3, 169, 118, 120, 52, 35, 119, 142, 29, 15, 144, 156, 90, 134, 101, 105, 11, 112, 32, 74, 0, 219, 159, 132, 100, 7, 106, 88, 142, 42, 159, 159, 133, 11, 175, 92, 88, 144, 12, 55, 185, 47, 142, 31, 43, 39, 16, 83, 122, 54, 7, 150, 158, 215, 14, 143, 136, 147, 141, 231, 157, 67, 152, 119, 164, 114, 159, 71, 210, 144, 98, 127, 44, 132, 218, 170, 183, 6, 185, 210, 94, 95, 99, 240, 116, 30, 126, 76, 115, 212, 246, 102, 92, 96, 159, 252, 177, 173, 238, 87, 145, 120, 239, 83, 103, 148, 111, 193, 200, 157, 199, 84, 245, 167, 68, 43, 9, 69, 55, 83, 164, 109, 90, 46, 101, 215, 36, 23, 74, 170, 73, 31, 151, 63, 13, 233, 151, 107, 248, 28, 92, 35, 70, 5, 235, 85, 219, 20, 213, 153, 157, 249, 176, 37, 255, 191, 49, 221, 195, 243, 205, 150, 238, 234, 168, 137, 153, 201, 222, 205, 199, 162, 119, 146, 41, 89, 105, 114, 144, 27, 194, 167, 15, 17, 102, 155, 81, 20, 64, 25, 235, 217, 63, 154, 242, 225, 13, 33, 182, 38, 116, 47, 107, 50, 207, 110, 29, 136, 55, 33, 139, 136, 214, 63, 92, 125, 90, 118, 202, 7, 13, 45, 43, 162, 106, 53, 143, 13, 190, 171, 226, 196, 144, 17, 49, 136, 120, 246, 99, 28, 219, 184, 171, 145, 232, 242, 225, 86, 216, 29, 251, 249, 41, 244, 144, 111, 2, 13, 67, 69, 97, 59, 202, 92, 254, 71, 189, 6, 119, 180, 186, 203, 34, 18, 85, 115, 103, 178, 15, 139, 42, 154, 39, 24, 0, 19, 22, 240, 255, 252, 93, 217, 151, 118, 89, 76, 228, 117, 200, 137, 13, 190, 247, 255, 24, 253, 162, 24, 184, 20, 70, 173, 242, 65, 255, 14, 85, 235, 99, 103, 131, 181, 84, 80, 63, 156, 184, 204, 191, 61, 156, 252, 59, 37, 109, 229, 102, 139, 94, 178, 178, 164, 231, 49, 155, 35, 56, 196, 15, 169, 144, 251, 215, 89, 129, 230, 72, 219, 139, 197, 78, 109, 102, 25, 48, 44, 123, 211, 216, 106, 185, 237, 124, 133, 39, 37, 162, 20, 211, 134, 155, 168, 11, 222, 152, 143, 211, 112, 133, 136, 21, 169, 89, 187, 92, 61, 144, 126, 142, 165, 91, 64, 45, 41, 56, 164, 108, 49, 241, 137, 99, 44, 191, 100, 11, 225, 166, 244, 183, 14, 69, 141, 184, 193, 220, 72, 211, 67, 223, 16, 43, 227, 34, 87, 91, 32, 229, 84, 162, 113, 251, 125, 218, 118, 31, 254, 16, 33, 170, 201, 209, 49, 30, 113, 104, 193, 212, 82, 64, 80, 214, 32, 149, 217, 244, 237, 193, 223, 104, 77, 128, 228, 140, 55, 252, 204, 229, 187, 36, 99, 153, 241, 138, 135, 171, 169, 62, 250, 184, 63, 167, 139, 183, 57, 170, 36, 217, 201, 129, 169, 222, 78, 153, 65, 153, 195, 211, 229, 159, 191, 0, 145, 12, 209, 25, 247, 122, 19, 108, 173, 163, 187, 235, 254, 87, 80, 25, 110, 179, 158, 48, 232, 20, 138, 81, 198, 78, 18, 44, 75, 181, 18, 238, 96, 61, 247, 229, 254, 2, 55, 169, 32, 180, 136, 177, 161, 213, 132, 128, 108, 93, 159, 201, 212, 238, 223, 233, 186, 243, 4, 248, 5, 33, 214, 193, 214, 95, 51, 141, 60, 72, 63, 142, 184, 37, 122, 118, 136, 97, 93, 142, 245, 8, 147, 224, 126, 67, 93, 170, 105, 121, 231, 171, 85, 105, 191, 126, 88, 57, 42, 253, 179, 85, 251, 193, 163, 112, 71, 28, 137, 104, 199, 121, 13, 122, 58, 231, 160, 176, 50, 200, 80, 65, 99, 25, 67, 129, 91, 97, 178, 131, 195, 111, 148, 134, 71, 57, 145, 113, 209, 177, 51, 154, 29, 28, 180, 74, 13, 69, 147, 96, 210, 108, 176, 89, 248, 238, 64, 140, 85, 196, 169, 20, 251, 238, 194, 41, 56, 39, 59, 226, 189, 130, 178, 90, 176, 226, 46, 108, 156, 204, 174, 85, 118, 165, 137, 184, 160, 133, 89, 170, 184, 37, 48, 65, 241, 224, 117, 164, 248, 213, 112, 143, 128, 23, 130, 133, 216, 66, 190, 63, 238, 179, 84, 71, 27, 50, 83, 199, 91, 126, 164, 192, 76, 107, 100, 229, 6, 25, 164, 89, 235, 117, 247, 61, 109, 205, 76, 128, 230, 41, 243, 85, 58, 189, 128, 216, 21, 53, 68, 80, 1, 25, 171, 203, 71, 176, 46, 6, 84, 35, 150, 95, 144, 144, 253, 210, 78, 10, 31, 218, 179, 248, 95, 81, 244, 79, 215, 63, 196, 100, 165, 120, 54, 14, 180, 125, 152, 106, 173, 125, 14, 108, 211, 161, 131, 229, 114, 56, 252, 16, 221, 16, 242, 74, 87, 168, 121, 127, 247, 212, 200, 71, 204, 116, 246, 255, 154, 24, 137, 127, 45, 177, 212, 17, 212, 102, 236, 29, 88, 177, 166, 135, 107, 210, 230, 219, 124, 71, 98, 50, 230, 107, 222, 79, 222, 190, 37, 241, 242, 167, 27, 117, 253, 201, 76, 251, 186, 18, 135, 96, 191, 207, 15, 107, 67, 146, 251, 105, 102, 25, 200, 71, 209, 165, 125, 192, 18, 228, 162, 238, 214, 221, 138, 49, 40, 100, 122, 249, 20, 121, 57, 199, 11, 0, 243, 76, 57, 23, 211, 110, 212, 250, 218, 95, 154, 145, 179, 173, 45, 233, 155, 246, 67, 35, 203, 93, 5, 2, 91, 121, 116, 93, 64, 69, 31, 182, 179, 74, 59, 198, 41, 19, 102, 51, 76, 126, 224, 153, 65, 254, 186, 90, 16, 91, 220, 154, 130, 20, 187, 103, 141, 248, 188, 245, 250, 139, 191, 48, 138, 40, 199, 201, 155, 147, 83, 62, 254, 80, 3, 107, 104, 36, 103, 186, 94, 186, 225, 107, 167, 118, 230, 199, 85, 241, 219, 139, 20, 28, 233, 5, 131, 144, 101, 21, 228, 236, 249, 115, 82, 62, 147, 175, 251, 174, 128, 176, 255, 248, 142, 239, 113, 165, 254, 238, 22, 99, 162, 202, 108, 79, 235, 246, 32, 220, 11, 51, 239, 109, 4, 204, 179, 212, 86, 38, 5, 232, 170, 76, 151, 131, 165, 206, 122, 105, 124, 107, 28, 137, 196, 99, 194, 6, 122, 29, 75, 178, 26, 232, 70, 33, 231, 24, 73, 33, 187, 181, 240, 75, 22, 114, 163, 98, 114, 6, 93, 2, 32, 16, 79, 93, 119, 219, 153, 15, 182, 129, 123, 242, 162, 182, 152, 200, 24, 14, 95, 48, 35, 60, 237, 71, 183, 152, 92, 134, 31, 82, 174, 53, 155, 170, 96, 221, 93, 137, 90, 31, 128, 20, 131, 15, 86, 154, 93, 190, 178, 124, 214, 130, 43, 64, 134, 249, 0, 48, 215, 92, 236, 202, 24, 47, 60, 232, 190, 124, 3, 71, 145, 183, 215, 240, 1, 100, 235, 203, 185, 205, 122, 222, 41, 199, 127, 4, 74, 57, 92, 80, 227, 109, 81, 197, 32, 38, 35, 53, 94, 245, 9, 141, 245, 223, 223, 95, 42, 175, 157, 209, 215, 90, 64, 0, 248, 244, 246, 25, 60, 7, 169, 138, 246, 184, 96, 155, 68, 94, 155, 22, 15, 241, 169, 20, 49, 215, 209, 111, 239, 200, 144, 5, 33, 153, 142, 239, 148, 110, 117, 109, 248, 67, 98, 109, 157, 187, 172, 160, 169, 85, 54, 0, 153, 129, 217, 150, 67, 124, 151, 101, 106, 131, 207, 134, 5, 255, 139, 146, 192, 0, 115, 91, 6, 129, 58, 60, 103, 106, 223, 52, 211, 102, 252, 153, 7, 36, 34, 32, 136, 111, 24, 231, 218, 101, 114, 49, 128, 185, 58, 235, 26, 108, 148, 216, 2, 109, 127, 76, 170, 230, 167, 77, 230, 144, 120, 234, 183, 78, 246, 204, 228, 134, 249, 88, 100, 196, 198, 168, 113, 216, 42, 35, 193, 234, 34, 195, 152, 125, 79, 79, 24, 161, 173, 16, 174, 46, 67, 170, 131, 156, 232, 86, 89, 173, 30, 39, 209, 177, 50, 137, 84, 109, 203, 25, 179, 105, 42, 151, 141, 56, 47, 146, 109, 175, 225, 243, 210, 206, 81, 196, 237, 159, 201, 165, 55, 181, 153, 69, 153, 117, 118, 217, 130, 65, 139, 68, 118, 59, 201, 202, 82, 129, 162, 23, 102, 61, 155, 109, 206, 125, 41, 111, 139, 83, 174, 133, 242, 44, 2, 235, 186, 58, 247, 99, 136, 173, 106, 250, 248, 34, 152, 133, 3, 208, 170, 129, 23, 60, 73, 212, 46, 191, 190, 88, 207, 221, 164, 178, 45, 215, 131, 204, 225, 117, 173, 138, 180, 3, 0, 15, 14, 221, 73, 184, 22, 167, 83, 216, 31, 137, 254, 108, 90, 21, 235, 5, 68, 143, 236, 218, 177, 170, 239, 180, 8, 168, 140, 226, 189, 16, 145, 62, 163, 225, 93, 205, 37, 120, 98, 129, 249, 129, 253, 213, 174, 200, 19, 143, 140, 9, 177, 50, 105, 134, 69, 113, 244, 133, 6, 120, 25, 155, 132, 254, 226, 207, 43, 56, 168, 69, 169, 95, 83, 166, 34, 69, 213, 187, 98, 243, 119, 143, 121, 249, 119, 129, 165, 103, 146, 140, 13, 136, 238, 160, 170, 253, 171, 212, 98, 239, 172, 195, 249, 68, 207, 60, 24, 130, 128, 167, 163, 178, 130, 220, 6, 139, 198, 201, 110, 26, 91, 155, 144, 143, 212, 85, 106, 50, 198, 74, 210, 168, 146, 232, 172, 30, 152, 206, 69, 44, 47, 88, 165, 180, 221, 45, 252, 248, 47, 26, 33, 142, 189, 77, 77, 20, 185, 247, 249, 88, 67, 117, 249, 151, 118, 57, 18, 137, 128, 189, 134, 148, 85, 7, 47, 60, 142, 110, 105, 252, 45, 165, 187, 134, 50, 255, 180, 56, 130, 137, 76, 189, 218, 152, 46, 148, 44, 1, 239, 47, 72, 192, 70, 14, 74, 90, 136, 245, 35, 40, 171, 29, 17, 97, 77, 184, 32, 38, 38, 252, 12, 0, 226, 11, 222, 132, 183, 121, 209, 83, 3, 164, 243, 32, 111, 109, 145, 203, 57, 241, 192, 5, 107, 164, 128, 3, 218, 69, 178, 200, 222, 45, 65, 105, 110, 115, 184, 75, 243, 221, 49, 226, 170, 189, 49, 246, 129, 33, 150, 38, 203, 3, 214, 111, 206, 150, 168, 137, 162, 228, 3, 96, 105, 184, 27, 106, 81, 32, 147, 230, 60, 219, 199, 176, 74, 100, 18, 80, 140, 70, 128, 115, 119, 111, 82, 172, 8, 6, 168, 188, 56, 197, 112, 159, 169, 216, 200, 90, 251, 104, 112, 19, 179, 71, 59, 181, 138, 224, 158, 252, 148, 50, 65, 55, 33, 120, 142, 137, 108, 20, 142, 236, 144, 89, 197, 190, 188, 19, 102, 227, 240, 38, 170, 129, 123, 69, 123, 193, 13, 37, 133, 44, 167, 210, 141, 172, 154, 208, 42, 156, 35, 126, 176, 1, 98, 193, 135, 102, 235, 229, 22, 34, 187, 18, 111, 64, 83, 107, 17, 157, 241, 117, 59, 8, 211, 60, 200, 87, 184, 89, 132, 249, 60, 18, 81, 237, 225, 53, 221, 131, 255, 218, 64, 239, 194, 7, 181, 40, 3, 46, 108, 220, 52, 108, 62, 254, 140, 37, 116, 15, 40, 169, 90, 47, 136, 102, 253, 7, 223, 132, 207, 60, 234, 21, 134, 155, 63, 112, 37, 72, 222, 55, 59, 20, 34, 167, 71, 222, 221, 164, 161, 92, 131, 244, 235, 243, 237, 184, 129, 77, 165, 160, 139, 171, 234, 234, 69, 113, 128, 93, 215, 9, 84, 41, 213, 35, 164, 24, 120, 204, 180, 178, 153, 47, 245, 57, 22, 175, 206, 12, 175, 203, 129, 39, 93, 127, 18, 12, 55, 43, 36, 252, 1, 104, 116, 59, 135, 193, 145, 183, 41, 62, 78, 165, 189, 232, 128, 224, 11, 142, 255, 2, 223, 95, 80, 219, 87, 249, 121, 31, 181, 50, 241, 31, 127, 174, 99, 238, 176, 116, 65, 220, 160, 189, 25, 204, 103, 20, 231, 42, 195, 34, 180, 105, 121, 110, 99, 149, 139, 1, 221, 124, 67, 172, 47, 189, 207, 14, 229, 79, 158, 187, 203, 126, 236, 14, 53, 121, 243, 132, 78, 39, 72, 7, 165, 22, 78, 41, 101, 128, 20, 168, 136, 198, 109, 226, 32, 135, 168, 104, 155, 115, 57, 50, 66, 17, 72, 245, 124, 70, 188, 194, 144, 89, 140, 85, 8, 10, 129, 227, 167, 15, 15, 201, 54, 239, 194, 154, 204, 129, 27, 190, 245, 102, 166, 178, 201, 7, 197, 78, 149, 69, 245, 4, 143, 4, 84, 13, 217, 59, 242, 223, 226, 199, 231, 118, 188, 55, 115, 56, 15, 217, 3, 0, 181, 190, 3, 162, 127, 120, 206, 181, 8, 225, 155, 148, 202, 117, 70, 96, 81, 246, 165, 253, 115, 148, 217, 138, 44, 203, 36, 44, 221, 59, 122, 68, 170, 248, 235, 88, 242, 209, 42, 71, 31, 117, 5, 149, 221, 216, 154, 116, 41, 231, 138, 123, 85, 128, 71, 109, 111, 17, 72, 163, 225, 109, 7, 40, 133, 74, 76, 155, 107, 34, 193, 114, 240, 61, 31, 24, 46, 215, 197, 96, 114, 213, 18, 214, 57, 119, 50, 18, 5, 175, 254, 21, 246, 64, 145, 171, 217, 243, 159, 250, 231, 228, 64, 164, 97, 61, 150, 9, 230, 11, 138, 132, 95, 209, 138, 97, 87, 139, 190, 171, 135, 158, 170, 99, 198, 18, 127, 44, 102, 1, 236, 90, 73, 214, 135, 116, 107, 247, 175, 46, 238, 51, 79, 163, 249, 5, 137, 145, 92, 138, 23, 207, 158, 50, 109, 131, 84, 61, 184, 252, 232, 20, 67, 107, 189, 61, 198, 27, 6, 189, 119, 34, 236, 94, 105, 65, 140, 181, 248, 32, 12, 119, 126, 0, 14, 226, 78, 7, 121, 111, 47, 30, 49, 206, 187, 125, 247, 235, 6, 229, 34, 161, 174, 72, 154, 37, 94, 8, 88, 125, 54, 182, 100, 46, 84, 144, 213, 251, 62, 71, 177, 120, 255, 194, 14, 105, 206, 151, 179, 144, 140, 191, 167, 248, 44, 70, 227, 154, 142, 32, 174, 159, 199, 154, 78, 165, 68, 96, 73, 8, 13, 246, 162, 155, 48, 7, 121, 90, 173, 40, 226, 166, 189, 35, 87, 225, 45, 209, 220, 70, 22, 156, 216, 39, 126, 84, 142, 207, 100, 219, 155, 166, 43, 253, 161, 255, 143, 148, 93, 17, 7, 109, 176, 112, 14, 87, 147, 186, 123, 32, 159, 252, 83, 111, 182, 250, 28, 239, 207, 92, 64, 17, 26, 216, 0, 41, 24, 142, 246, 19, 172, 32, 137, 234, 69, 147, 251, 234, 207, 95, 6, 113, 209, 107, 69, 122, 198, 148, 13, 18, 28, 238, 191, 168, 205, 144, 234, 181, 247, 192, 151, 176, 95, 157, 60, 224, 26, 120, 24, 16, 66, 102, 51, 185, 111, 39, 6, 205, 187, 16, 1, 141, 45, 234, 48, 144, 26, 92, 155, 213, 218, 88, 151, 0, 111, 109, 28, 44, 172, 24, 215, 205, 186, 42, 119, 124, 48, 41, 199, 85, 81, 244, 24, 170, 71, 156, 141, 249, 234, 193, 174, 77, 184, 47, 107, 112, 235, 124, 254, 7, 163, 156, 71, 59, 122, 224, 196, 215, 71, 81, 145, 207, 178, 97, 118, 45, 154, 109, 190, 143, 63, 83, 135, 110, 166, 174, 47, 195, 33, 0, 234, 212, 223, 11, 248, 210, 158, 17, 139, 239, 15, 57, 133, 185, 152, 71, 56, 2, 62, 10, 103, 243, 247, 182, 81, 10, 38, 49, 7, 131, 10, 202, 184, 79, 149, 84, 213, 122, 133, 208, 24, 141, 132, 12, 244, 251, 160, 41, 56, 219, 123, 120, 23, 240, 40, 29, 32, 213, 222, 36, 49, 173, 176, 11, 209, 145, 104, 154, 154, 182, 183, 5, 60, 131, 70, 224, 47, 125, 110, 47, 246, 180, 222, 125, 243, 251, 55, 25, 147, 77, 164, 116, 218, 152, 191, 244, 47, 199, 68, 208, 209, 49, 90, 197, 176, 2, 191, 127, 198, 48, 16, 168, 243, 41, 195, 50, 175, 33, 172, 92, 185, 254, 96, 221, 65, 24, 36, 187, 10, 104, 242, 101, 185, 176, 206, 215, 166, 82, 189, 245, 208, 62, 38, 207, 97, 192, 45, 46, 98, 66, 201, 69, 95, 206, 211, 204, 225, 137, 204, 100, 110, 58, 84, 29, 112, 144, 51, 15, 1, 170, 79, 41, 239, 77, 1, 208, 209, 80, 208, 214, 27, 168, 153, 229, 188, 40, 250, 13, 240, 23, 96, 54, 235, 23, 202, 165, 215, 109, 143, 163, 161, 136, 101, 109, 98, 102, 54, 231, 141, 157, 22, 5, 201, 89, 10, 241, 113, 225, 185, 234, 128, 212, 206, 186, 59, 114, 79, 69, 43, 171, 208, 219, 63, 219, 112, 54, 77, 156, 116, 150, 140, 113, 186, 79, 131, 109, 231, 205, 170, 253, 131, 97, 141, 107, 242, 5, 238, 167, 32, 135, 194, 143, 151, 71, 22, 81, 254, 84, 120, 103, 131, 61, 86, 126, 66, 51, 201, 0, 170, 70, 18, 38, 152, 225, 3, 117, 98, 100, 141, 114, 39, 161, 189, 146, 148, 43, 55, 189, 18, 157, 181, 185, 7, 117, 77, 56, 229, 91, 80, 233, 79, 165, 140, 24, 98, 197, 130, 50, 70, 44, 111, 230, 241, 92, 204, 246, 78, 19, 18, 231, 219, 201, 207, 84, 205, 137, 138, 113, 45, 4, 72, 145, 204, 3, 86, 230, 200, 208, 166, 218, 183, 217, 21, 89, 23, 40, 107, 161, 68, 230, 96, 236, 91, 106, 15, 38, 255, 132, 13, 248, 98, 106, 177, 223, 54, 247, 114, 82, 147, 161, 42, 43, 10, 192, 12, 94, 200, 248, 200, 85, 231, 247, 246, 201, 221, 180, 217, 113, 12, 222, 88, 53, 21, 6, 26, 214, 220, 152, 253, 92, 56, 158, 17, 233, 218, 95, 234, 91, 97, 71, 148, 11, 3, 226, 199, 250, 201, 132, 92, 244, 18, 210, 248, 212, 89, 182, 96, 73, 121, 250, 222, 59, 121, 118, 19, 28, 221, 126, 48, 119, 190, 217, 72, 194, 91, 4, 213, 17, 137, 34, 246, 7, 6, 143, 245, 97, 192, 252, 55, 145, 82, 10, 77, 111, 31, 80, 74, 156, 14, 68, 111, 82, 76, 168, 203, 9, 220, 54, 233, 175, 186, 169, 104, 243, 2, 143, 109, 213, 247, 163, 196, 181, 37, 16, 50, 218, 28, 129, 118, 162, 187, 98, 202, 226, 244, 39, 27, 90, 255, 235, 125, 98, 206, 155, 179, 211, 58, 135, 80, 97, 220, 32, 136, 18, 226, 60, 251, 51, 170, 165, 47, 4, 63, 160, 41, 105, 85, 23, 122, 32, 145, 69, 85, 159, 147, 73, 209, 201, 169, 25, 225, 164, 6, 151, 92, 9, 223, 55, 137, 202, 67, 221, 100, 161, 248, 10, 209, 195, 27, 146, 4, 219, 227, 190, 203, 134, 228, 10, 160, 34, 221, 250, 110, 203, 33, 186, 60, 136, 185, 235, 72, 45, 105, 176, 161, 36, 169, 185, 174, 168, 146, 23, 57, 128, 198, 162, 194, 197, 62, 254, 102, 200, 154, 140, 98, 40, 208, 128, 95, 151, 77, 40, 190, 88, 75, 156, 47, 207, 220, 11, 125, 159, 24, 89, 142, 60, 2, 156, 25, 44, 203, 39, 222, 166, 122, 93, 215, 91, 87, 57, 199, 69, 211, 244, 140, 241, 106, 43, 193, 10, 150, 65, 226, 163, 202, 165, 155, 93, 219, 207, 28, 174, 157, 201, 199, 169, 174, 28, 36, 117, 106, 155, 87, 209, 223, 171, 104, 72, 76, 180, 101, 196, 248, 163, 252, 150, 33, 224, 118, 128, 130, 145, 211, 28, 80, 17, 174, 33, 156, 108, 139, 120, 225, 111, 9, 46, 228, 79, 112, 121, 35, 181, 170, 12, 131, 173, 169, 4, 40, 8, 101, 34, 154, 227, 200, 57, 50, 118, 220, 128, 21, 208, 62, 131, 68, 193, 52, 163, 35, 96, 45, 225, 26, 219, 50, 194, 44, 22, 181, 83, 21, 82, 35, 100, 10, 241, 218, 12, 104, 240, 254, 190, 54, 48, 213, 87, 65, 183, 27, 232, 23, 246, 169, 179, 164, 55, 66, 70, 219, 7, 214, 128, 58, 244, 120, 52, 255, 213, 170, 81, 235, 16, 46, 18, 229, 186, 139, 118, 127, 12, 74, 173, 106, 171, 161, 3, 108, 3, 113, 211, 2, 88, 90, 227, 202, 196, 195, 69, 88, 168, 40, 87, 247, 210, 5, 26, 117, 159, 42, 3, 73, 148, 247, 236, 110, 16, 236, 169, 179, 22, 198, 32, 79, 138, 96, 70, 6, 161, 27, 71, 155, 241, 112, 60, 188, 51, 134, 154, 0, 207, 203, 43, 102, 88, 180, 139, 239, 72, 26, 46, 174, 76, 65, 14, 135, 202, 211, 124, 201, 4, 227, 40, 119, 46, 102, 23, 71, 143, 167, 164, 77, 192, 135, 16, 27, 148, 127, 123, 191, 209, 160, 49, 93, 138, 94, 161, 181, 205, 80, 80, 33, 73, 203, 45, 36, 194, 173, 86, 7, 234, 200, 138, 20, 62, 20, 110, 84, 16, 238, 207, 123, 175, 233, 40, 135, 51, 85, 136, 64, 204, 198, 207, 151, 162, 133, 207, 58, 246, 187, 201, 91, 185, 76, 46, 209, 173, 153, 71, 158, 241, 109, 66, 129, 109, 19, 70, 30, 186, 76, 249, 125, 197, 243, 223, 219, 16, 93, 134, 232, 59, 188, 42, 4, 155, 129, 236, 145, 166, 244, 222, 103, 3, 166, 145, 150, 57, 129, 19, 253, 157, 242, 66, 97, 165, 107, 87, 180, 245, 247, 47, 19, 34, 135, 219, 94, 76, 118, 156, 247, 148, 44, 142, 164, 20, 184, 96, 179, 138, 54, 39, 212, 235, 96, 215, 39, 45, 51, 215, 39, 47, 119, 120, 22, 197, 166, 158, 26, 115, 21, 16, 110, 23, 166, 132, 209, 232, 103, 248, 200, 133, 238, 224, 13, 50, 110, 33, 211, 154, 5, 239, 137, 226, 87, 131, 152, 225, 59, 208, 49, 204, 237, 81, 149, 34, 167, 46, 181, 121, 110, 31, 108, 226, 10, 80, 6, 47, 84, 180, 176, 86, 70, 171, 221, 85, 143, 172, 227, 120, 229, 75, 140, 133, 195, 176, 173, 92, 82, 179, 97, 115, 116, 236, 224, 70, 44, 166, 206, 23, 99, 0, 213, 47, 203, 153, 221, 178, 246, 196, 30, 74, 208, 100, 245, 85, 136, 132, 6, 213, 73, 199, 248, 61, 206, 141, 74, 61, 100, 181, 157, 51, 131, 95, 116, 217, 218, 162, 32, 136, 10, 115, 221, 65, 16, 223, 19, 163, 172, 73, 140, 97, 69, 67, 199, 116, 137, 251, 188, 106, 68, 78, 25, 225, 202, 40, 117, 161, 114, 10, 208, 29, 48, 217, 82, 234, 75, 134, 156, 9, 253, 241, 144, 22, 186, 139, 101, 111, 37, 72, 95, 33, 177, 20, 246, 210, 132, 1, 255, 84, 153, 171, 140, 222, 57, 86, 34, 181, 228, 39, 13, 158, 35, 57, 113, 16, 61, 97, 111, 39, 48, 192, 88, 102, 201, 83, 73, 113, 227, 116, 20, 73, 169, 135, 107, 8, 96, 250, 23, 25, 242, 51, 166, 29, 160, 169, 43, 239, 90, 254, 198, 209, 54, 249, 31, 217, 23, 118, 57, 192, 20, 69, 77, 50, 24, 34, 190, 166, 28, 181, 49, 126, 222, 133, 171, 0, 85, 212, 226, 94, 35, 11, 186, 253, 42, 162, 231, 111, 41, 53, 21, 0, 196, 211, 17, 73, 180, 211, 43, 10, 11, 169, 42, 217, 100, 220, 106, 211, 8, 68, 44, 65, 124, 214, 103, 198, 30, 191, 25, 71, 54, 175, 38, 179, 199, 70, 138, 97, 108, 255, 138, 125, 40, 227, 161, 76, 237, 137, 181, 151, 130, 199, 147, 50, 202, 63, 204, 201, 210, 176, 96, 34, 56, 67, 123, 183, 1, 76, 154, 235, 179, 216, 12, 117, 188, 46, 156, 252, 113, 160, 233, 197, 85, 136, 30, 248, 140, 12, 94, 134, 65, 86, 195, 234, 246, 91, 169, 22, 246, 179, 50, 9, 114, 221, 181, 117, 75, 248, 250, 178, 13, 27, 17, 253, 242, 46, 217, 38, 173, 41, 199, 29, 74, 40, 35, 68, 210, 208, 58, 180, 133, 244, 138, 113, 207, 34, 225, 122, 92, 111, 221, 183, 24, 150, 49, 7, 21, 66, 56, 58, 165, 114, 83, 27, 31, 48, 14, 6, 160, 66, 45, 64, 87, 184, 7, 29, 123, 248, 231, 76, 1, 133, 82, 122, 54, 198, 43, 143, 135, 5, 173, 90, 234, 193, 11, 13, 158, 200, 210, 235, 34, 16, 147, 34, 12, 162, 125, 17, 42, 120, 178, 254, 70, 247, 98, 239, 253, 121, 6, 228, 136, 142, 224, 84, 181, 244, 122, 130, 165, 247, 26, 40, 7, 194, 75, 69, 109, 154, 8, 69, 73, 19, 187, 93, 141, 133, 163, 142, 102, 230, 167, 64, 60, 82, 140, 73, 205, 221, 44, 139, 106, 67, 75, 232, 192, 201, 199, 198, 3, 138, 228, 140, 161, 212, 57, 55, 51, 94, 38, 89, 225, 92, 37, 239, 56, 35, 50, 203, 123, 145, 140, 62, 37, 78, 17, 223, 236, 211, 3, 152, 48, 200, 73, 18, 202, 203, 100, 185, 171, 51, 254, 143, 39, 141, 125, 28, 236, 179, 45, 234, 126, 20, 65, 174, 97, 241, 242, 45, 63, 49, 10, 137, 234, 137, 186, 225, 132, 36, 54, 195, 173, 21, 185, 163, 118, 125, 244, 66, 172, 145, 124, 242, 5, 21, 230, 51, 165, 24, 71, 157, 116, 172, 183, 147, 176, 148, 136, 88, 84, 10, 83, 22, 173, 67, 228, 17, 37, 136, 248, 234, 77, 233, 145, 111, 253, 31, 77, 212, 111, 222, 215, 46, 77, 29, 10, 192, 121, 17, 173, 70, 252, 53, 136, 16, 177, 162, 28, 113, 124, 181, 146, 235, 248, 80, 80, 242, 94, 21, 192, 162, 236, 21, 163, 244, 217, 15, 167, 84, 195, 43, 216, 220, 177, 69, 99, 35, 58, 217, 252, 195, 102, 13, 196, 105, 6, 217, 48, 209, 199, 143, 139, 51, 227, 180, 80, 148, 206, 183, 153, 31, 245, 60, 182, 205, 199, 153, 244, 232, 251, 209, 169, 42, 163, 67, 217, 181, 27, 57, 115, 107, 78, 192, 254, 236, 183, 230, 114, 42, 155, 19, 142, 83, 207, 172, 53, 20, 250, 2, 150, 37, 214, 186, 35, 8, 179, 170, 90, 214, 160, 218, 251, 130, 197, 24, 191, 23, 236, 227, 157, 3, 96, 32, 168, 173, 248, 215, 41, 14, 14, 80, 134, 34, 65, 108, 106, 46, 195, 150, 150, 123, 103, 56, 121, 202, 213, 107, 245, 191, 129, 192, 40, 90, 5, 30, 100, 119, 156, 208, 22, 206, 119, 48, 69, 54, 22, 230, 217, 97, 167, 114, 105, 155, 188, 78, 3, 170, 226, 209, 167, 147, 154, 90, 126, 193, 12, 253, 228, 165, 3, 31, 102, 106, 2, 235, 18, 39, 152, 173, 182, 194, 126, 183, 114, 202, 209, 32, 68, 98, 99, 185, 55, 21, 116, 89, 224, 79, 160, 166, 171, 39, 179, 173, 146, 79, 167, 36, 75, 195, 22, 248, 177, 97, 122, 14, 86, 234, 99, 20, 138, 252, 2, 31, 47, 191, 187, 136, 224, 233, 172, 28, 59, 77, 231, 124, 86, 67, 25, 9, 222, 119, 157, 29, 30, 166, 111, 107, 138, 153, 254, 26, 105, 243, 91, 208, 2, 249, 188, 40, 34, 138, 91, 32, 171, 246, 64, 57, 7, 145, 243, 155, 93, 228, 228, 158, 94, 185, 149, 63, 236, 176, 186, 35, 145, 171, 209, 213, 214, 1, 158, 143, 185, 33, 248, 84, 1, 91, 201, 0, 174, 112, 52, 165, 202, 24, 20, 234, 125, 255, 142, 35, 138, 21, 87, 157, 40, 87, 150, 222, 226, 114, 119, 127, 190, 123, 25, 10, 175, 20, 66, 35, 8, 253, 203, 17, 79, 239, 79, 49, 92, 111, 62, 64, 94, 150, 95, 50, 246, 19, 78, 89, 247, 4, 25, 146, 142, 201, 101, 137, 36, 179, 93, 80, 158, 144, 34, 248, 173, 20, 245, 180, 30, 132, 241, 10, 120, 205, 10, 200, 119, 195, 193, 48, 205, 143, 48, 53, 155, 242, 50, 99, 181, 154, 182, 44, 243, 5, 18, 121, 140, 60, 56, 141, 213, 156, 158, 122, 28, 125, 42, 152, 83, 47, 132, 16, 54, 246, 164, 123, 68, 237, 151, 20, 161, 128, 24, 251, 153, 36, 9, 100, 227, 235, 15, 204, 33, 69, 90, 175, 71, 200, 215, 24, 28, 136, 123, 224, 112, 205, 183, 171, 130, 119, 157, 87, 155, 55, 89, 50, 121, 143, 12, 118, 51, 131, 109, 111, 39, 194, 206, 119, 150, 89, 9, 199, 86, 88, 207, 32, 241, 141, 106, 11, 19, 241, 140, 74, 19, 241, 116, 186, 224, 216, 139, 83, 35, 186, 189, 122, 64, 168, 121, 63, 182, 101, 232, 152, 96, 4, 162, 191, 152, 73, 12, 240, 55, 51, 112, 218, 216, 129, 30, 39, 49, 209, 132, 24, 140, 22, 17, 216, 218, 120, 221, 248, 40, 169, 24, 78, 198, 219, 99, 86, 225, 233, 255, 239, 118, 13, 44, 190, 145, 152, 207, 101, 102, 168, 204, 212, 179, 109, 54, 101, 48, 155, 91, 170, 10, 87, 131, 49, 95, 165, 199, 62, 162, 187, 239, 186, 7, 225, 128, 178, 201, 39, 223, 213, 194, 202, 65, 216, 188, 204, 161, 53, 103, 200, 108, 56, 119, 205, 152, 227, 105, 8, 55, 99, 100, 226, 227, 206, 104, 172, 249, 126, 39, 185, 1, 243, 134, 226, 104, 36, 176, 242, 51, 27, 83, 252, 250, 219, 2, 201, 197, 64, 156, 102, 171, 172, 59, 35, 60, 154, 112, 32, 14, 252, 78, 91, 162, 54, 139, 223, 154, 97, 157, 236, 49, 33, 253, 67, 60, 100, 127, 204, 83, 235, 7, 217, 215, 136, 85, 76, 172, 161, 180, 54, 61, 43, 187, 207, 125, 50, 157, 246, 96, 159, 203, 17, 61, 26, 184, 206, 206, 232, 73, 32, 222, 252, 64, 156, 78, 140, 41, 121, 73, 222, 133, 72, 98, 45, 161, 172, 42, 230, 164, 248, 139, 255, 140, 84, 5, 244, 131, 158, 185, 177, 5, 27, 201, 68, 69, 37, 32, 11, 79, 15, 218, 201, 41, 61, 220, 82, 102, 143, 137, 93, 161, 93, 184, 133, 140, 9, 118, 220, 217, 184, 157, 227, 184, 1, 219, 35, 183, 183, 154, 195, 123, 59, 124, 166, 251, 151, 248, 83, 199, 158, 163, 206, 4, 131, 32, 69, 137, 93, 52, 213, 84, 219, 225, 85, 146, 26, 21, 122, 138, 108, 189, 93, 29, 36, 19, 127, 185, 251, 186, 134, 1, 139, 130, 148, 24, 147, 113, 153, 18, 156, 113, 220, 136, 99, 207, 16, 224, 118, 5, 125, 247, 223, 187, 255, 176, 45, 225, 100, 65, 230, 94, 247, 106, 236, 139, 48, 170, 135, 188, 110, 72, 245, 77, 229, 119, 121, 221, 117, 80, 161, 11, 83, 111, 104, 7, 16, 215, 200, 76, 70, 30, 235, 109, 255, 108, 51, 22, 39, 118, 166, 185, 10, 201, 25, 135, 139, 123, 47, 231, 94, 237, 44, 205, 224, 101, 159, 219, 52, 75, 219, 117, 127, 94, 37, 98, 166, 26, 218, 182, 135, 79, 97, 128, 47, 80, 11, 129, 232, 199, 73, 238, 20, 96, 73, 8, 13, 246, 150, 113, 16, 93, 29, 63, 99, 184, 127, 48, 184, 15, 201, 41, 8, 73, 20, 254, 186, 190, 85, 57, 106, 219, 50, 222, 245, 19, 1, 224, 126, 204, 176, 212, 46, 202, 253, 246, 139, 139, 157, 165, 224, 100, 16, 48, 50, 146, 146, 189, 215, 105, 250, 219, 7, 105, 27, 195, 58, 185, 223, 24, 132, 199, 121, 183, 28, 15, 242, 170, 196, 120, 116, 16, 197, 209, 226, 57, 221, 6, 20, 154, 98, 50, 100, 209, 68, 35, 57, 77, 168, 139, 101, 179, 73, 182, 158, 237, 54, 140, 39, 181, 108, 154, 139, 112, 185, 112, 88, 51, 125, 93, 26, 202, 77, 157, 48, 88, 66, 74, 64, 55, 153, 78, 123, 156, 171, 59, 43, 11, 142, 249, 137, 25, 136, 219, 244, 210, 117, 44, 156, 136, 80, 224, 236, 213, 190, 71, 252, 135, 37, 95, 7, 5, 28, 172, 241, 27, 217, 140, 19, 42, 138, 107, 71, 12, 75, 179, 112, 29, 129, 191, 9, 141, 179, 255, 1, 162, 7, 118, 105, 47, 49, 105, 44, 20, 86, 185, 2, 125, 146, 241, 159, 105, 176, 221, 115, 213, 14, 66, 202, 95, 250, 213, 43, 248, 176, 4, 46, 39, 84, 19, 186, 80, 242, 53, 182, 156, 3, 43, 8, 79, 88, 156, 127, 11, 247, 179, 199, 208, 251, 37, 217, 22, 207, 191, 128, 53, 160, 16, 159, 197, 19, 214, 240, 29, 193, 212, 73, 191, 244, 27, 189, 229, 99, 251, 254, 50, 42, 191, 199, 15, 149, 141, 81, 60, 25, 135, 120, 231, 40, 84, 127, 59, 150, 127, 45, 154, 135, 124, 109, 252, 186, 204, 98, 148, 162, 133, 10, 234, 232, 152, 88, 216, 54, 242, 206, 78, 160, 12, 78, 10, 228, 2, 238, 50, 9, 230, 116, 204, 206, 160, 9, 199, 12, 12, 224, 13, 153, 81, 51, 253, 140, 197, 148, 47, 192, 14, 187, 255, 216, 110, 141, 198, 35, 212, 244, 67, 77, 48, 87, 46, 46, 113, 205, 220, 81, 105, 109, 9, 248, 194, 100, 71, 187, 160, 9, 221, 178, 176, 119, 196, 36, 136, 12, 68, 34, 113, 221, 250, 250, 4, 251, 20, 137, 70, 241, 172, 178, 185, 214, 23, 55, 196, 31, 160, 76, 214, 230, 139, 192, 144, 120, 188, 225, 215, 132, 33, 105, 178, 83, 69, 92, 192, 112, 123, 221, 34, 7, 73, 145, 233, 56, 12, 67, 106, 152, 77, 143, 77, 217, 102, 6, 199, 53, 14, 162, 12, 134, 91, 59, 169, 181, 18, 47, 11, 206, 69, 65, 66, 27, 160, 98, 149, 22, 24, 53, 196, 119, 231, 84, 211, 246, 231, 218, 99, 120, 197, 151, 30, 153, 192, 120, 253, 70, 234, 253, 239, 34, 74, 6, 233, 149, 155, 214, 12, 127, 57, 92, 225, 201, 233, 116, 48, 226, 94, 159, 212, 78, 222, 99, 116, 29, 187, 3, 59, 167, 68, 108, 162, 146, 125, 6, 178, 230, 60, 158, 60, 85, 94, 113, 93, 2, 75, 195, 234, 66, 200, 148, 128, 50, 56, 58, 205, 79, 226, 11, 189, 189, 88, 32, 67, 83, 84, 188, 31, 180, 79, 252, 9, 177, 199, 53, 163, 66, 54, 110, 245, 174, 113, 225, 204, 180, 149, 6, 141, 18, 250, 150, 168, 229, 99, 107, 110, 108, 63, 70, 43, 146, 216, 64, 42, 3, 227, 146, 223, 233, 6, 140, 108, 238, 21, 245, 70, 14, 152, 92, 109, 138, 104, 200, 195, 248, 125, 230, 8, 4, 138, 125, 228, 221, 225, 98, 146, 230, 91, 225, 247, 207, 29, 112, 185, 202, 157, 218, 18, 193, 45, 54, 47, 215, 162, 29, 92, 95, 13, 88, 40, 129, 1, 150, 106, 203, 117, 76, 176, 157, 169, 61, 45, 201, 67, 35, 238, 149, 21, 174, 50, 162, 150, 120, 22, 144, 195, 187, 214, 239, 178, 231, 165, 200, 167, 170, 107, 98, 242, 205, 72, 113, 166, 163, 6, 197, 57, 210, 106, 231, 192, 17, 112, 77, 83, 171, 216, 127, 73, 143, 182, 224, 111, 104, 137, 123, 119, 52, 153, 42, 205, 161, 145, 174, 167, 38, 117, 130, 82, 31, 228, 102, 234, 30, 199, 194, 207, 73, 109, 64, 231, 55, 221, 65, 225, 203, 28, 113, 2, 120, 201, 22, 125, 211, 76, 82, 58, 75, 181, 33, 121, 189, 138, 70, 122, 155, 252, 133, 51, 35, 241, 193, 121, 148, 48, 44, 155, 123, 240, 9, 169, 145, 15, 79, 213, 180, 160, 30, 198, 225, 209, 186, 124, 186, 53, 240, 246, 13, 188, 52, 211, 221, 181, 212, 140, 143, 187, 178, 11, 181, 202, 78, 50, 55, 119, 228, 113, 120, 231, 184, 165, 122, 121, 94, 181, 222, 248, 225, 204, 245, 174, 205, 63, 219, 192, 246, 82, 101, 109, 115, 160, 153, 82, 131, 38, 219, 229, 58, 114, 205, 138, 141, 137, 237, 89, 94, 245, 84, 177, 166, 0, 38, 16, 173, 56, 248, 67, 55, 114, 252, 89, 251, 146, 93, 24, 104, 113, 181, 37, 164, 37, 158, 96, 137, 191, 214, 21, 51, 215, 58, 123, 111, 161, 116, 157, 112, 211, 188, 210, 52, 105, 219, 91, 213, 191, 133, 171, 47, 102, 174, 51, 170, 180, 10, 30, 181, 17, 43, 76, 13, 242, 136, 41, 45, 155, 24, 45, 79, 146, 218, 6, 107, 47, 142, 32, 141, 94, 165, 12, 149, 84, 170, 122, 202, 67, 130, 126, 39, 129, 244, 187, 19, 227, 22, 108, 234, 94, 98, 61, 155, 251, 228, 212, 43, 37, 254, 81, 222, 41, 67, 5, 225, 124, 53, 203, 111, 24, 212, 64, 17, 85, 194, 255, 56, 190, 115, 192, 203, 55, 170, 152, 187, 166, 116, 85, 66, 167, 213, 247, 129, 15, 118, 86, 104, 224, 195, 108, 109, 6, 200, 191, 34, 138, 117, 74, 182, 209, 18, 204, 182, 139, 184, 27, 107, 175, 14, 145, 155, 197, 251, 53, 141, 209, 98, 130, 230, 2, 91, 91, 90, 254, 131, 252, 91, 85, 39, 212, 73, 90, 57, 184, 144, 26, 163, 6, 32, 243, 234, 162, 234, 236, 167, 234, 73, 113, 50, 77, 165, 129, 122, 211, 6, 34, 194, 184, 29, 135, 226, 91, 114, 14, 96, 246, 243, 22, 200, 242, 220, 174, 227, 244, 168, 199, 197, 55, 114, 62, 215, 172, 58, 60, 82, 41, 205, 8, 107, 253, 62, 108, 122, 249, 78, 137, 39, 167, 14, 35, 153, 136, 62, 193, 211, 120, 49, 237, 232, 22, 215, 190, 132, 161, 250, 249, 174, 253, 90, 93, 210, 35, 222, 35, 62, 60, 204, 107, 63, 198, 121, 147, 68, 213, 75, 49, 50, 3, 5, 74, 30, 92, 119, 11, 223, 133, 222, 29, 233, 248, 93, 87, 194, 139, 84, 52, 214, 44, 146, 19, 241, 82, 204, 163, 154, 253, 130, 159, 88, 148, 116, 207, 29, 114, 117, 150, 154, 24, 81, 78, 95, 1, 208, 84, 197, 172, 141, 3, 107, 18, 192, 120, 196, 91, 30, 82, 90, 232, 163, 10, 142, 96, 198, 62, 126, 212, 153, 100, 207, 146, 122, 233, 92, 188, 147, 27, 9, 102, 204, 119, 209, 242, 71, 222, 108, 114, 249, 173, 59, 14, 67, 26, 104, 240, 136, 199, 70, 131, 39, 134, 18, 1, 152, 79, 224, 130, 104, 195, 179, 215, 90, 186, 244, 238, 12, 90, 181, 145, 75, 238, 84, 158, 111, 63, 187, 121, 152, 132, 167, 150, 138, 62, 203, 40, 70, 138, 154, 210, 37, 50, 226, 69, 253, 143, 26, 0, 243, 131, 5, 139, 79, 48, 48, 115, 122, 61, 71, 41, 1, 232, 239, 4, 96, 74, 209, 253, 128, 224, 222, 158, 97, 150, 16, 30, 132, 240, 199, 197, 118, 13, 71, 56, 160, 190, 35, 215, 110, 165, 254, 26, 69, 43, 195, 163, 30, 245, 138, 48, 80, 140, 245, 89, 83, 165, 65, 39, 20, 83, 115, 119, 111, 90, 202, 101, 172, 91, 178, 35, 17, 120, 45, 118, 91, 60, 189, 180, 133, 34, 19, 137, 152, 143, 16, 186, 214, 4, 46, 242, 23, 179, 229, 204, 55, 218, 22, 188, 5, 222, 140, 69, 195, 43, 31, 34, 159, 131, 53, 28, 83, 208, 158, 112, 163, 16, 61, 175, 3, 69, 113, 134, 174, 21, 125, 162, 91, 182, 251, 120, 17, 94, 100, 252, 199, 118, 35, 248, 64, 206, 179, 38, 121, 176, 84, 197, 9, 2, 45, 111, 244, 161, 250, 199, 130, 208, 167, 250, 0, 155, 57, 0, 95, 39, 206, 237, 5, 23, 58, 142, 137, 77, 164, 152, 219, 94, 57, 237, 16, 219, 119, 57, 58, 101, 189, 104, 205, 228, 28, 237, 119, 143, 99, 241, 5, 160, 115, 91, 215, 246, 198, 153, 60, 186, 64, 248, 126, 67, 56, 155, 179, 55, 102, 3, 47, 68, 145, 41, 209, 45, 148, 106, 11, 71, 191, 171, 245, 33, 6, 133, 216, 1, 109, 128, 56, 120, 247, 17, 169, 150, 173, 61, 111, 0, 65, 2, 95, 229, 63, 59, 185, 148, 213, 149, 140, 190, 57, 151, 163, 73, 9, 231, 250, 76, 126, 211, 12, 175, 14, 38, 146, 30, 102, 22, 124, 58, 137, 239, 181, 99, 176, 2, 184, 48, 196, 132, 248, 140, 90, 194, 95, 6, 90, 242, 171, 254, 189, 235, 8, 68, 244, 115, 89, 217, 10, 61, 172, 252, 75, 186, 117, 212, 216, 62, 253, 98, 156, 233, 96, 139, 55, 91, 251, 168, 221, 67, 231, 18, 140, 250, 38, 232, 143, 65, 220, 234, 129, 106, 184, 63, 171, 119, 96, 32, 9, 45, 151, 74, 71, 81, 162, 109, 58, 194, 125, 191, 169, 244, 9, 190, 37, 38, 98, 36, 238, 176, 38, 150, 30, 227, 0, 191, 60, 189, 0, 4, 178, 196, 238, 182, 233, 8, 126, 14, 236, 73, 100, 16, 150, 49, 26, 104, 152, 197, 132, 53, 229, 100, 196, 206, 7, 74, 91, 143, 23, 206, 120, 252, 52, 73, 161, 148, 41, 160, 137, 29, 207, 222, 13, 128, 144, 191, 162, 60, 24, 226, 187, 250, 73, 76, 246, 240, 31, 254, 109, 144, 102, 248, 207, 215, 44, 182, 29, 202, 54, 141, 107, 124, 239, 205, 243, 54, 158, 0, 148, 202, 98, 65, 233, 201, 60, 169, 34, 64, 81, 62, 205, 225, 228, 233, 250, 23, 146, 53, 104, 120, 68, 71, 179, 26, 156, 230, 25, 225, 235, 138, 20, 196, 223, 72, 176, 237, 67, 107, 202, 211, 32, 31, 184, 26, 178, 64, 134, 225, 115, 8, 227, 9, 200, 33, 31, 31, 58, 82, 251, 249, 54, 46, 60, 12, 233, 66, 222, 144, 243, 111, 110, 25, 117, 77, 108, 223, 211, 209, 23, 78, 162, 154, 77, 84, 251, 166, 89, 207, 45, 78, 51, 85, 18, 51, 14, 56, 9, 131, 186, 111, 229, 230, 11, 197, 196, 201, 184, 134, 147, 52, 14, 185, 145, 14, 9, 164, 157, 82, 3, 252, 42, 244, 140, 207, 189, 77, 13, 232, 248, 139, 10, 137, 30, 189, 91, 92, 202, 63, 249, 97, 212, 139, 39, 155, 251, 253, 10, 249, 13, 115, 238, 203, 112, 147, 186, 185, 46, 239, 51, 143, 148, 251, 163, 208, 254, 121, 240, 243, 22, 162, 47, 196, 44, 249, 0, 59, 127, 144, 82, 11, 69, 124, 76, 131, 231, 236, 169, 97, 172, 168, 157, 24, 17, 61, 108, 229, 182, 153, 0, 196, 23, 118, 40, 70, 167, 178, 79, 47, 113, 75, 93, 46, 135, 148, 121, 57, 20, 150, 28, 66, 210, 141, 142, 91, 131, 112, 239, 188, 35, 5, 181, 128, 2, 59, 120, 6, 228, 206, 130, 132, 104, 30, 219, 147, 82, 12, 48, 9, 98, 51, 34, 196, 135, 236, 115, 178, 10, 25, 8, 205, 28, 231, 140, 199, 224, 224, 162, 123, 88, 194, 202, 218, 116, 49, 233, 137, 112, 72, 235, 157, 125, 137, 74, 132, 49, 69, 232, 249, 247, 241, 47, 8, 112, 5, 72, 138, 149, 121, 2, 148, 204, 93, 231, 44, 129, 140, 149, 206, 104, 37, 208, 181, 86, 67, 122, 167, 114, 166, 200, 134, 180, 179, 139, 120, 16, 106, 171, 93, 58, 179, 175, 179, 244, 148, 36, 83, 171, 157, 182, 146, 111, 22, 0, 144, 110, 105, 47, 90, 236, 177, 47, 44, 35, 250, 237, 111, 141, 89, 6, 186, 22, 196, 32, 166, 23, 143, 17, 96, 127, 58, 139, 137, 29, 250, 164, 52, 141, 1, 13, 117, 82, 93, 241, 254, 120, 139, 165, 1, 114, 105, 7, 135, 180, 57, 252, 202, 233, 69, 253, 38, 11, 88, 223, 17, 203, 64, 162, 170, 127, 59, 163, 90, 8, 58, 149, 20, 214, 159, 26, 160, 120, 244, 123, 91, 203, 31, 86, 237, 20, 242, 66, 14, 182, 206, 127, 54, 119, 36, 182, 41, 129, 128, 193, 81, 19, 182, 120, 85, 23, 210, 220, 177, 202, 204, 102, 143, 81, 243, 233, 15, 67, 183, 157, 96, 122, 120, 130, 79, 154, 118, 36, 78, 152, 24, 123, 90, 86, 169, 200, 20, 29, 57, 210, 133, 16, 52, 24, 202, 20, 173, 101, 230, 61, 47, 105, 94, 244, 47, 217, 207, 87, 87, 93, 204, 138, 110, 8, 150, 200, 248, 129, 139, 134, 225, 34, 34, 150, 247, 70, 194, 144, 167, 21, 98, 161, 7, 38, 78, 3, 36, 42, 134, 161, 157, 203, 87, 34, 171, 28, 199, 64, 186, 130, 223, 103, 121, 88, 130, 50, 174, 10, 50, 79, 13, 92, 162, 99, 1, 85, 168, 122, 61, 132, 80, 85, 112, 238, 6, 179, 207, 162, 53, 16, 198, 250, 218, 206, 202, 242, 248, 31, 74, 86, 197, 133, 193, 36, 99, 133, 160, 223, 55, 36, 153, 101, 165, 188, 184, 179, 189, 36, 198, 254, 51, 199, 13, 116, 24, 10, 135, 101, 208, 166, 54, 107, 1, 166, 97, 38, 201, 45, 86, 218, 44, 163, 60, 173, 129, 69, 17, 204, 55, 85, 141, 80, 100, 88, 127, 108, 205, 65, 73, 159, 204, 216, 250, 240, 17, 121, 196, 196, 121, 46, 64, 25, 215, 88, 102, 221, 244, 35, 248, 96, 114, 66, 125, 134, 7, 83, 97, 0, 80, 166, 224, 216, 22, 213, 18, 42, 242, 126, 182, 81, 224, 10, 37, 193, 43, 174, 74, 159, 147, 58, 65, 217, 147, 110, 214, 95, 122, 174, 125, 121, 74, 66, 144, 74, 99, 52, 132, 104, 105, 139, 225, 128, 62, 1, 188, 7, 43, 185, 222, 134, 6, 216, 52, 211, 213, 83, 109, 176, 166, 152, 161, 48, 211, 124, 198, 241, 52, 237, 139, 155, 20, 233, 140, 55, 147, 68, 77, 166, 106, 81, 213, 250, 74, 125, 165, 213, 65, 147, 92, 31, 208, 242, 169, 90, 30, 239, 165, 143, 196, 85, 247, 121, 147, 38, 181, 170, 75, 30, 224, 105, 121, 27, 197, 246, 172, 39, 109, 6, 209, 42, 208, 13, 148, 153, 97, 247, 38, 168, 185, 76, 42, 102, 145, 166, 27, 242, 37, 136, 45, 245, 32, 200, 177, 225, 248, 154, 117, 172, 184, 37, 156, 208, 100, 151, 64, 16, 193, 254, 213, 205, 140, 207, 153, 64, 155, 57, 47, 237, 59, 231, 10, 130, 204, 72, 30, 17, 60, 76, 115, 161, 237, 104, 5, 38, 254, 90, 152, 208, 49, 194, 160, 243, 106, 78, 41, 251, 143, 104, 130, 180, 241, 98, 211, 238, 194, 224, 36, 242, 39, 109, 180, 67, 130, 210, 44, 8, 162, 150, 16, 76, 83, 40, 86, 97, 87, 187, 42, 50, 63, 35, 98, 192, 23, 138, 236, 90, 3, 157, 19, 5, 252, 228, 211, 239, 1, 85, 190, 54, 144, 218, 221, 184, 19, 89, 75, 138, 53, 115, 206, 31, 100, 99, 187, 80, 162, 222, 134, 167, 238, 117, 84, 36, 62, 178, 224, 147, 119, 160, 65, 244, 245, 157, 188, 184, 222, 42, 53, 188, 84, 51, 5, 22, 214, 229, 92, 249, 17, 78, 6, 79, 145, 92, 201, 53, 58, 45, 87, 90, 19, 194, 253, 18, 68, 87, 58, 48, 206, 85, 241, 173, 40, 0, 38, 75, 210, 227, 254, 150, 117, 168, 88, 41, 180, 31, 77, 239, 136, 37, 106, 222, 33, 63, 239, 217, 245, 29, 11, 255, 94, 181, 132, 91, 80, 152, 15, 224, 253, 187, 104, 191, 95, 180, 55, 108, 24, 65, 32, 27, 147, 201, 102, 102, 64, 245, 14, 196, 154, 169, 133, 191, 117, 49, 108, 75, 133, 72, 95, 48, 126, 1, 166, 187, 129, 223, 94, 96, 39, 225, 222, 196, 210, 129, 35, 24, 186, 145, 6, 173, 82, 67, 130, 97, 167, 138, 167, 57, 181, 228, 249, 247, 44, 29, 9, 140, 245, 49, 164, 210, 119, 91, 176, 15, 31, 206, 88, 229, 155, 23, 72, 114, 224, 237, 190, 194, 147, 133, 233, 170, 22, 64, 241, 162, 204, 52, 208, 138, 159, 29, 94, 25, 117, 103, 132, 232, 65, 198, 90, 183, 113, 6, 76, 52, 141, 199, 166, 170, 128, 199, 251, 60, 137, 86, 78, 52, 16, 72, 64, 112, 174, 67, 54, 73, 63, 55, 183, 30, 11, 48, 131, 7, 94, 151, 17, 166, 115, 62, 5, 221, 71, 30, 137, 35, 181, 250, 187, 68, 26, 187, 51, 202, 249, 76, 162, 63, 10, 144, 123, 119, 217, 155, 15, 214, 212, 52, 39, 208, 109, 210, 206, 230, 242, 186, 254, 170, 138, 52, 40, 130, 7, 102, 67, 28, 38, 106, 152, 122, 172, 184, 166, 81, 30, 236, 149, 213, 236, 174, 130, 140, 44, 143, 199, 9, 118, 58, 11, 30, 126, 139, 39, 128, 92, 83, 242, 207, 200, 157, 245, 147, 84, 207, 140, 120, 59, 56, 228, 145, 177, 130, 48, 139, 78, 101, 124, 42, 228, 129, 172, 14, 248, 144, 142, 189, 38, 158, 58, 85, 84, 75, 136, 180, 175, 13, 184, 0, 26, 128, 234, 151, 167, 40, 6, 163, 8, 23, 57, 69, 42, 89, 174, 50, 0, 216, 186, 166, 7, 143, 123, 95, 23, 26, 134, 127, 125, 199, 117, 26, 215, 129, 212, 119, 83, 2, 66, 96, 247, 126, 241, 49, 171, 186, 222, 146, 234, 115, 199, 123, 112, 79, 147, 53, 210, 95, 192, 166, 49, 137, 245, 80, 120, 14, 184, 242, 237, 131, 27, 141, 100, 178, 185, 54, 245, 152, 55, 243, 88, 45, 122, 48, 229, 214, 55, 118, 105, 222, 26, 189, 68, 42, 21, 34, 57, 165, 246, 109, 35, 84, 45, 76, 196, 116, 127, 88, 180, 10, 179, 103, 226, 208, 33, 91, 111, 12, 231, 221, 166, 64, 199, 93, 87, 58, 164, 108, 23, 126, 169, 216, 119, 68, 104, 24, 51, 156, 71, 175, 181, 93, 184, 124, 171, 34, 72, 115, 95, 148, 72, 166, 241, 178, 223, 36, 10, 12, 219, 50, 172, 139, 152, 26, 232, 185, 249, 95, 249, 8, 244, 20, 78, 136, 141, 145, 169, 168, 2, 208, 9, 30, 37, 50, 149, 47, 50, 17, 64, 214, 168, 32, 23, 228, 232, 31, 78, 219, 77, 8, 80, 253, 41, 79, 8, 123, 65, 234, 36, 78, 151, 23, 68, 18, 70, 10, 9, 9, 33, 142, 129, 115, 143, 191, 127, 209, 141, 202, 189, 55, 120, 16, 148, 184, 122, 178, 77, 10, 149, 18, 30, 6, 101, 53, 90, 155, 239, 253, 82, 57, 11, 125, 84, 7, 175, 116, 62, 210, 232, 112, 130, 253, 105, 153, 203, 31, 120, 251, 241, 45, 41, 127, 96, 146, 11, 187, 180, 115, 21, 63, 182, 213, 196, 175, 255, 162, 31, 233, 65, 197, 110, 42, 136, 54, 118, 234, 176, 3, 252, 83, 4, 107, 133, 19, 226, 34, 163, 232, 31, 39, 171, 178, 242, 36, 69, 64, 33, 167, 139, 81, 184, 160, 207, 119, 37, 137, 40, 165, 50, 167, 243, 188, 82, 142, 91, 2, 0, 209, 16, 166, 152, 134, 113, 185, 236, 253, 161, 120, 90, 94, 189, 81, 201, 224, 60, 66, 82, 23, 12, 199, 197, 86, 198, 16, 54, 174, 237, 121, 186, 244, 141, 50, 26, 152, 120, 78, 52, 71, 115, 40, 94, 156, 22, 162, 241, 219, 90, 212, 236, 21, 153, 170, 142, 20, 200, 251, 49, 98, 192, 173, 14, 167, 199, 167, 176, 235, 111, 61, 243, 30, 215, 35, 113, 127, 122, 250, 79, 162, 40, 130, 81, 31, 51, 177, 240, 9, 31, 192, 210, 151, 171, 78, 201, 50, 102, 227, 75, 196, 239, 232, 175, 240, 119, 205, 191, 180, 209, 68, 123, 86, 244, 114, 244, 209, 7, 35, 17, 16, 89, 133, 89, 42, 9, 18, 124, 21, 252, 101, 244, 88, 79, 214, 234, 145, 140, 52, 118, 47, 44, 121, 43, 14, 6, 157, 26, 16, 172, 252, 85, 94, 84, 59, 134, 19, 119, 10, 70, 91, 157, 246, 8, 74, 32, 15, 23, 230, 2, 205, 188, 103, 237, 92, 19, 88, 21, 147, 135, 117, 124, 107, 140, 39, 152, 51, 56, 246, 122, 153, 174, 106, 145, 140, 146, 78, 180, 243, 212, 62, 46, 3, 131, 137, 78, 56, 79, 160, 252, 117, 84, 126, 199, 194, 240, 227, 23, 188, 40, 206, 72, 68, 40, 58, 91, 183, 80, 40, 31, 65, 9, 70, 23, 34, 64, 199, 213, 138, 80, 140, 58, 202, 215, 115, 223, 92, 181, 218, 116, 252, 210, 190, 210, 54, 166, 241, 66, 132, 62, 98, 109, 158, 51, 52, 89, 69, 24, 171, 176, 235, 116, 175, 18, 111, 80, 167, 209, 170, 150, 194, 152, 23, 96, 162, 41, 244, 232, 80, 85, 76, 226, 126, 240, 196, 214, 81, 40, 183, 225, 102, 10, 166, 57, 231, 230, 232, 149, 164, 116, 112, 122, 0, 182, 53, 199, 252, 55, 50, 111, 243, 200, 64, 191, 29, 240, 86, 187, 126, 133, 121, 249, 249, 37, 58, 174, 209, 39, 152, 103, 151, 131, 127, 207, 154, 14, 188, 239, 28, 107, 33, 10, 57, 82, 158, 116, 63, 225, 29, 103, 80, 134, 84, 245, 37, 13, 1, 70, 95, 180, 82, 191, 0, 67, 243, 67, 218, 148, 30, 248, 160, 133, 92, 83, 190, 197, 251, 150, 117, 28, 178, 121, 17, 16, 209, 4, 188, 155, 55, 82, 134, 128, 3, 104, 142, 132, 144, 32, 101, 0, 223, 166, 79, 49, 108, 64, 231, 162, 6, 27, 94, 116, 68, 235, 168, 36, 115, 39, 191, 151, 28, 202, 228, 35, 90, 53, 172, 170, 173, 151, 236, 174, 197, 19, 85, 216, 192, 158, 128, 35, 6, 88, 21, 25, 158, 92, 18, 213, 22, 136, 119, 149, 124, 213, 103, 197, 6, 206, 174, 36, 196, 199, 208, 68, 57, 84, 28, 218, 251, 214, 75, 157, 254, 46, 61, 228, 188, 87, 93, 125, 155, 38, 175, 4, 36, 160, 31, 177, 70, 222, 245, 85, 246, 69, 109, 45, 77, 151, 175, 202, 23, 17, 139, 66, 77, 166, 155, 251, 82, 156, 11, 77, 102, 222, 20, 170, 255, 232, 162, 41, 73, 26, 89, 118, 58, 126, 212, 207, 108, 55, 5, 136, 150, 240, 223, 185, 103, 231, 115, 182, 189, 39, 164, 162, 182, 112, 113, 11, 93, 250, 108, 247, 231, 143, 172, 67, 223, 221, 224, 24, 116, 128, 119, 232, 143, 90, 27, 149, 49, 226, 195, 238, 66, 233, 15, 97, 137, 170, 155, 236, 124, 185, 95, 192, 121, 36, 82, 76, 249, 31, 46, 102, 185, 14, 243, 30, 244, 217, 184, 156, 156, 207, 35, 38, 89, 107, 212, 139, 75, 161, 16, 78, 232, 76, 209, 7, 92, 94, 80, 159, 58, 162, 138, 216, 206, 231, 93, 85, 198, 140, 90, 200, 170, 79, 118, 26, 52, 168, 111, 165, 224, 91, 45, 85, 42, 162, 142, 55, 0, 19, 167, 142, 86, 74, 235, 43, 230, 3, 162, 93, 33, 239, 43, 181, 253, 155, 106, 28, 48, 150, 43, 234, 102, 187, 247, 187, 40, 43, 158, 33, 48, 242, 214, 95, 182, 126, 3, 25, 218, 47, 163, 140, 217, 6, 221, 199, 57, 76, 182, 244, 110, 49, 168, 240, 129, 31, 226, 185, 35, 18, 185, 189, 2, 17, 190, 134, 137, 29, 76, 118, 48, 216, 33, 188, 103, 160, 66, 143, 23, 230, 255, 24, 238, 6, 111, 18, 214, 163, 244, 30, 36, 4, 216, 31, 162, 60, 127, 235, 203, 67, 34, 69, 20, 227, 220, 56, 107, 78, 81, 10, 160, 169, 19, 255, 211, 126, 46, 77, 46, 152, 46, 114, 135, 139, 23, 3, 172, 52, 80, 86, 11, 5, 190, 51, 86, 190, 67, 0, 75, 17, 160, 229, 12, 254, 152, 221, 3, 213, 220, 213, 244, 51, 157, 73, 251, 206, 213, 43, 113, 247, 245, 189, 52, 226, 250, 109, 212, 4, 168, 132, 24, 137, 160, 175, 219, 204, 156, 32, 253, 121, 8, 209, 200, 96, 88, 93, 66, 243, 84, 76, 148, 142, 229, 86, 31, 106, 10, 23, 136, 200, 132, 152, 150, 51, 125, 202, 13, 202, 63, 110, 38, 125, 12, 113, 17, 162, 92, 217, 24, 108, 235, 209, 81, 65, 202, 179, 60, 176, 11, 91, 62, 45, 126, 96, 9, 66, 153, 134, 11, 40, 231, 205, 66, 5, 249, 92, 99, 119, 206, 105, 108, 207, 79, 44, 61, 10, 179, 18, 7, 33, 15, 68, 204, 40, 214, 171, 223, 177, 98, 94, 176, 243, 165, 152, 231, 154, 1, 67, 226, 236, 109, 137, 202, 72, 234, 243, 23, 156, 41, 105, 118, 40, 72, 112, 147, 53, 76, 126, 158, 255, 145, 213, 214, 43, 241, 194, 125, 227, 104, 241, 196, 244, 237, 140, 214, 62, 210, 249, 207, 143, 58, 106, 182, 10, 75, 247, 114, 19, 127, 210, 217, 102, 190, 200, 149, 36, 59, 137, 204, 222, 223, 123, 63, 215, 84, 249, 49, 149, 83, 137, 205, 224, 192, 44, 166, 101, 109, 181, 98, 219, 17, 169, 186, 35, 11, 108, 131, 75, 185, 220, 58, 214, 129, 67, 15, 106, 220, 67, 76, 7, 247, 154, 201, 146, 25, 224, 51, 169, 180, 61, 73, 169, 216, 163, 64, 179, 144, 61, 184, 163, 163, 8, 113, 40, 42, 53, 46, 80, 50, 199, 156, 6, 138, 44, 86, 130, 12, 195, 251, 191, 99, 122, 127, 116, 155, 248, 205, 86, 172, 49, 197, 132, 101, 124, 32, 23, 225, 78, 252, 23, 182, 27, 10, 93, 135, 220, 98, 246, 62, 157, 134, 102, 1, 113, 244, 65, 39, 3, 106, 168, 22, 142, 16, 64, 140, 15, 80, 99, 35, 22, 179, 165, 166, 85, 100, 233, 90, 229, 18, 78, 92, 204, 255, 218, 224, 121, 218, 149, 146, 101, 90, 237, 209, 141, 172, 71, 193, 90, 175, 189, 165, 169, 88, 27, 15, 197, 225, 132, 32, 122, 215, 89, 92, 130, 175, 160, 186, 201, 20, 61, 64, 162, 133, 3, 43, 242, 1, 253, 252, 181, 136, 253, 218, 163, 130, 111, 36, 14, 133, 7, 219, 204, 145, 34, 32, 170, 193, 236, 151, 74, 74, 147, 76, 138, 107, 121, 122, 117, 158, 28, 246, 50, 255, 135, 138, 164, 17, 38, 164, 210, 75, 174, 116, 208, 146, 145, 163, 54, 161, 142, 104, 242, 253, 76, 97, 186, 92, 131, 69, 189, 217, 241, 225, 157, 78, 37, 78, 96, 220, 194, 3, 246, 214, 121, 178, 93, 26, 46, 165, 137, 4, 223, 97, 14, 94, 50, 52, 234, 50, 86, 69, 141, 165, 121, 202, 152, 37, 85, 22, 135, 212, 233, 30, 106, 208, 152, 10, 196, 23, 144, 2, 199, 18, 43, 47, 236, 83, 30, 54, 249, 7, 145, 116, 239, 36, 191, 115, 171, 101, 77, 39, 102, 167, 249, 152, 234, 193, 141, 24, 143, 254, 132, 241, 49, 221, 223, 189, 103, 12, 245, 20, 240, 213, 121, 152, 82, 69, 179, 192, 186, 6, 66, 56, 22, 22, 144, 240, 125, 87, 13, 248, 93, 108, 229, 245, 148, 14, 62, 131, 45, 100, 201, 63, 68, 118, 249, 66, 98, 132, 141, 74, 140, 20, 220, 81, 134, 141, 172, 190, 199, 149, 205, 93, 57, 45, 113, 240, 15, 161, 4, 122, 228, 28, 150, 220, 183, 88, 226, 51, 117, 6, 107, 122, 39, 165, 25, 15, 197, 199, 149, 157, 131, 214, 44, 253, 240, 247, 241, 139, 229, 232, 212, 218, 113, 23, 188, 132, 147, 250, 252, 14, 145, 7, 246, 101, 27, 190, 155, 27, 224, 20, 37, 63, 2, 54, 38, 5, 34, 186, 2, 107, 221, 161, 66, 248, 217, 63, 79, 202, 83, 53, 253, 127, 87, 252, 108, 133, 175, 14, 82, 140, 132, 150, 94, 234, 120, 120, 214, 32, 234, 53, 81, 60, 107, 255, 166, 188, 89, 153, 9, 173, 234, 85, 244, 11, 76, 217, 190, 22, 16, 147, 80, 23, 113, 126, 241, 84, 57, 134, 84, 152, 42, 97, 158, 176, 247, 138, 249, 54, 110, 103, 112, 170, 52, 238, 109, 27, 131, 137, 84, 37, 53, 162, 45, 12, 135, 228, 179, 197, 44, 163, 143, 33, 0, 125, 198, 45, 122, 93, 252, 148, 208, 163, 242, 99, 126, 195, 122, 247, 103, 141, 22, 208, 148, 113, 236, 210, 223, 57, 241, 128, 9, 40, 105, 207, 109, 69, 229, 204, 238, 98, 124, 100, 227, 17, 185, 226, 18, 119, 192, 50, 24, 98, 196, 187, 230, 224, 60, 191, 157, 41, 179, 95, 76, 153, 6, 217, 232, 93, 2, 110, 41, 148, 140, 203, 9, 156, 225, 174, 26, 16, 1, 182, 20, 242, 221, 114, 72, 21, 141, 226, 213, 200, 17, 198, 16, 100, 176, 216, 73, 240, 76, 6, 237, 78, 200, 119, 77, 39, 240, 158, 31, 148, 131, 187, 63, 232, 210, 64, 179, 250, 232, 53, 78, 40, 18, 89, 33, 39, 140, 209, 56, 112, 249, 146, 222, 7, 127, 161, 65, 146, 33, 146, 127, 56, 114, 32, 84, 80, 24, 112, 229, 230, 213, 94, 91, 148, 244, 109, 13, 157, 111, 51, 201, 173, 173, 66, 136, 150, 6, 111, 111, 154, 11, 17, 116, 13, 27, 209, 242, 59, 99, 21, 169, 222, 68, 72, 222, 164, 61, 217, 201, 53, 205, 33, 15, 141, 10, 80, 10, 215, 82, 125, 43, 165, 54, 184, 26, 151, 71, 203, 206, 50, 58, 57, 161, 52, 168, 22, 242, 179, 125, 111, 43, 91, 87, 3, 7, 126, 177, 54, 163, 148, 93, 255, 55, 124, 43, 141, 72, 166, 34, 147, 163, 135, 0, 50, 126, 152, 165, 1, 244, 118, 95, 96, 80, 4, 187, 206, 110, 239, 214, 183, 209, 125, 252, 40, 182, 126, 134, 2, 45, 182, 138, 179, 2, 102, 138, 101, 19, 92, 134, 39, 69, 120, 57, 190, 57, 130, 245, 73, 221, 23, 174, 183, 93, 28, 157, 42, 231, 217, 206, 139, 115, 38, 188, 129, 124, 12, 110, 89, 108, 132, 51, 142, 244, 135, 245, 251, 68, 128, 56, 218, 26, 248, 129, 34, 157, 167, 84, 138, 245, 95, 64, 172, 74, 9, 252, 17, 188, 73, 110, 229, 78, 230, 153, 231, 44, 191, 46, 126, 39, 241, 123, 223, 46, 47, 39, 69, 139, 118, 7, 184, 183, 166, 171, 61, 112, 200, 111, 196, 61, 123, 217, 188, 193, 102, 212, 105, 92, 0, 159, 27, 176, 74, 50, 250, 107, 68, 26, 196, 203, 239, 0, 42, 184, 35, 143, 14, 106, 172, 76, 147, 112, 100, 25, 215, 41, 170, 126, 95, 108, 218, 82, 36, 9, 116, 177, 182, 123, 254, 190, 56, 53, 125, 239, 66, 243, 145, 10, 61, 102, 57, 109, 197, 80, 159, 97, 253, 120, 48, 249, 97, 177, 2, 185, 153, 14, 201, 121, 165, 107, 133, 118, 248, 220, 68, 206, 96, 137, 154, 121, 215, 217, 189, 74, 76, 204, 222, 35, 222, 227, 83, 52, 77, 180, 122, 123, 184, 249, 212, 240, 22, 200, 136, 194, 206, 111, 120, 162, 253, 186, 155, 213, 149, 39, 97, 252, 132, 95, 70, 241, 47, 54, 19, 143, 188, 149, 148, 238, 161, 194, 121, 17, 93, 111, 133, 242, 201, 212, 183, 138, 152, 178, 37, 230, 140, 107, 137, 122, 163, 75, 5, 135, 225, 186, 32, 50, 131, 104, 197, 16, 87, 163, 180, 251, 170, 27, 181, 241, 85, 179, 126, 116, 219, 206, 79, 242, 5, 101, 41, 165, 80, 223, 66, 32, 68, 71, 88, 53, 117, 216, 209, 172, 112, 212, 129, 152, 49, 109, 61, 236, 79, 222, 156, 11, 239, 31, 202, 61, 123, 205, 58, 128, 7, 95, 27, 139, 135, 91, 119, 192, 187, 13, 99, 165, 103, 254, 140, 195, 234, 100, 79, 231, 154, 176, 233, 82, 214, 191, 60, 193, 53, 143, 213, 250, 131, 91, 40, 145, 225, 212, 106, 77, 201, 106, 185, 120, 141, 225, 195, 5, 110, 132, 235, 189, 95, 42, 90, 55, 194, 116, 222, 147, 91, 172, 175, 220, 232, 23, 95, 201, 4, 150, 102, 250, 23, 196, 86, 120, 28, 42, 188, 48, 46, 144, 66, 85, 124, 42, 187, 137, 212, 196, 230, 245, 111, 147, 204, 161, 63, 35, 100, 22, 144, 232, 208, 88, 101, 151, 10, 31, 210, 90, 1, 4, 202, 135, 120, 102, 81, 121, 189, 201, 44, 222, 209, 48, 188, 152, 108, 250, 65, 173, 13, 240, 1, 123, 109, 36, 163, 137, 172, 69, 250, 162, 10, 75, 89, 57, 102, 147, 77, 18, 93, 4, 104, 216, 225, 207, 229, 24, 57, 187, 228, 99, 218, 204, 58, 115, 44, 120, 209, 99, 200, 214, 156, 221, 139, 17, 131, 159, 164, 233, 160, 6, 2, 27, 15, 60, 204, 219, 18, 190, 164, 210, 203, 188, 34, 116, 36, 134, 101, 193, 75, 88, 189, 222, 245, 174, 203, 0, 199, 161, 57, 22, 4, 219, 77, 24, 36, 141, 70, 215, 219, 31, 92, 105, 10, 70, 102, 169, 244, 215, 230, 169, 88, 240, 157, 190, 5, 130, 186, 232, 76, 117, 45, 230, 181, 115, 67, 35, 172, 15, 165, 30, 125, 180, 57, 245, 25, 97, 244, 170, 182, 180, 107, 24, 231, 195, 140, 97, 50, 220, 220, 193, 196, 144, 49, 32, 90, 62, 206, 109, 85, 35, 135, 220, 249, 255, 78, 103, 207, 98, 156, 228, 213, 254, 22, 231, 247, 191, 152, 250, 37, 8, 172, 204, 136, 181, 30, 75, 9, 174, 226, 175, 172, 238, 237, 107, 27, 230, 46, 197, 240, 140, 162, 225, 65, 165, 249, 209, 49, 152, 19, 102, 96, 96, 206, 145, 40, 39, 155, 68, 8, 228, 176, 0, 112, 6, 27, 164, 12, 220, 185, 140, 95, 71, 202, 125, 234, 15, 246, 52, 206, 5, 103, 198, 6, 65, 12, 209, 87, 223, 121, 239, 124, 120, 128, 156, 194, 250, 239, 133, 247, 227, 76, 107, 73, 38, 228, 241, 33, 19, 61, 138, 70, 37, 45, 58, 239, 13, 176, 27, 17, 41, 202, 233, 62, 223, 175, 157, 36, 234, 192, 23, 180, 64, 61, 231, 103, 173, 83, 169, 241, 51, 201, 81, 67, 217, 79, 246, 203, 247, 233, 117, 253, 153, 252, 50, 54, 251, 120, 254, 215, 105, 168, 47, 128, 61, 139, 243, 91, 142, 166, 179, 26, 97, 65, 171, 167, 244, 114, 188, 192, 101, 23, 55, 115, 205, 222, 209, 59, 111, 83, 147, 188, 26, 163, 123, 244, 252, 98, 148, 104, 110, 81, 27, 167, 67, 200, 85, 251, 80, 163, 117, 36, 78, 137, 95, 34, 59, 163, 172, 164, 89, 247, 72, 64, 181, 41, 86, 255, 184, 158, 238, 185, 226, 70, 112, 123, 179, 3, 73, 1, 111, 110, 161, 49, 29, 112, 124, 244, 110, 238, 247, 14, 14, 76, 199, 159, 197, 179, 250, 244, 247, 85, 172, 56, 98, 70, 232, 99, 204, 226, 75, 121, 73, 239, 205, 191, 210, 74, 92, 4, 0, 234, 193, 196, 194, 173, 68, 44, 15, 40, 155, 166, 205, 197, 52, 207, 169, 123, 143, 5, 179, 234, 31, 202, 86, 56, 24, 233, 62, 121, 211, 133, 19, 209, 88, 32, 158, 85, 70, 85, 248, 249, 48, 225, 47, 86, 13, 128, 6, 140, 36, 31, 128, 58, 215, 176, 81, 129, 125, 172, 224, 209, 207, 246, 173, 207, 193, 22, 97, 60, 173, 183, 77, 253, 155, 18, 178, 36, 113, 186, 216, 70, 53, 47, 176, 176, 110, 88, 134, 81, 218, 164, 230, 45, 241, 27, 80, 100, 97, 7, 241, 118, 72, 200, 165, 187, 155, 190, 94, 40, 30, 205, 153, 71, 104, 141, 15, 220, 15, 153, 177, 200, 155, 239, 120, 101, 136, 17, 153, 255, 88, 163, 185, 221, 199, 216, 98, 69, 95, 59, 175, 164, 233, 253, 133, 225, 2, 156, 121, 93, 233, 11, 172, 164, 252, 66, 25, 59, 141, 195, 114, 131, 224, 50, 139, 227, 135, 240, 4, 171, 14, 206, 140, 207, 55, 211, 159, 135, 8, 193, 239, 233, 207, 53, 244, 238, 84, 19, 73, 1, 94, 104, 42, 148, 26, 3, 101, 198, 153, 239, 239, 34, 230, 253, 108, 6, 54, 59, 54, 252, 49, 86, 67, 90, 174, 196, 140, 239, 181, 64, 85, 11, 44, 9, 229, 249, 136, 72, 125, 199, 191, 242, 156, 145, 81, 70, 193, 44, 181, 133, 36, 211, 242, 30, 144, 244, 7, 89, 97, 98, 244, 61, 184, 3, 174, 101, 173, 221, 239, 145, 166, 225, 182, 82, 202, 76, 76, 150, 198, 93, 120, 100, 254, 47, 21, 168, 61, 38, 165, 48, 31, 76, 59, 37, 89, 106, 87, 203, 179, 248, 156, 162, 64, 50, 76, 5, 123, 113, 9, 215, 226, 23, 205, 44, 245, 117, 179, 251, 160, 106, 205, 130, 187, 253, 151, 224, 24, 32, 107, 210, 221, 62, 9, 133, 192, 119, 143, 232, 69, 204, 98, 5, 86, 121, 17, 245, 180, 249, 233, 48, 185, 56, 62, 20, 215, 140, 6, 220, 139, 44, 46, 180, 236, 215, 250, 81, 195, 254, 101, 135, 40, 135, 235, 141, 22, 183, 1, 31, 3, 89, 252, 87, 207, 58, 24, 161, 225, 28, 217, 174, 122, 71, 46, 100, 25, 85, 189, 177, 45, 185, 53, 210, 109, 222, 240, 244, 82, 75, 188, 17, 191, 45, 184, 220, 132, 105, 75, 151, 12, 5, 236, 148, 150, 10, 22, 199, 26, 143, 142, 159, 137, 87, 142, 70, 241, 67, 5, 15, 235, 87, 20, 224, 207, 210, 38, 60, 245, 34, 238, 108, 193, 204, 194, 179, 7, 131, 158, 63, 245, 255, 95, 34, 247, 63, 100, 39, 85, 51, 182, 220, 69, 125, 88, 223, 39, 160, 176, 115, 100, 232, 150, 20, 40, 205, 132, 231, 201, 97, 40, 66, 207, 53, 195, 39, 59, 4, 191, 140, 210, 66, 46, 104, 196, 64, 35, 22, 151, 210, 88, 220, 108, 96, 95, 175, 97, 70, 25, 90, 111, 112, 123, 106, 204, 22, 59, 106, 248, 232, 178, 149, 32, 36, 16, 254, 191, 202, 95, 177, 177, 116, 95, 213, 205, 170, 254, 96, 184, 233, 166, 10, 156, 95, 254, 105, 205, 55, 158, 61, 129, 215, 98, 230, 107, 3, 63, 157, 155, 207, 247, 157, 79, 254, 138, 189, 94, 248, 244, 152, 167, 111, 16, 202, 234, 81, 38, 253, 1, 180, 210, 24, 89, 184, 252, 85, 6, 35, 223, 9, 34, 83, 254, 224, 69, 138, 199, 37, 90, 24, 21, 136, 15, 51, 50, 30, 54, 216, 227, 156, 117, 242, 100, 52, 163, 89, 33, 164, 98, 17, 89, 176, 21, 155, 15, 146, 216, 86, 117, 168, 3, 121, 75, 252, 116, 80, 199, 162, 215, 74, 4, 31, 118, 186, 206, 249, 116, 221, 99, 65, 54, 33, 13, 78, 210, 35, 210, 53, 122, 190, 198, 221, 183, 134, 204, 79, 8, 25, 210, 188, 253, 85, 201, 46, 250, 3, 232, 208, 37, 12, 223, 72, 151, 148, 238, 168, 204, 252, 31, 1, 28, 118, 248, 170, 149, 73, 59, 32, 202, 101, 151, 15, 8, 189, 163, 217, 141, 150, 116, 65, 129, 166, 147, 54, 1, 66, 214, 228, 77, 76, 12, 105, 1, 82, 129, 123, 28, 50, 106, 239, 115, 189, 81, 165, 89, 64, 162, 72, 173, 162, 12, 143, 161, 42, 195, 52, 49, 79, 130, 231, 207, 125, 113, 21, 43, 184, 120, 97, 79, 162, 36, 125, 204, 253, 23, 235, 22, 87, 250, 129, 46, 51, 140, 184, 122, 5, 176, 91, 77, 121, 99, 94, 246, 217, 247, 181, 100, 190, 81, 43, 71, 97, 216, 82, 144, 50, 215, 72, 88, 136, 202, 167, 146, 20, 108, 111, 48, 8, 128, 77, 59, 179, 227, 116, 102, 106, 170, 123, 183, 150, 15, 20, 226, 177, 244, 199, 210, 225, 96, 11, 232, 230, 107, 230, 92, 88, 7, 200, 250, 162, 143, 245, 215, 194, 174, 126, 31, 145, 211, 158, 210, 125, 222, 86, 80, 105, 207, 96, 197, 240, 16, 121, 229, 16, 43, 32, 18, 97, 116, 249, 105, 53, 10, 109, 163, 226, 90, 43, 205, 27, 190, 20, 75, 5, 119, 97, 81, 100, 236, 30, 13, 42, 30, 148, 237, 225, 149, 35, 17, 17, 5, 142, 35, 250, 215, 197, 155, 17, 111, 145, 129, 53, 57, 0, 200, 249, 89, 176, 189, 1, 116, 36, 15, 140, 182, 95, 214, 143, 116, 235, 82, 165, 53, 192, 181, 183, 131, 106, 5, 142, 35, 31, 235, 177, 90, 203, 121, 167, 216, 165, 33, 47, 225, 21, 227, 222, 235, 82, 74, 195, 197, 215, 79, 205, 108, 145, 185, 88, 224, 207, 185, 43, 148, 199, 55, 206, 55, 53, 36, 83, 228, 15, 155, 240, 52, 139, 36, 169, 202, 140, 11, 148, 201, 100, 116, 5, 4, 93, 209, 255, 14, 104, 27, 30, 138, 224, 182, 136, 68, 27, 18, 127, 61, 231, 13, 79, 211, 129, 170, 83, 133, 121, 42, 201, 91, 161, 157, 93, 92, 228, 230, 85, 42, 72, 252, 142, 85, 49, 49, 90, 248, 105, 64, 101, 17, 183, 104, 71, 66, 88, 231, 243, 185, 127, 109, 96, 16, 144, 67, 137, 142, 51, 15, 176, 229, 195, 244, 121, 225, 235, 1, 47, 26, 187, 199, 29, 84, 42, 209, 192, 23, 24, 66, 139, 105, 59, 42, 98, 42, 59, 121, 42, 19, 252, 216, 83, 170, 15, 153, 227, 209, 242, 192, 84, 127, 225, 7, 106, 52, 122, 11, 197, 13, 114, 196, 194, 67, 217, 106, 201, 9, 33, 188, 44, 80, 156, 138, 13, 234, 189, 29, 240, 190, 247, 231, 194, 113, 145, 182, 63, 184, 81, 203, 88, 173, 43, 148, 126, 63, 55, 30, 179, 169, 8, 4, 211, 7, 73, 48, 152, 169, 65, 139, 239, 39, 42, 66, 67, 209, 4, 20, 102, 193, 58, 22, 155, 229, 248, 233, 99, 238, 62, 173, 71, 56, 43, 153, 129, 253, 161, 69, 87, 94, 50, 53, 1, 18, 167, 179, 253, 232, 5, 244, 180, 73, 202, 206, 199, 177, 156, 168, 144, 156, 112, 247, 187, 93, 121, 233, 149, 16, 80, 145, 67, 175, 57, 252, 185, 218, 56, 13, 0, 164, 160, 84, 19, 68, 168, 14, 89, 77, 225, 2, 14, 83, 124, 56, 55, 162, 229, 39, 196, 249, 27, 240, 90, 133, 241, 237, 79, 169, 233, 173, 143, 255, 36, 249, 166, 116, 116, 177, 216, 149, 224, 26, 64, 44, 177, 25, 5, 253, 13, 50, 65, 237, 15, 138, 43, 95, 108, 20, 129, 184, 138, 121, 110, 240, 91, 12, 102, 187, 183, 232, 196, 253, 140, 90, 174, 171, 9, 150, 159, 88, 97, 56, 227, 158, 92, 227, 209, 227, 137, 248, 248, 182, 167, 229, 110, 188, 85, 30, 74, 7, 72, 99, 106, 178, 181, 90, 248, 101, 59, 184, 64, 26, 188, 1, 76, 145, 191, 118, 78, 161, 90, 157, 108, 121, 235, 154, 90, 112, 236, 204, 226, 67, 193, 204, 136, 84, 224, 47, 165, 0, 44, 46, 226, 144, 113, 146, 133, 73, 73, 101, 61, 49, 183, 45, 136, 209, 10, 185, 207, 24, 241, 253, 134, 113, 248, 233, 113, 75, 161, 177, 2, 66, 216, 62, 176, 59, 4, 163, 90, 175, 96, 238, 243, 195, 62, 32, 61, 225, 75, 178, 126, 96, 109, 122, 231, 239, 180, 196, 203, 20, 193, 0, 203, 49, 146, 34, 127, 250, 192, 204, 89, 255, 86, 9, 155, 120, 161, 237, 64, 148, 50, 54, 120, 95, 190, 121, 93, 65, 125, 191, 202, 190, 16, 112, 191, 77, 28, 125, 90, 84, 128, 7, 218, 251, 177, 71, 144, 162, 60, 43, 217, 255, 49, 53, 101, 131, 42, 192, 64, 123, 188, 33, 217, 147, 248, 63, 75, 61, 69, 149, 248, 90, 112, 148, 132, 15, 114, 114, 66, 235, 198, 222, 166, 108, 140, 172, 248, 14, 252, 63, 158, 153, 145, 61, 115, 160, 194, 30, 202, 34, 18, 158, 139, 132, 175, 73, 77, 36, 10, 85, 156, 180, 44, 92, 245, 67, 124, 21, 55, 3, 181, 208, 16, 78, 144, 45, 150, 153, 171, 99, 203, 120, 102, 144, 205, 149, 16, 168, 245, 60, 67, 171, 105, 163, 74, 101, 197, 243, 77, 206, 187, 79, 125, 54, 232, 50, 99, 60, 209, 21, 224, 203, 240, 54, 5, 64, 190, 113, 52, 43, 114, 153, 57, 24, 246, 249, 67, 5, 116, 108, 167, 24, 152, 157, 145, 145, 184, 135, 9, 21, 19, 40, 208, 87, 254, 48, 249, 255, 162, 39, 75, 119, 20, 188, 245, 166, 23, 134, 69, 64, 7, 242, 184, 89, 17, 166, 36, 158, 76, 105, 235, 212, 75, 14, 179, 168, 51, 204, 42, 50, 187, 5, 118, 76, 173, 58, 155, 172, 195, 168, 44, 28, 129, 9, 188, 8, 114, 79, 57, 233, 150, 175, 36, 213, 59, 176, 207, 25, 10, 148, 80, 3, 116, 14, 120, 161, 233, 250, 36, 212, 116, 26, 203, 37, 129, 42, 24, 65, 190, 157, 65, 193, 132, 195, 181, 27, 125, 161, 237, 17, 53, 203, 32, 29, 134, 120, 218, 120, 84, 139, 39, 121, 244, 190, 167, 179, 165, 113, 169, 219, 31, 137, 86, 15, 43, 237, 99, 71, 43, 151, 167, 221, 182, 112, 157, 111, 40, 91, 133, 17, 87, 222, 83, 221, 39, 188, 149, 51, 45, 135, 104, 27, 148, 246, 248, 28, 160, 219, 125, 198, 41, 151, 206, 26, 167, 167, 94, 41, 105, 251, 4, 35, 251, 166, 1, 111, 156, 209, 126, 39, 93, 105, 234, 197, 64, 185, 177, 48, 182, 153, 99, 34, 27, 109, 126, 192, 183, 20, 117, 131, 209, 93, 37, 71, 96, 87, 4, 183, 52, 16, 4, 125, 12, 53, 9, 76, 104, 151, 170, 9, 186, 74, 152, 140, 173, 231, 52, 113, 11, 115, 6, 75, 62, 208, 192, 102, 71, 112, 204, 74, 206, 20, 82, 5, 153, 16, 194, 186, 179, 190, 170, 219, 251, 109, 24, 88, 223, 137, 185, 190, 217, 168, 80, 101, 210, 105, 223, 115, 124, 71, 91, 192, 48, 42, 206, 220, 14, 48, 3, 232, 99, 51, 247, 39, 146, 151, 148, 230, 92, 113, 123, 184, 124, 169, 55, 5, 249, 226, 156, 86, 81, 167, 144, 164, 169, 73, 241, 61, 56, 20, 247, 116, 172, 147, 170, 3, 6, 80, 189, 3, 220, 11, 62, 56, 129, 179, 145, 205, 91, 46, 65, 29, 114, 184, 208, 118, 239, 103, 33, 224, 177, 109, 150, 19, 19, 100, 136, 166, 97, 101, 168, 9, 7, 29, 143, 169, 93, 186, 76, 23, 3, 227, 93, 240, 235, 94, 195, 2, 46, 188, 75, 37, 252, 60, 62, 186, 250, 143, 133, 96, 127, 208, 127, 55, 176, 247, 232, 99, 196, 99, 197, 107, 162, 234, 47, 109, 27, 121, 66, 73, 160, 1, 52, 29, 72, 89, 252, 231, 65, 236, 250, 198, 186, 129, 21, 102, 98, 57, 20, 184, 221, 174, 48, 37, 11, 185, 123, 187, 102, 78, 92, 3, 69, 161, 222, 33, 150, 250, 117, 85, 118, 111, 4, 145, 242, 62, 255, 27, 48, 72, 87, 253, 32, 157, 130, 68, 63, 224, 223, 227, 29, 217, 177, 173, 61, 206, 34, 14, 205, 70, 161, 224, 28, 131, 197, 203, 105, 33, 178, 131, 144, 186, 147, 119, 167, 172, 7, 116, 52, 214, 52, 191, 16, 20, 138, 241, 150, 60, 17, 30, 90, 22, 144, 187, 227, 163, 134, 176, 66, 121, 14, 1, 232, 99, 93, 57, 25, 113, 177, 243, 126, 46, 49, 0, 67, 207, 198, 255, 38, 164, 52, 221, 52, 220, 90, 196, 191, 73, 33, 136, 99, 74, 195, 31, 231, 194, 199, 182, 140, 82, 157, 188, 8, 12, 81, 84, 107, 2, 2, 35, 89, 168, 58, 130, 16, 60, 88, 163, 212, 87, 132, 194, 194, 63, 187, 98, 243, 115, 64, 245, 175, 9, 218, 0, 32, 210, 197, 40, 166, 44, 15, 234, 238, 33, 153, 224, 250, 120, 51, 0, 227, 120, 219, 44, 30, 86, 64, 104, 234, 171, 137, 78, 125, 204, 253, 60, 134, 211, 218, 47, 15, 145, 50, 231, 108, 143, 126, 99, 80, 109, 242, 211, 146, 142, 83, 22, 234, 150, 48, 123, 227, 52, 208, 213, 137, 83, 217, 82, 43, 155, 212, 230, 162, 139, 107, 243, 220, 45, 253, 220, 250, 97, 103, 239, 54, 14, 22, 131, 74, 171, 99, 219, 98, 40, 216, 176, 158, 82, 250, 106, 254, 2, 99, 49, 56, 168, 119, 184, 140, 182, 116, 186, 29, 103, 223, 20, 9, 95, 6, 36, 28, 134, 90, 8, 57, 65, 158, 33, 238, 155, 61, 210, 236, 126, 109, 144, 252, 222, 44, 104, 106, 212, 140, 195, 31, 222, 141, 131, 55, 1, 160, 236, 52, 155, 170, 173, 154, 85, 238, 6, 154, 93, 244, 172, 20, 207, 3, 249, 143, 52, 22, 77, 100, 14, 227, 254, 35, 66, 27, 37, 222, 98, 7, 22, 145, 202, 214, 116, 214, 33, 222, 138, 32, 154, 51, 86, 104, 119, 28, 107, 68, 13, 217, 155, 196, 223, 205, 180, 94, 22, 149, 156, 167, 202, 45, 125, 37, 105, 207, 145, 26, 162, 155, 167, 7, 155, 51, 201, 3, 72, 182, 154, 209, 14, 197, 215, 140, 114, 186, 121, 172, 94, 77, 16, 142, 0, 103, 184, 23, 29, 55, 101, 211, 60, 229, 54, 78, 121, 246, 79, 212, 96, 239, 52, 182, 132, 42, 214, 208, 28, 48, 252, 79, 113, 145, 90, 110, 46, 145, 190, 80, 63, 166, 210, 77, 34, 111, 125, 51, 102, 10, 3, 194, 209, 9, 160, 15, 155, 36, 235, 142, 252, 125, 174, 44, 186, 78, 171, 54, 62, 14, 227, 191, 192, 234, 43, 84, 99, 96, 201, 1, 12, 101, 98, 237, 12, 249, 186, 148, 221, 17, 209, 11, 181, 148, 166, 177, 44, 162, 16, 85, 35, 214, 85, 114, 100, 249, 76, 82, 74, 70, 30, 146, 99, 230, 15, 157, 117, 154, 219, 131, 163, 193, 175, 216, 30, 147, 176, 224, 116, 82, 144, 224, 131, 249, 50, 247, 196, 237, 65, 178, 102, 105, 252, 20, 31, 166, 17, 217, 207, 140, 216, 254, 123, 59, 77, 17, 111, 98, 168, 210, 237, 76, 110, 107, 16, 100, 40, 46, 208, 81, 201, 160, 52, 137, 25, 180, 136, 37, 214, 173, 172, 95, 113, 210, 195, 95, 222, 172, 118, 119, 189, 98, 253, 123, 107, 18, 98, 111, 201, 224, 197, 109, 136, 150, 149, 5, 87, 124, 188, 37, 201, 73, 198, 26, 6, 62, 134, 188, 136, 206, 126, 101, 46, 234, 17, 202, 47, 135, 223, 57, 59, 53, 114, 38, 89, 31, 1, 76, 76, 238, 143, 11, 190, 30, 76, 230, 46, 162, 51, 0, 186, 207, 126, 107, 219, 156, 18, 104, 247, 158, 244, 145, 20, 84, 31, 68, 141, 55, 190, 221, 105, 102, 56, 81, 154, 125, 71, 123, 126, 236, 179, 81, 231, 220, 167, 119, 206, 115, 106, 59, 166, 166, 3, 137, 43, 56, 32, 5, 45, 215, 145, 162, 47, 148, 234, 114, 18, 3, 166, 248, 209, 117, 192, 103, 35, 83, 79, 19, 212, 230, 12, 128, 214, 142, 148, 173, 234, 212, 62, 78, 144, 8, 141, 63, 252, 255, 188, 27, 191, 132, 53, 215, 220, 19, 191, 75, 253, 145, 230, 122, 156, 115, 250, 73, 171, 210, 22, 233, 244, 91, 58, 47, 75, 68, 116, 182, 98, 182, 75, 66, 36, 159, 64, 205, 176, 102, 50, 237, 38, 107, 148, 58, 61, 64, 1, 249, 68, 75, 235, 104, 25, 228, 147, 233, 46, 25, 190, 118, 196, 34, 39, 1, 60, 201, 67, 77, 64, 9, 43, 0, 150, 41, 73, 57, 254, 211, 96, 93, 129, 231, 63, 12, 177, 106, 238, 70, 73, 87, 251, 7, 254, 51, 212, 34, 34, 137, 127, 209, 207, 70, 60, 68, 71, 74, 208, 119, 211, 153, 100, 173, 21, 178, 95, 113, 6, 103, 244, 204, 200, 141, 58, 156, 13, 21, 109, 169, 215, 206, 184, 10, 248, 214, 219, 2, 22, 108, 37, 247, 157, 102, 167, 253, 142, 139, 177, 62, 243, 59, 147, 69, 231, 150, 123, 177, 231, 224, 33, 29, 75, 184, 115, 143, 218, 4, 10, 125, 35, 50, 201, 143, 44, 175, 108, 206, 247, 152, 81, 249, 135, 221, 23, 132, 80, 104, 24, 6, 10, 208, 155, 97, 45, 9, 52, 29, 232, 152, 176, 75, 242, 241, 111, 128, 127, 144, 96, 159, 171, 73, 250, 52, 163, 43, 158, 232, 89, 227, 65, 219, 151, 153, 227, 61, 46, 232, 177, 170, 203, 237, 9, 253, 225, 222, 224, 200, 86, 146, 180, 104, 8, 15, 189, 184, 94, 177, 36, 57, 170, 206, 62, 47, 152, 67, 77, 106, 10, 26, 180, 44, 124, 175, 5, 81, 96, 215, 143, 142, 152, 61, 2, 81, 216, 66, 142, 216, 71, 8, 175, 245, 51, 144, 186, 166, 28, 230, 64, 159, 150, 90, 249, 65, 151, 10, 136, 91, 38, 146, 1, 243, 23, 141, 224, 125, 108, 4, 166, 186, 241, 55, 10, 202, 251, 230, 96, 252, 248, 197, 48, 29, 239, 129, 204, 184, 15, 10, 89, 130, 175, 144, 59, 155, 33, 171, 121, 32, 19, 252, 109, 220, 191, 115, 237, 37, 243, 233, 121, 122, 90, 250, 66, 142, 44, 35, 203, 218, 145, 243, 140, 28, 161, 213, 153, 231, 76, 138, 76, 251, 151, 7, 11, 64, 193, 73, 230, 191, 196, 153, 83, 5, 94, 107, 104, 1, 65, 203, 149, 153, 209, 76, 82, 60, 0, 21, 153, 63, 172, 119, 106, 223, 51, 212, 244, 144, 25, 25, 126, 216, 9, 93, 42, 46, 188, 134, 154, 195, 84, 46, 126, 128, 136, 111, 21, 90, 103, 219, 198, 39, 161, 53, 255, 151, 213, 105, 135, 115, 226, 94, 28, 48, 252, 80, 33, 60, 213, 206, 247, 191, 175, 195, 227, 118, 54, 185, 205, 195, 248, 11, 238, 202, 13, 236, 38, 182, 1, 1, 51, 111, 190, 234, 249, 87, 189, 234, 35, 148, 226, 72, 131, 77, 249, 214, 48, 36, 116, 58, 228, 77, 168, 222, 190, 115, 193, 157, 174, 213, 105, 120, 23, 98, 134, 22, 205, 150, 192, 202, 128, 65, 128, 85, 254, 99, 135, 227, 170, 80, 96, 234, 225, 173, 172, 156, 179, 234, 81, 185, 34, 227, 155, 41, 242, 244, 138, 148, 58, 255, 232, 63, 146, 184, 233, 157, 105, 206, 181, 53, 42, 165, 59, 77, 71, 206, 219, 169, 168, 246, 61, 114, 171, 147, 22, 101, 218, 92, 93, 58, 103, 80, 240, 152, 80, 137, 179, 181, 175, 203, 245, 111, 231, 4, 41, 158, 94, 224, 189, 172, 122, 97, 92, 93, 126, 47, 229, 239, 52, 225, 102, 38, 25, 61, 196, 121, 227, 94, 27, 148, 133, 61, 98, 247, 7, 82, 187, 159, 106, 74, 51, 245, 171, 42, 69, 188, 227, 34, 178, 136, 210, 137, 62, 86, 101, 8, 204, 106, 6, 234, 105, 133, 51, 69, 50, 164, 84, 182, 73, 94, 107, 10, 134, 19, 165, 111, 191, 145, 238, 0, 8, 188, 57, 123, 185, 132, 9, 169, 43, 215, 92, 74, 108, 176, 219, 88, 26, 227, 255, 172, 198, 175, 40, 106, 120, 227, 148, 24, 151, 195, 121, 182, 70, 177, 251, 105, 27, 168, 16, 142, 207, 176, 74, 47, 217, 161, 139, 28, 60, 228, 196, 246, 233, 249, 184, 212, 36, 196, 96, 125, 79, 197, 37, 17, 133, 251, 89, 226, 187, 232, 38, 238, 158, 183, 92, 96, 35, 3, 28, 247, 68, 111, 103, 174, 110, 81, 164, 146, 165, 195, 219, 114, 27, 207, 83, 255, 253, 126, 88, 242, 198, 111, 102, 218, 249, 114, 9, 153, 221, 223, 176, 188, 88, 17, 208, 46, 178, 238, 36, 253, 109, 224, 222, 79, 154, 125, 18, 200, 101, 116, 57, 1, 129, 97, 201, 151, 111, 183, 222, 140, 135, 114, 156, 95, 84, 178, 241, 159, 177, 112, 62, 25, 125, 115, 232, 102, 251, 62, 203, 14, 5, 150, 92, 99, 241, 219, 53, 250, 69, 48, 65, 141, 243, 130, 124, 225, 30, 176, 59, 17, 175, 145, 254, 49, 241, 235, 137, 226, 136, 42, 0, 251, 160, 205, 156, 192, 10, 9, 85, 55, 14, 59, 38, 172, 192, 24, 221, 66, 54, 237, 238, 147, 90, 228, 189, 22, 9, 220, 164, 100, 218, 76, 176, 128, 184, 136, 152, 252, 67, 162, 227, 119, 133, 5, 15, 108, 130, 165, 211, 24, 19, 34, 74, 234, 209, 206, 203, 5, 232, 5, 133, 92, 251, 111, 242, 81, 57, 100, 12, 116, 139, 189, 113, 167, 141, 181, 174, 47, 10, 105, 237, 10, 170, 195, 140, 245, 184, 206, 44, 7, 175, 182, 148, 159, 209, 239, 141, 192, 194, 7, 189, 225, 93, 37, 161, 90, 81, 167, 97, 32, 161, 12, 147, 110, 81, 128, 14, 78, 146, 252, 19, 252, 221, 57, 196, 233, 98, 192, 166, 49, 199, 150, 96, 30, 247, 169, 183, 252, 210, 201, 226, 23, 114, 193, 229, 123, 251, 93, 187, 191, 44, 195, 214, 222, 243, 9, 180, 215, 34, 89, 67, 220, 162, 195, 200, 67, 126, 247, 59, 142, 35, 82, 238, 128, 25, 51, 135, 152, 238, 100, 52, 59, 118, 152, 147, 111, 133, 138, 41, 196, 210, 24, 241, 10, 35, 73, 163, 94, 97, 181, 32, 144, 24, 172, 191, 205, 12, 25, 230, 108, 130, 138, 248, 164, 98, 141, 92, 99, 56, 180, 192, 55, 63, 70, 173, 164, 57, 26, 95, 135, 243, 255, 159, 211, 163, 47, 128, 71, 155, 98, 187, 81, 159, 191, 1, 55, 225, 241, 16, 174, 240, 168, 122, 37, 40, 97, 207, 157, 157, 176, 7, 252, 81, 133, 214, 128, 83, 249, 33, 72, 143, 4, 87, 8, 197, 231, 21, 222, 74, 138, 132, 149, 108, 102, 24, 221, 154, 83, 187, 80, 31, 7, 63, 116, 180, 169, 84, 202, 18, 188, 14, 118, 98, 166, 75, 244, 10, 1, 219, 79, 105, 163, 0, 249, 253, 96, 86, 201, 39, 97, 83, 83, 174, 48, 249, 73, 39, 191, 208, 168, 34, 67, 151, 254, 16, 18, 135, 92, 157, 224, 225, 41, 254, 45, 203, 41, 197, 216, 141, 15, 210, 33, 219, 67, 189, 220, 69, 50, 19, 79, 43, 75, 122, 1, 93, 44, 65, 197, 15, 29, 234, 39, 175, 233, 136, 5, 65, 123, 116, 109, 136, 63, 92, 59, 31, 158, 1, 40, 219, 158, 94, 39, 236, 207, 198, 124, 247, 209, 150, 168, 146, 27, 164, 80, 109, 251, 220, 101, 150, 29, 142, 44, 199, 71, 232, 27, 36, 118, 69, 230, 84, 26, 172, 252, 227, 46, 19, 35, 168, 239, 5, 15, 220, 128, 95, 212, 106, 205, 242, 56, 128, 9, 20, 28, 24, 33, 11, 177, 244, 110, 237, 131, 233, 183, 223, 121, 115, 90, 225, 223, 160, 83, 66, 136, 70, 58, 153, 13, 104, 136, 207, 39, 234, 129, 140, 247, 219, 176, 72, 120, 211, 185, 133, 118, 131, 212, 59, 186, 178, 199, 228, 54, 231, 97, 187, 224, 97, 237, 206, 215, 9, 22, 12, 12, 147, 21, 38, 165, 78, 149, 245, 145, 118, 103, 245, 129, 120, 5, 142, 49, 0, 211, 224, 239, 77, 114, 48, 172, 158, 171, 19, 224, 201, 82, 218, 78, 168, 91, 134, 15, 40, 187, 114, 42, 26, 8, 142, 211, 61, 233, 8, 155, 177, 147, 149, 232, 160, 1, 177, 135, 245, 144, 69, 22, 157, 156, 200, 109, 133, 201, 157, 212, 254, 134, 213, 191, 255, 101, 255, 20, 235, 105, 62, 221, 210, 159, 64, 246, 136, 181, 60, 41, 149, 129, 224, 46, 79, 173, 136, 105, 125, 192, 244, 16, 236, 172, 194, 247, 136, 160, 191, 219, 24, 101, 151, 204, 189, 254, 69, 160, 79, 84, 149, 43, 108, 90, 65, 16, 75, 49, 182, 29, 211, 188, 135, 145, 131, 108, 143, 97, 95, 38, 38, 244, 117, 92, 157, 91, 38, 118, 118, 134, 108, 123, 83, 215, 239, 228, 186, 45, 112, 202, 166, 127, 199, 80, 183, 251, 112, 113, 237, 49, 148, 92, 31, 54, 242, 208, 12, 47, 101, 74, 79, 19, 78, 122, 60, 125, 85, 133, 3, 52, 123, 236, 60, 62, 178, 101, 111, 91, 89, 228, 63, 62, 116, 53, 148, 71, 46, 153, 133, 244, 59, 87, 117, 171, 67, 182, 119, 3, 204, 215, 205, 128, 248, 11, 59, 34, 15, 115, 249, 177, 240, 198, 58, 52, 23, 101, 132, 118, 39, 181, 199, 49, 39, 98, 196, 23, 179, 199, 62, 65, 165, 246, 218, 161, 150, 163, 253, 94, 124, 215, 10, 245, 71, 135, 168, 59, 251, 229, 157, 39, 75, 179, 211, 83, 33, 172, 81, 2, 30, 222, 174, 66, 80, 11, 196, 187, 123, 255, 127, 187, 208, 236, 106, 88, 54, 93, 253, 37, 33, 155, 82, 26, 156, 57, 87, 148, 130, 44, 84, 207, 171, 200, 131, 82, 28, 61, 122, 155, 114, 160, 253, 29, 177, 50, 168, 100, 73, 18, 132, 92, 136, 67, 24, 156, 149, 164, 120, 109, 130, 170, 156, 164, 248, 104, 83, 152, 231, 211, 100, 78, 59, 170, 147, 101, 86, 254, 127, 143, 124, 178, 232, 35, 35, 243, 3, 220, 198, 182, 146, 71, 250, 50, 61, 152, 253, 101, 219, 219, 159, 58, 34, 239, 111, 144, 29, 8, 99, 24, 212, 123, 176, 171, 0, 132, 253, 35, 140, 166, 157, 68, 215, 217, 105, 78, 224, 18, 118, 216, 79, 227, 101, 59, 153, 27, 217, 243, 250, 193, 213, 100, 184, 69, 78, 229, 7, 144, 107, 5, 214, 223, 139, 123, 44, 140, 165, 131, 215, 65, 77, 181, 143, 101, 218, 198, 87, 47, 191, 10, 102, 231, 0, 239, 23, 128, 83, 11, 218, 62, 104, 185, 73, 211, 216, 40, 70, 231, 92, 187, 172, 255, 66, 159, 93, 156, 35, 172, 123, 2, 230, 123, 236, 241, 154, 88, 136, 179, 147, 174, 89, 50, 5, 158, 169, 128, 127, 215, 231, 82, 83, 159, 66, 241, 205, 103, 143, 20, 248, 239, 143, 31, 210, 249, 39, 25, 8, 8, 242, 111, 111, 188, 35, 190, 251, 17, 114, 164, 49, 24, 113, 159, 50, 115, 56, 190, 180, 91, 125, 237, 99, 116, 211, 36, 208, 115, 12, 73, 61, 99, 110, 81, 64, 83, 163, 131, 154, 211, 9, 165, 11, 30, 177, 177, 43, 241, 7, 108, 203, 224, 75, 25, 246, 160, 33, 148, 32, 131, 183, 190, 0, 219, 28, 208, 242, 134, 174, 91, 92, 51, 36, 240, 43, 139, 147, 101, 183, 51, 216, 249, 42, 166, 52, 133, 115, 249, 6, 240, 23, 27, 23, 77, 180, 40, 175, 240, 173, 104, 70, 137, 83, 82, 171, 155, 215, 136, 131, 4, 172, 19, 100, 255, 146, 160, 199, 128, 177, 130, 163, 56, 104, 107, 102, 44, 178, 196, 187, 0, 38, 53, 230, 191, 148, 218, 207, 105, 66, 106, 103, 52, 241, 119, 233, 63, 63, 182, 45, 101, 61, 210, 89, 175, 101, 98, 89, 172, 252, 236, 36, 54, 143, 131, 55, 35, 189, 128, 57, 73, 34, 229, 250, 206, 253, 43, 37, 53, 136, 172, 73, 221, 27, 205, 207, 21, 120, 92, 6, 220, 166, 66, 95, 45, 241, 209, 112, 72, 22, 31, 221, 232, 220, 157, 248, 78, 105, 214, 230, 41, 193, 211, 46, 249, 26, 11, 242, 42, 225, 116, 207, 166, 141, 116, 185, 223, 86, 218, 190, 255, 185, 250, 199, 181, 56, 188, 132, 37, 27, 85, 248, 112, 161, 182, 164, 153, 129, 40, 37, 13, 8, 67, 236, 36, 182, 151, 130, 96, 131, 65, 26, 103, 239, 65, 243, 234, 162, 7, 90, 237, 24, 99, 145, 47, 181, 99, 65, 38, 36, 112, 157, 239, 225, 127, 161, 168, 6, 66, 231, 252, 142, 154, 225, 138, 189, 243, 66, 142, 71, 61, 239, 55, 230, 59, 40, 224, 134, 104, 100, 189, 166, 249, 66, 91, 146, 154, 28, 67, 78, 138, 40, 114, 71, 172, 3, 168, 233, 9, 106, 228, 143, 56, 193, 227, 243, 144, 51, 222, 94, 224, 43, 79, 149, 212, 245, 52, 68, 200, 17, 235, 45, 164, 147, 62, 118, 52, 216, 195, 78, 13, 66, 190, 188, 241, 142, 234, 182, 85, 48, 148, 214, 123, 57, 223, 188, 229, 119, 169, 180, 193, 70, 250, 215, 249, 29, 88, 123, 88, 226, 210, 171, 170, 32, 80, 85, 3, 26, 219, 109, 97, 134, 11, 96, 118, 71, 130, 86, 182, 77, 116, 137, 214, 28, 140, 242, 227, 178, 167, 200, 214, 175, 107, 96, 132, 33, 40, 64, 93, 206, 90, 129, 132, 221, 170, 242, 113, 235, 251, 172, 193, 35, 58, 85, 70, 9, 75, 104, 71, 161, 99, 214, 6, 33, 204, 250, 172, 199, 33, 183, 246, 250, 109, 251, 50, 106, 114, 16, 134, 150, 19, 219, 21, 60, 63, 251, 204, 157, 45, 106, 233, 133, 154, 145, 135, 201, 77, 59, 178, 176, 217, 109, 236, 19, 19, 200, 5, 165, 235, 81, 14, 42, 153, 40, 189, 86, 92, 90, 239, 77, 53, 136, 65, 112, 94, 130, 104, 71, 55, 79, 22, 250, 34, 178, 14, 91, 24, 145, 250, 4, 197, 96, 72, 118, 142, 31, 83, 137, 14, 57, 115, 36, 202, 144, 10, 19, 123, 176, 23, 93, 35, 90, 145, 73, 163, 124, 66, 156, 8, 82, 243, 22, 204, 59, 77, 49, 222, 1, 246, 7, 75, 15, 234, 110, 9, 232, 29, 156, 239, 250, 88, 24, 244, 123, 15, 169, 66, 180, 254, 210, 233, 134, 27, 100, 162, 103, 158, 223, 149, 226, 167, 140, 53, 34, 57, 105, 221, 112, 116, 72, 207, 169, 98, 200, 189, 33, 72, 181, 162, 166, 4, 29, 98, 157, 184, 244, 188, 127, 186, 35, 186, 202, 24, 21, 185, 160, 63, 17, 112, 78, 96, 49, 87, 60, 154, 215, 49, 196, 179, 122, 60, 253, 154, 86, 177, 227, 70, 1, 80, 205, 58, 66, 103, 146, 170, 108, 34, 134, 149, 134, 160, 225, 152, 63, 18, 199, 101, 158, 199, 235, 124, 98, 105, 8, 62, 100, 92, 248, 81, 59, 108, 190, 156, 216, 106, 103, 90, 69, 199, 160, 21, 66, 203, 125, 157, 189, 8, 115, 15, 158, 77, 105, 124, 171, 180, 227, 134, 50, 208, 245, 254, 35, 231, 215, 231, 193, 218, 216, 68, 204, 229, 233, 95, 120, 177, 105, 108, 92, 9, 181, 119, 196, 19, 97, 5, 145, 254, 112, 156, 70, 9, 68, 39, 84, 33, 80, 2, 21, 228, 184, 145, 218, 19, 202, 231, 144, 3, 29, 22, 14, 146, 193, 90, 216, 63, 95, 197, 70, 198, 68, 235, 132, 16, 31, 100, 179, 19, 105, 19, 178, 210, 222, 118, 148, 37, 202, 50, 222, 84, 246, 89, 36, 25, 183, 80, 175, 79, 154, 38, 119, 89, 125, 133, 56, 21, 61, 187, 123, 80, 224, 187, 15, 84, 46, 19, 1, 24, 246, 250, 32, 226, 193, 49, 118, 252, 1, 47, 172, 161, 175, 60, 113, 56, 248, 198, 100, 117, 78, 138, 154, 40, 231, 118, 120, 23, 223, 8, 239, 145, 51, 43, 82, 146, 83, 129, 43, 146, 75, 171, 20, 186, 157, 174, 137, 205, 187, 198, 37, 10, 108, 65, 154, 212, 207, 63, 178, 11, 51, 5, 62, 172, 122, 219, 147, 16, 223, 243, 134, 146, 161, 173, 118, 113, 185, 212, 199, 29, 83, 5, 241, 42, 54, 160, 57, 100, 116, 111, 218, 193, 39, 66, 67, 141, 161, 179, 141, 54, 87, 16, 43, 15, 93, 41, 240, 62, 66, 231, 59, 42, 48, 46, 207, 141, 27, 160, 156, 247, 138, 129, 130, 68, 34, 66, 69, 177, 45, 108, 26, 36, 50, 109, 46, 238, 82, 187, 219, 166, 225, 115, 204, 121, 228, 122, 92, 65, 67, 69, 162, 104, 10, 117, 17, 33, 113, 110, 10, 9, 2, 41, 24, 227, 173, 49, 10, 2, 147, 115, 197, 93, 133, 139, 86, 38, 138, 102, 92, 17, 94, 115, 74, 101, 5, 12, 222, 186, 229, 16, 126, 16, 234, 105, 191, 184, 182, 27, 59, 152, 118, 179, 114, 78, 65, 15, 21, 43, 215, 7, 215, 110, 207, 152, 128, 14, 106, 188, 73, 230, 183, 23, 101, 92, 95, 250, 115, 245, 40, 58, 167, 157, 201, 1, 229, 233, 39, 243, 103, 253, 104, 135, 248, 219, 74, 127, 91, 135, 224, 240, 42, 6, 70, 70, 48, 23, 52, 78, 12, 212, 203, 55, 134, 108, 107, 185, 237, 129, 120, 234, 54, 243, 252, 231, 19, 190, 190, 46, 48, 115, 200, 145, 119, 195, 140, 122, 21, 85, 120, 189, 33, 208, 59, 39, 181, 57, 55, 128, 144, 149, 120, 65, 77, 113, 75, 203, 194, 251, 217, 77, 110, 56, 54, 93, 240, 101, 219, 52, 174, 163, 153, 193, 24, 16, 112, 103, 178, 252, 57, 2, 7, 55, 184, 80, 176, 248, 128, 236, 73, 250, 66, 218, 63, 16, 230, 149, 32, 149, 237, 199, 168, 81, 147, 63, 211, 251, 112, 223, 62, 92, 60, 114, 156, 203, 12, 225, 232, 250, 166, 123, 194, 227, 56, 82, 4, 104, 168, 170, 38, 93, 122, 232, 207, 228, 68, 58, 247, 162, 96, 128, 20, 249, 114, 93, 37, 199, 229, 152, 134, 168, 14, 212, 153, 137, 31, 241, 189, 163, 223, 247, 196, 22, 67, 27, 105, 10, 235, 28, 24, 177, 249, 230, 19, 247, 145, 228, 151, 195, 17, 201, 93, 226, 167, 76, 227, 85, 207, 200, 139, 37, 148, 40, 243, 214, 60, 55, 241, 183, 126, 160, 97, 6, 129, 104, 182, 207, 250, 77, 123, 235, 211, 158, 171, 52, 171, 186, 53, 121, 24, 137, 105, 164, 247, 172, 132, 201, 31, 135, 123, 0, 164, 164, 235, 167, 103, 63, 40, 54, 102, 46, 197, 185, 194, 14, 195, 159, 182, 120, 4, 36, 14, 194, 219, 155, 23, 233, 148, 169, 113, 158, 92, 103, 68, 247, 133, 214, 252, 9, 220, 50, 198, 251, 75, 34, 10, 115, 209, 172, 147, 168, 185, 81, 70, 174, 155, 80, 111, 246, 78, 199, 155, 192, 2, 241, 162, 123, 123, 77, 228, 101, 22, 241, 89, 245, 63, 3, 235, 76, 162, 20, 12, 81, 228, 254, 50, 146, 76, 149, 112, 226, 88, 231, 167, 229, 27, 250, 21, 98, 84, 235, 251, 213, 238, 209, 111, 34, 144, 181, 190, 22, 60, 112, 244, 98, 241, 19, 51, 163, 4, 198, 8, 50, 194, 200, 241, 155, 192, 97, 95, 173, 49, 94, 169, 112, 21, 87, 23, 229, 226, 75, 60, 134, 126, 21, 10, 86, 84, 238, 113, 19, 77, 205, 3, 158, 105, 241, 98, 86, 237, 233, 190, 97, 136, 202, 234, 147, 121, 253, 156, 176, 238, 222, 71, 35, 185, 127, 212, 211, 0, 86, 129, 131, 93, 111, 167, 121, 138, 69, 251, 4, 90, 229, 43, 48, 144, 138, 0, 48, 249, 202, 203, 46, 117, 175, 27, 96, 230, 119, 93, 156, 129, 186, 122, 133, 114, 160, 196, 50, 81, 97, 63, 13, 188, 146, 63, 4, 220, 222, 165, 9, 236, 124, 117, 145, 91, 244, 186, 233, 35, 78, 241, 45, 38, 127, 179, 165, 20, 253, 131, 171, 41, 230, 158, 162, 83, 50, 19, 23, 83, 128, 121, 67, 248, 17, 145, 98, 112, 190, 250, 237, 243, 248, 64, 146, 41, 16, 44, 154, 33, 60, 162, 161, 156, 229, 176, 172, 49, 42, 240, 235, 85, 90, 162, 151, 170, 183, 27, 21, 183, 40, 134, 187, 193, 75, 183, 76, 63, 235, 27, 90, 133, 26, 138, 83, 150, 77, 206, 233, 166, 204, 90, 125, 211, 133, 229, 10, 166, 12, 146, 184, 152, 107, 242, 245, 52, 145, 154, 34, 249, 13, 102, 253, 209, 20, 3, 225, 88, 156, 137, 30, 182, 206, 211, 255, 149, 39, 64, 133, 16, 125, 5, 115, 220, 51, 122, 242, 121, 222, 212, 239, 237, 208, 31, 72, 98, 36, 131, 185, 9, 124, 14, 55, 236, 196, 38, 68, 82, 17, 197, 255, 168, 199, 158, 94, 52, 58, 126, 100, 57, 118, 184, 214, 42, 65, 249, 156, 128, 82, 139, 234, 63, 119, 55, 89, 108, 207, 209, 226, 34, 198, 134, 54, 131, 154, 87, 96, 31, 11, 241, 1, 11, 97, 61, 167, 20, 223, 188, 163, 31, 250, 189, 13, 29, 196, 209, 218, 119, 102, 13, 172, 149, 149, 219, 251, 64, 238, 211, 212, 136, 82, 237, 150, 140, 188, 201, 123, 191, 83, 133, 193, 253, 25, 27, 246, 72, 60, 212, 227, 241, 209, 206, 142, 29, 11, 11, 146, 182, 203, 214, 25, 192, 236, 197, 176, 6, 216, 105, 145, 191, 115, 161, 107, 170, 194, 121, 148, 205, 65, 116, 157, 96, 173, 217, 30, 96, 174, 239, 178, 151, 121, 46, 3, 86, 65, 32, 120, 195, 66, 86, 144, 206, 91, 36, 148, 42, 216, 208, 164, 203, 149, 69, 230, 49, 78, 224, 177, 23, 175, 103, 191, 111, 181, 130, 255, 215, 189, 173, 134, 189, 64, 36, 226, 134, 89, 116, 138, 92, 81, 246, 202, 10, 243, 21, 81, 165, 210, 235, 49, 99, 217, 19, 184, 54, 71, 102, 132, 49, 135, 228, 156, 67, 170, 38, 173, 200, 239, 244, 255, 65, 211, 100, 161, 118, 111, 218, 219, 87, 23, 57, 9, 246, 102, 252, 157, 205, 98, 12, 97, 198, 183, 141, 223, 154, 23, 180, 123, 80, 156, 144, 231, 95, 42, 135, 31, 244, 164, 121, 138, 116, 154, 207, 222, 138, 32, 84, 185, 56, 114, 9, 244, 11, 213, 237, 166, 91, 31, 217, 20, 179, 168, 121, 139, 237, 181, 221, 90, 174, 2, 176, 34, 210, 130, 241, 130, 240, 178, 89, 176, 130, 185, 243, 52, 101, 116, 112, 6, 60, 84, 6, 110, 29, 246, 66, 10, 164, 130, 46, 75, 163, 179, 45, 250, 32, 57, 48, 74, 169, 133, 44, 167, 241, 103, 31, 119, 243, 74, 208, 4, 162, 17, 11, 72, 126, 10, 81, 117, 188, 103, 222, 163, 78, 206, 72, 216, 73, 2, 221, 230, 122, 107, 141, 126, 1, 236, 63, 51, 169, 160, 14, 165, 208, 174, 9, 91, 74, 252, 146, 198, 79, 238, 175, 39, 102, 75, 150, 40, 109, 143, 117, 77, 153, 234, 82, 38, 162, 23, 242, 107, 124, 217, 13, 51, 55, 92, 1, 28, 138, 62, 209, 69, 222, 63, 62, 150, 221, 74, 232, 220, 181, 21, 36, 203, 182, 193, 183, 173, 113, 157, 241, 208, 131, 172, 0, 176, 55, 229, 63, 54, 84, 197, 105, 196, 154, 60, 52, 50, 191, 230, 202, 129, 85, 235, 75, 245, 172, 58, 230, 0, 251, 250, 104, 123, 247, 224, 120, 118, 30, 50, 223, 144, 233, 243, 213, 58, 228, 124, 24, 168, 194, 24, 192, 4, 63, 107, 39, 55, 202, 196, 254, 149, 141, 189, 136, 218, 108, 203, 100, 198, 121, 240, 252, 208, 200, 230, 178, 117, 199, 2, 55, 165, 214, 210, 246, 142, 178, 63, 86, 249, 156, 100, 172, 202, 197, 148, 222, 76, 185, 221, 248, 71, 7, 231, 224, 158, 236, 27, 44, 53, 58, 181, 65, 176, 146, 223, 254, 5, 249, 207, 218, 160, 212, 245, 14, 114, 246, 153, 139, 55, 230, 89, 143, 125, 133, 103, 249, 123, 91, 229, 195, 214, 65, 251, 219, 11, 48, 167, 72, 9, 131, 110, 207, 244, 197, 159, 23, 51, 161, 135, 251, 220, 52, 242, 122, 199, 21, 231, 34, 185, 84, 140, 112, 3, 164, 231, 64, 162, 192, 103, 182, 162, 112, 2, 142, 22, 148, 62, 71, 79, 232, 85, 38, 15, 87, 230, 232, 112, 203, 94, 230, 172, 233, 219, 158, 246, 87, 61, 155, 22, 14, 157, 23, 61, 99, 196, 97, 70, 216, 173, 236, 211, 120, 197, 28, 231, 47, 215, 66, 71, 46, 66, 28, 29, 223, 77, 173, 144, 82, 220, 222, 99, 229, 74, 53, 88, 116, 123, 162, 240, 168, 216, 142, 205, 144, 183, 127, 135, 4, 162, 91, 176, 78, 26, 178, 249, 104, 195, 76, 105, 206, 143, 20, 158, 220, 22, 67, 201, 237, 78, 241, 56, 111, 63, 160, 240, 168, 131, 253, 62, 8, 51, 88, 43, 174, 217, 235, 243, 71, 50, 210, 7, 235, 56, 63, 128, 111, 32, 244, 187, 217, 170, 77, 152, 65, 7, 200, 30, 47, 83, 126, 139, 170, 142, 219, 184, 156, 54, 102, 249, 94, 32, 2, 204, 206, 77, 230, 60, 184, 143, 167, 110, 241, 203, 60, 44, 174, 128, 150, 186, 215, 218, 189, 87, 107, 216, 84, 76, 166, 171, 91, 23, 16, 208, 211, 181, 234, 61, 203, 224, 172, 128, 129, 66, 7, 249, 0, 75, 157, 235, 49, 244, 154, 157, 107, 205, 70, 146, 38, 188, 6, 218, 133, 231, 204, 168, 234, 133, 17, 245, 85, 253, 163, 242, 168, 56, 9, 99, 142, 236, 237, 67, 20, 226, 60, 4, 86, 83, 208, 243, 19, 127, 168, 6, 156, 67, 179, 66, 170, 242, 211, 170, 199, 188, 71, 231, 191, 67, 42, 109, 37, 117, 154, 231, 116, 63, 232, 206, 107, 141, 17, 127, 143, 79, 247, 160, 62, 151, 234, 116, 126, 14, 223, 8, 5, 52, 82, 8, 99, 17, 9, 7, 4, 208, 106, 11, 208, 156, 157, 85, 51, 236, 128, 41, 66, 99, 243, 220, 153, 131, 111, 78, 189, 95, 219, 51, 100, 41, 150, 188, 218, 35, 37, 176, 31, 122, 252, 207, 222, 214, 142, 95, 19, 136, 159, 195, 209, 39, 182, 19, 97, 185, 72, 83, 165, 208, 249, 83, 4, 244, 230, 30, 7, 13, 161, 90, 200, 121, 138, 67, 151, 252, 197, 165, 44, 215, 9, 81, 118, 179, 159, 15, 3, 156, 105, 151, 104, 109, 161, 202, 143, 199, 41, 187, 172, 154, 64, 105, 69, 67, 173, 226, 34, 234, 111, 69, 244, 45, 230, 49, 11, 18, 158, 56, 184, 55, 124, 46, 252, 215, 109, 236, 124, 156, 172, 148, 159, 44, 147, 129, 50, 49, 230, 128, 213, 137, 161, 125, 140, 222, 36, 90, 117, 223, 146, 237, 122, 39, 118, 188, 93, 11, 40, 49, 114, 230, 80, 31, 221, 58, 199, 174, 192, 112, 31, 236, 98, 56, 76, 27, 199, 78, 28, 48, 62, 246, 207, 30, 85, 50, 31, 4, 143, 58, 241, 131, 83, 203, 70, 241, 124, 150, 160, 88, 30, 227, 177, 213, 75, 139, 122, 83, 83, 41, 97, 140, 78, 157, 188, 172, 85, 52, 202, 76, 47, 145, 76, 126, 144, 228, 49, 239, 103, 196, 149, 203, 133, 159, 201, 215, 241, 71, 245, 114, 49, 125, 228, 22, 192, 235, 230, 246, 247, 100, 110, 76, 74, 214, 226, 221, 120, 140, 250, 108, 9, 203, 40, 92, 19, 184, 136, 86, 76, 250, 177, 64, 76, 214, 79, 190, 86, 8, 131, 178, 0, 200, 171, 245, 144, 94, 2, 236, 11, 187, 119, 165, 83, 130, 252, 49, 126, 254, 131, 38, 43, 245, 170, 53, 7, 183, 205, 84, 71, 16, 127, 86, 249, 31, 169, 65, 33, 207, 146, 111, 155, 43, 145, 85, 250, 216, 38, 95, 18, 129, 186, 14, 3, 158, 43, 183, 44, 205, 90, 37, 141, 27, 130, 115, 4, 121, 67, 113, 43, 109, 251, 71, 103, 32, 129, 163, 73, 116, 252, 32, 149, 17, 150, 117, 168, 218, 56, 163, 173, 125, 84, 103, 136, 195, 89, 46, 27, 45, 153, 6, 184, 81, 93, 131, 28, 42, 171, 87, 177, 135, 109, 24, 78, 80, 103, 110, 168, 3, 251, 165, 139, 171, 25, 77, 166, 250, 193, 166, 168, 195, 160, 12, 25, 110, 36, 0, 132, 247, 199, 195, 30, 177, 14, 176, 197, 58, 142, 93, 43, 151, 126, 28, 184, 231, 179, 113, 227, 26, 165, 98, 180, 183, 218, 182, 150, 125, 231, 102, 231, 206, 39, 57, 121, 193, 43, 11, 254, 173, 29, 251, 45, 171, 106, 87, 114, 38, 58, 153, 72, 84, 193, 36, 2, 142, 215, 121, 147, 160, 11, 37, 243, 213, 217, 181, 152, 112, 191, 155, 217, 136, 117, 175, 182, 125, 134, 218, 58, 212, 239, 39, 250, 119, 220, 113, 214, 143, 204, 124, 11, 153, 200, 158, 215, 253, 40, 35, 17, 232, 45, 217, 47, 191, 159, 199, 82, 41, 106, 158, 244, 222, 254, 133, 109, 151, 43, 187, 203, 165, 61, 163, 205, 7, 217, 12, 252, 123, 90, 255, 255, 88, 221, 122, 76, 173, 185, 85, 185, 33, 228, 226, 161, 72, 217, 34, 197, 140, 190, 18, 7, 142, 177, 203, 49, 93, 91, 12, 12, 29, 35, 100, 136, 58, 22, 174, 49, 71, 209, 218, 199, 125, 51, 110, 117, 45, 205, 141, 81, 192, 148, 211, 238, 218, 84, 227, 191, 160, 49, 110, 207, 190, 8, 156, 184, 167, 148, 228, 69, 19, 39, 3, 210, 204, 196, 230, 123, 64, 123, 133, 115, 33, 85, 15, 45, 144, 218, 31, 192, 34, 60, 208, 166, 113, 151, 122, 249, 171, 207, 8, 164, 207, 138, 246, 217, 251, 34, 27, 145, 144, 57, 60, 165, 203, 117, 199, 80, 141, 218, 36, 65, 24, 115, 33, 152, 139, 152, 34, 72, 99, 192, 219, 49, 65, 187, 217, 14, 208, 56, 62, 143, 12, 51, 225, 187, 38, 19, 114, 83, 118, 117, 17, 249, 224, 185, 225, 237, 71, 79, 67, 75, 51, 0, 92, 123, 155, 122, 154, 105, 101, 235, 17, 160, 35, 152, 108, 45, 151, 154, 92, 149, 63, 255, 77, 153, 104, 98, 208, 251, 112, 189, 38, 102, 205, 117, 255, 232, 150, 109, 51, 70, 5, 11, 224, 41, 141, 200, 227, 170, 1, 220, 34, 103, 112, 185, 169, 207, 141, 183, 172, 61, 129, 113, 126, 200, 59, 197, 93, 245, 240, 58, 232, 40, 90, 125, 37, 134, 210, 82, 118, 234, 200, 115, 169, 124, 188, 1, 172, 236, 31, 79, 211, 213, 146, 195, 206, 105, 57, 241, 59, 237, 145, 32, 6, 24, 253, 23, 60, 211, 2, 94, 42, 190, 180, 213, 177, 23, 167, 104, 3, 226, 171, 208, 95, 96, 57, 53, 141, 115, 88, 174, 10, 206, 234, 150, 182, 157, 242, 93, 97, 80, 9, 154, 152, 166, 94, 141, 238, 212, 68, 231, 244, 0, 36, 167, 2, 9, 169, 16, 151, 170, 33, 51, 1, 105, 210, 194, 224, 146, 221, 227, 137, 63, 144, 14, 5, 140, 30, 193, 203, 47, 90, 20, 233, 169, 66, 192, 91, 252, 161, 140, 67, 202, 12, 24, 190, 242, 46, 208, 121, 8, 194, 164, 164, 125, 216, 194, 242, 125, 131, 35, 5, 45, 18, 152, 157, 240, 35, 56, 246, 144, 175, 2, 7, 123, 13, 158, 168, 115, 221, 195, 54, 236, 35, 132, 246, 7, 100, 108, 120, 17, 23, 210, 61, 238, 38, 73, 149, 28, 249, 29, 5, 232, 28, 131, 84, 79, 155, 26, 82, 96, 150, 219, 122, 167, 231, 56, 233, 176, 154, 213, 126, 14, 155, 13, 68, 157, 25, 236, 244, 64, 125, 74, 247, 241, 123, 177, 102, 43, 244, 122, 173, 75, 132, 244, 248, 236, 246, 161, 138, 68, 86, 2, 52, 121, 232, 96, 100, 207, 238, 219, 64, 197, 162, 8, 97, 144, 89, 121, 66, 146, 166, 233, 7, 145, 217, 223, 51, 254, 128, 1, 211, 1, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 10, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 10, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 10, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 10, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 10, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 10, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 10, 99, 108, 101, 97, 114, 116, 111, 109, 97, 114, 107, 10, 128, 3}; +char datatoc_Bfont[25181]= { +128, 1, 228, 1, 0, 0, 37, 33, 80, 83, 45, 65, 100, 111, 98, 101, +70, 111, 110, 116, 45, 49, 46, 48, 58, 32, 66, 102, 111, 110, 116, 32, +48, 48, 49, 46, 48, 48, 49, 10, 49, 49, 32, 100, 105, 99, 116, 32, +98, 101, 103, 105, 110, 10, 47, 70, 111, 110, 116, 73, 110, 102, 111, 32, +49, 48, 32, 100, 105, 99, 116, 32, 100, 117, 112, 32, 98, 101, 103, 105, +110, 10, 47, 118, 101, 114, 115, 105, 111, 110, 32, 40, 48, 48, 49, 46, +48, 48, 49, 41, 32, 114, 101, 97, 100, 111, 110, 108, 121, 32, 100, 101, +102, 10, 47, 70, 117, 108, 108, 78, 97, 109, 101, 32, 40, 66, 102, 111, +110, 116, 41, 32, 114, 101, 97, 100, 111, 110, 108, 121, 32, 100, 101, 102, +10, 47, 70, 97, 109, 105, 108, 121, 78, 97, 109, 101, 32, 40, 66, 102, +111, 110, 116, 41, 32, 114, 101, 97, 100, 111, 110, 108, 121, 32, 100, 101, +102, 10, 47, 87, 101, 105, 103, 104, 116, 32, 40, 82, 101, 103, 117, 108, +97, 114, 41, 32, 114, 101, 97, 100, 111, 110, 108, 121, 32, 100, 101, 102, +10, 47, 73, 116, 97, 108, 105, 99, 65, 110, 103, 108, 101, 32, 48, 32, +100, 101, 102, 10, 47, 105, 115, 70, 105, 120, 101, 100, 80, 105, 116, 99, +104, 32, 102, 97, 108, 115, 101, 32, 100, 101, 102, 10, 47, 85, 110, 100, +101, 114, 108, 105, 110, 101, 80, 111, 115, 105, 116, 105, 111, 110, 32, 45, +49, 48, 48, 32, 100, 101, 102, 10, 47, 85, 110, 100, 101, 114, 108, 105, +110, 101, 84, 104, 105, 99, 107, 110, 101, 115, 115, 32, 53, 48, 32, 100, +101, 102, 10, 101, 110, 100, 32, 114, 101, 97, 100, 111, 110, 108, 121, 32, +100, 101, 102, 10, 47, 70, 111, 110, 116, 78, 97, 109, 101, 32, 47, 66, +102, 111, 110, 116, 32, 100, 101, 102, 10, 47, 69, 110, 99, 111, 100, 105, +110, 103, 32, 83, 116, 97, 110, 100, 97, 114, 100, 69, 110, 99, 111, 100, +105, 110, 103, 32, 100, 101, 102, 10, 47, 80, 97, 105, 110, 116, 84, 121, +112, 101, 32, 48, 32, 100, 101, 102, 10, 47, 70, 111, 110, 116, 84, 121, +112, 101, 32, 49, 32, 100, 101, 102, 10, 47, 70, 111, 110, 116, 77, 97, +116, 114, 105, 120, 32, 91, 48, 46, 48, 48, 49, 32, 48, 32, 48, 32, +48, 46, 48, 48, 49, 32, 48, 32, 48, 93, 32, 114, 101, 97, 100, 111, +110, 108, 121, 32, 100, 101, 102, 10, 99, 117, 114, 114, 101, 110, 116, 100, +105, 99, 116, 32, 101, 110, 100, 10, 99, 117, 114, 114, 101, 110, 116, 102, +105, 108, 101, 32, 101, 101, 120, 101, 99, 10, 128, 2, 146, 94, 0, 0, +217, 214, 111, 99, 59, 132, 106, 152, 155, 153, 116, 176, 23, 159, 198, 204, +68, 91, 194, 192, 49, 3, 198, 133, 112, 167, 179, 84, 164, 162, 128, 174, +111, 191, 127, 152, 247, 90, 132, 186, 206, 45, 3, 106, 107, 81, 184, 72, +73, 49, 89, 29, 146, 229, 6, 158, 98, 38, 213, 173, 204, 93, 228, 248, +16, 122, 166, 154, 53, 181, 95, 106, 155, 75, 79, 147, 197, 108, 35, 188, +198, 29, 215, 191, 143, 50, 242, 29, 88, 228, 26, 95, 121, 12, 238, 47, +2, 175, 73, 134, 149, 233, 12, 29, 11, 210, 89, 231, 91, 2, 25, 48, +11, 15, 105, 44, 51, 119, 156, 42, 166, 122, 232, 81, 122, 190, 18, 48, +8, 69, 34, 74, 246, 173, 93, 169, 219, 154, 26, 58, 64, 251, 6, 179, +106, 156, 205, 105, 18, 85, 7, 252, 45, 233, 208, 65, 132, 199, 96, 66, +240, 63, 207, 209, 83, 132, 0, 35, 151, 42, 129, 42, 185, 179, 203, 86, +112, 193, 206, 39, 89, 113, 28, 117, 41, 66, 98, 214, 242, 145, 175, 155, +124, 118, 7, 30, 218, 126, 122, 208, 38, 33, 98, 50, 34, 185, 54, 8, +122, 178, 127, 254, 95, 7, 134, 71, 6, 101, 146, 24, 61, 195, 71, 174, +146, 230, 191, 86, 177, 123, 237, 206, 19, 104, 70, 246, 162, 163, 118, 171, +140, 11, 192, 255, 78, 52, 125, 32, 253, 14, 199, 126, 250, 177, 240, 99, +49, 0, 20, 141, 42, 125, 47, 210, 31, 18, 90, 170, 205, 143, 219, 153, +121, 131, 43, 103, 13, 138, 170, 118, 210, 18, 186, 181, 97, 70, 25, 144, +150, 12, 53, 110, 184, 216, 233, 243, 198, 93, 157, 254, 127, 140, 44, 138, +123, 43, 233, 158, 99, 255, 108, 134, 136, 60, 29, 229, 7, 141, 163, 185, +30, 3, 228, 132, 13, 221, 109, 48, 227, 60, 227, 135, 117, 220, 128, 67, +195, 147, 32, 118, 71, 190, 131, 11, 245, 200, 93, 30, 226, 32, 114, 26, +39, 232, 138, 33, 109, 232, 1, 11, 233, 212, 78, 221, 88, 158, 135, 95, +159, 14, 38, 31, 12, 106, 255, 51, 147, 42, 139, 254, 210, 119, 6, 96, +221, 226, 140, 183, 213, 222, 5, 205, 13, 140, 253, 214, 125, 103, 227, 52, +60, 102, 31, 250, 163, 147, 228, 167, 58, 207, 156, 68, 166, 150, 167, 169, +116, 83, 194, 150, 104, 152, 31, 7, 157, 38, 76, 29, 10, 247, 63, 57, +194, 106, 230, 183, 120, 135, 187, 201, 211, 82, 234, 168, 182, 167, 90, 56, +37, 109, 160, 144, 13, 48, 204, 190, 14, 169, 103, 127, 136, 102, 24, 81, +61, 32, 233, 228, 158, 18, 235, 189, 28, 0, 222, 67, 17, 110, 143, 71, +223, 181, 33, 17, 66, 81, 210, 7, 23, 186, 245, 229, 198, 143, 62, 113, +33, 80, 236, 87, 148, 65, 42, 27, 111, 128, 223, 196, 140, 45, 32, 91, +123, 158, 136, 153, 166, 144, 126, 115, 133, 220, 254, 234, 192, 123, 14, 239, +75, 199, 116, 28, 241, 25, 30, 66, 226, 248, 159, 142, 46, 41, 10, 237, +111, 205, 31, 230, 72, 196, 49, 200, 50, 29, 115, 153, 141, 198, 225, 218, +157, 86, 56, 67, 249, 99, 50, 25, 151, 14, 200, 35, 186, 250, 204, 151, +187, 209, 51, 129, 161, 68, 118, 130, 31, 25, 134, 255, 75, 170, 240, 225, +113, 144, 5, 178, 133, 45, 85, 242, 66, 10, 10, 65, 138, 93, 147, 72, +210, 250, 209, 123, 148, 135, 12, 156, 94, 13, 250, 31, 211, 157, 82, 128, +132, 143, 11, 155, 47, 211, 151, 232, 142, 253, 82, 104, 234, 231, 190, 169, +78, 32, 90, 2, 41, 201, 122, 142, 205, 144, 234, 204, 198, 227, 56, 57, +6, 63, 8, 237, 89, 199, 30, 226, 169, 48, 198, 191, 38, 114, 87, 135, +189, 98, 251, 224, 210, 154, 58, 87, 26, 56, 41, 219, 119, 124, 109, 83, +182, 169, 166, 123, 255, 190, 35, 121, 177, 37, 92, 128, 242, 247, 132, 218, +149, 140, 116, 184, 163, 13, 248, 138, 68, 124, 229, 211, 89, 210, 101, 172, +149, 221, 182, 113, 36, 182, 46, 5, 141, 127, 147, 54, 118, 67, 107, 105, +187, 40, 53, 208, 170, 25, 45, 113, 216, 110, 135, 56, 7, 26, 14, 225, +61, 79, 228, 72, 30, 39, 220, 195, 227, 229, 153, 196, 28, 6, 107, 240, +54, 67, 6, 94, 143, 0, 34, 180, 49, 14, 41, 111, 9, 41, 94, 203, +184, 139, 142, 34, 140, 138, 90, 25, 216, 89, 252, 45, 46, 132, 169, 154, +230, 131, 15, 20, 100, 99, 235, 106, 73, 185, 89, 6, 66, 230, 171, 202, +22, 213, 227, 183, 32, 138, 116, 253, 208, 230, 121, 16, 63, 238, 132, 69, +28, 135, 88, 115, 18, 21, 11, 102, 172, 200, 37, 222, 255, 100, 221, 80, +173, 218, 53, 210, 250, 148, 211, 241, 97, 150, 185, 43, 250, 138, 14, 122, +133, 30, 191, 54, 158, 118, 22, 12, 232, 25, 228, 60, 101, 206, 119, 29, +57, 12, 99, 36, 167, 182, 153, 86, 195, 21, 70, 154, 102, 106, 45, 236, +70, 151, 143, 185, 207, 252, 106, 46, 168, 80, 216, 206, 157, 171, 118, 77, +82, 153, 24, 54, 165, 128, 160, 27, 195, 117, 241, 141, 93, 151, 233, 239, +244, 73, 123, 133, 42, 138, 123, 68, 159, 225, 209, 171, 242, 70, 212, 6, +168, 19, 116, 228, 0, 14, 148, 191, 132, 10, 254, 83, 125, 20, 17, 71, +126, 142, 56, 80, 55, 48, 125, 184, 172, 156, 163, 161, 72, 249, 105, 204, +207, 179, 217, 115, 177, 2, 82, 220, 142, 14, 180, 138, 254, 83, 139, 36, +70, 203, 91, 81, 82, 229, 20, 253, 78, 132, 213, 64, 154, 163, 59, 93, +245, 168, 38, 148, 48, 228, 13, 186, 204, 95, 140, 184, 118, 22, 130, 111, +27, 38, 139, 127, 106, 172, 161, 254, 136, 187, 166, 48, 162, 152, 124, 69, +27, 186, 50, 126, 7, 144, 43, 75, 176, 145, 159, 202, 244, 7, 78, 203, +250, 32, 42, 195, 71, 186, 90, 92, 162, 126, 98, 44, 195, 163, 47, 88, +124, 43, 177, 122, 251, 254, 29, 161, 70, 98, 235, 133, 52, 12, 28, 184, +67, 145, 73, 88, 99, 69, 60, 227, 142, 15, 218, 82, 167, 57, 225, 230, +218, 131, 251, 171, 11, 63, 191, 65, 236, 178, 63, 159, 213, 211, 114, 64, +200, 85, 73, 40, 94, 123, 108, 171, 89, 169, 206, 99, 196, 31, 15, 152, +138, 77, 137, 210, 197, 228, 255, 73, 126, 120, 249, 214, 170, 212, 168, 73, +54, 125, 113, 78, 226, 37, 137, 249, 188, 239, 33, 231, 244, 125, 116, 137, +126, 187, 31, 193, 194, 118, 121, 19, 80, 250, 87, 48, 80, 62, 246, 29, +121, 247, 135, 198, 193, 253, 148, 211, 17, 210, 17, 247, 44, 205, 91, 1, +190, 195, 236, 66, 95, 144, 58, 235, 2, 42, 79, 25, 82, 164, 167, 244, +114, 188, 192, 101, 23, 55, 69, 141, 168, 28, 89, 60, 116, 91, 162, 121, +28, 123, 96, 252, 165, 180, 69, 56, 232, 54, 122, 138, 223, 158, 131, 94, +171, 82, 4, 112, 13, 160, 117, 170, 146, 28, 241, 154, 211, 119, 16, 233, +141, 96, 94, 167, 13, 37, 118, 105, 73, 211, 97, 109, 148, 131, 190, 119, +45, 124, 208, 225, 39, 94, 48, 62, 33, 188, 248, 154, 233, 46, 158, 7, +144, 1, 121, 0, 235, 71, 25, 52, 13, 46, 1, 25, 171, 27, 179, 170, +164, 231, 2, 25, 182, 226, 250, 96, 192, 23, 185, 218, 218, 16, 140, 36, +180, 216, 59, 95, 49, 165, 162, 134, 252, 47, 168, 65, 242, 178, 211, 62, +10, 239, 153, 65, 219, 247, 72, 17, 105, 49, 254, 85, 136, 211, 117, 240, +218, 77, 221, 166, 41, 145, 198, 4, 104, 136, 241, 48, 0, 158, 210, 236, +207, 26, 145, 140, 95, 164, 117, 198, 0, 183, 104, 161, 59, 9, 189, 8, +32, 44, 26, 255, 157, 119, 245, 250, 49, 176, 156, 227, 102, 228, 105, 83, +24, 153, 85, 196, 129, 133, 128, 208, 129, 202, 62, 204, 173, 137, 91, 223, +112, 208, 243, 87, 180, 109, 82, 141, 56, 239, 210, 40, 86, 200, 173, 31, +32, 230, 140, 202, 61, 220, 176, 92, 108, 207, 177, 213, 169, 238, 172, 158, +254, 38, 242, 141, 6, 115, 217, 193, 134, 166, 227, 36, 208, 119, 86, 44, +34, 195, 71, 119, 94, 234, 241, 122, 79, 169, 173, 36, 221, 120, 68, 23, +3, 44, 125, 38, 78, 72, 230, 25, 62, 18, 205, 206, 66, 140, 79, 125, +229, 223, 0, 92, 25, 118, 253, 161, 219, 51, 228, 229, 212, 13, 155, 26, +50, 54, 105, 54, 38, 85, 152, 49, 150, 233, 88, 191, 111, 0, 122, 147, +95, 215, 50, 33, 176, 209, 77, 136, 198, 6, 71, 97, 100, 152, 0, 159, +94, 91, 202, 7, 148, 125, 254, 58, 38, 107, 49, 101, 14, 194, 163, 12, +79, 253, 153, 150, 54, 30, 37, 140, 189, 241, 141, 47, 57, 139, 145, 74, +88, 15, 178, 179, 63, 241, 91, 129, 30, 79, 19, 104, 72, 56, 215, 37, +124, 242, 77, 81, 109, 155, 0, 233, 122, 186, 107, 91, 145, 92, 162, 90, +4, 113, 170, 84, 211, 132, 142, 64, 27, 93, 152, 248, 107, 94, 93, 160, +109, 249, 241, 251, 102, 130, 66, 96, 51, 112, 140, 245, 151, 65, 45, 189, +157, 117, 188, 91, 97, 49, 138, 107, 106, 135, 204, 203, 38, 119, 33, 149, +87, 122, 158, 198, 8, 142, 218, 3, 56, 249, 80, 86, 253, 82, 246, 203, +231, 57, 160, 50, 52, 187, 24, 108, 130, 253, 193, 24, 51, 201, 50, 3, +67, 176, 187, 124, 165, 172, 142, 252, 156, 155, 220, 252, 51, 237, 105, 94, +48, 44, 233, 187, 188, 123, 100, 218, 223, 36, 114, 54, 219, 223, 39, 156, +112, 206, 46, 19, 10, 213, 139, 69, 12, 138, 134, 44, 130, 94, 136, 4, +111, 77, 21, 115, 225, 162, 15, 38, 159, 218, 138, 102, 171, 2, 142, 48, +158, 57, 94, 59, 182, 17, 127, 190, 223, 196, 66, 238, 107, 50, 154, 2, +142, 167, 152, 18, 25, 226, 1, 253, 251, 17, 102, 20, 111, 28, 97, 136, +15, 60, 65, 230, 39, 49, 25, 166, 31, 18, 54, 4, 24, 89, 211, 226, +250, 74, 226, 185, 67, 138, 29, 18, 85, 156, 124, 145, 84, 17, 175, 167, +51, 13, 54, 82, 97, 64, 206, 201, 111, 199, 214, 210, 235, 148, 55, 181, +241, 136, 86, 254, 219, 122, 64, 103, 179, 79, 113, 163, 126, 75, 107, 79, +102, 244, 21, 147, 198, 210, 251, 35, 136, 73, 15, 32, 45, 150, 134, 253, +113, 83, 111, 161, 110, 212, 242, 33, 12, 12, 16, 143, 194, 199, 37, 228, +251, 110, 7, 213, 198, 55, 80, 32, 209, 140, 34, 47, 102, 249, 217, 166, +118, 31, 106, 2, 18, 106, 46, 146, 148, 125, 0, 208, 89, 209, 247, 55, +143, 177, 19, 183, 127, 71, 118, 20, 136, 3, 233, 109, 119, 181, 115, 223, +110, 139, 182, 171, 109, 104, 72, 62, 152, 143, 14, 157, 82, 154, 253, 142, +215, 59, 1, 11, 98, 107, 140, 12, 240, 144, 56, 38, 14, 220, 237, 154, +174, 151, 179, 207, 104, 234, 222, 84, 126, 157, 90, 52, 118, 126, 96, 23, +203, 135, 134, 41, 16, 196, 210, 44, 125, 68, 145, 232, 236, 52, 222, 102, +131, 80, 101, 237, 218, 244, 215, 205, 95, 58, 96, 18, 66, 213, 91, 247, +58, 44, 57, 150, 193, 139, 135, 36, 143, 236, 94, 209, 236, 213, 227, 42, +176, 173, 206, 87, 151, 240, 145, 185, 45, 209, 177, 201, 123, 32, 196, 44, +158, 83, 203, 202, 6, 106, 54, 93, 43, 209, 12, 114, 76, 100, 242, 104, +165, 138, 15, 143, 5, 33, 228, 195, 243, 111, 81, 249, 174, 15, 167, 40, +165, 51, 97, 185, 215, 150, 118, 253, 22, 103, 9, 21, 185, 238, 189, 94, +49, 104, 100, 98, 165, 196, 31, 148, 112, 125, 199, 46, 103, 252, 79, 100, +165, 112, 104, 82, 249, 219, 205, 34, 198, 31, 198, 191, 181, 72, 212, 182, +62, 87, 13, 53, 171, 84, 222, 156, 131, 201, 162, 173, 47, 44, 187, 105, +119, 132, 47, 228, 184, 36, 85, 218, 11, 251, 242, 124, 205, 168, 252, 24, +245, 49, 84, 161, 107, 211, 21, 63, 219, 89, 15, 116, 192, 18, 208, 86, +95, 75, 71, 239, 247, 105, 124, 85, 174, 144, 220, 24, 188, 94, 40, 209, +132, 234, 225, 53, 69, 240, 42, 47, 92, 18, 240, 120, 210, 140, 168, 218, +105, 60, 246, 247, 238, 188, 247, 10, 162, 24, 136, 226, 91, 107, 157, 168, +51, 186, 15, 79, 68, 154, 225, 52, 41, 228, 127, 35, 41, 224, 97, 225, +44, 85, 16, 225, 99, 198, 48, 182, 98, 235, 255, 178, 24, 210, 58, 14, +200, 84, 18, 132, 137, 35, 171, 63, 195, 238, 195, 167, 167, 8, 207, 232, +214, 100, 91, 195, 90, 233, 86, 98, 207, 185, 229, 196, 140, 253, 236, 219, +150, 62, 62, 2, 15, 51, 232, 157, 44, 234, 107, 188, 220, 214, 209, 42, +165, 18, 94, 143, 235, 241, 192, 254, 106, 155, 48, 246, 239, 123, 17, 140, +12, 101, 251, 102, 156, 126, 130, 2, 38, 62, 255, 27, 134, 182, 120, 23, +158, 103, 4, 48, 154, 78, 236, 14, 254, 222, 239, 42, 228, 224, 138, 87, +211, 236, 78, 212, 1, 107, 139, 81, 5, 238, 185, 84, 205, 51, 83, 67, +52, 42, 135, 255, 244, 123, 157, 185, 116, 114, 160, 116, 246, 30, 147, 127, +129, 156, 51, 229, 39, 122, 2, 122, 145, 229, 25, 122, 2, 151, 7, 125, +246, 76, 129, 209, 110, 138, 246, 211, 33, 183, 60, 192, 108, 167, 161, 157, +173, 188, 134, 192, 179, 203, 195, 136, 84, 41, 110, 193, 122, 131, 11, 75, +124, 83, 139, 80, 12, 71, 93, 214, 179, 43, 70, 139, 91, 53, 228, 97, +105, 67, 230, 118, 92, 183, 131, 114, 231, 74, 140, 48, 135, 180, 10, 184, +148, 46, 75, 182, 205, 83, 47, 151, 206, 84, 243, 232, 233, 126, 142, 30, +11, 113, 219, 252, 153, 18, 16, 215, 238, 121, 155, 255, 21, 214, 89, 6, +196, 3, 201, 131, 48, 187, 159, 235, 14, 27, 155, 245, 77, 229, 130, 112, +168, 164, 253, 69, 23, 253, 242, 175, 19, 232, 155, 161, 27, 158, 95, 160, +90, 79, 109, 133, 203, 42, 70, 181, 120, 247, 244, 85, 191, 167, 255, 36, +251, 115, 54, 191, 78, 211, 182, 252, 5, 12, 100, 32, 48, 200, 26, 234, +123, 25, 161, 253, 134, 168, 60, 15, 187, 62, 24, 239, 177, 98, 92, 109, +195, 112, 78, 242, 161, 250, 224, 210, 94, 111, 34, 100, 196, 71, 103, 74, +123, 216, 217, 180, 160, 33, 64, 105, 123, 183, 125, 84, 77, 80, 99, 109, +247, 173, 168, 239, 122, 88, 233, 117, 237, 148, 43, 144, 195, 255, 222, 124, +214, 133, 156, 117, 244, 7, 73, 13, 100, 164, 68, 175, 191, 93, 225, 252, +128, 96, 77, 231, 196, 150, 223, 120, 56, 23, 101, 94, 23, 50, 76, 38, +27, 89, 184, 93, 140, 37, 79, 249, 66, 199, 27, 220, 230, 114, 176, 179, +228, 201, 12, 56, 113, 1, 25, 207, 104, 177, 191, 79, 237, 143, 226, 104, +92, 21, 249, 98, 205, 22, 105, 215, 184, 142, 178, 107, 8, 194, 13, 32, +156, 84, 109, 146, 152, 57, 241, 72, 62, 74, 122, 212, 88, 179, 57, 23, +186, 74, 73, 82, 37, 80, 182, 165, 40, 89, 30, 244, 209, 110, 163, 24, +182, 201, 139, 145, 225, 148, 219, 184, 1, 109, 99, 156, 37, 247, 177, 111, +50, 209, 221, 208, 78, 0, 72, 6, 236, 76, 79, 63, 132, 26, 227, 72, +142, 229, 248, 120, 160, 148, 155, 91, 51, 61, 40, 22, 192, 96, 139, 193, +192, 41, 116, 79, 140, 116, 158, 248, 64, 168, 227, 174, 56, 114, 92, 160, +31, 200, 94, 82, 99, 139, 67, 95, 47, 76, 180, 152, 43, 131, 149, 177, +4, 212, 56, 209, 190, 209, 102, 122, 224, 72, 234, 244, 111, 175, 138, 120, +23, 203, 9, 146, 234, 239, 94, 241, 28, 21, 170, 51, 2, 176, 125, 179, +217, 99, 83, 17, 16, 113, 123, 111, 68, 94, 156, 200, 90, 117, 30, 174, +131, 42, 161, 91, 76, 85, 199, 44, 75, 199, 0, 159, 111, 158, 236, 63, +252, 73, 67, 220, 113, 169, 158, 74, 7, 81, 214, 149, 155, 222, 129, 91, +63, 169, 196, 168, 208, 230, 83, 168, 4, 19, 27, 176, 157, 146, 56, 42, +254, 143, 171, 119, 60, 127, 57, 37, 107, 84, 255, 246, 76, 159, 38, 176, +233, 13, 97, 107, 64, 55, 206, 201, 204, 218, 3, 139, 123, 150, 151, 110, +28, 198, 99, 247, 167, 155, 37, 184, 253, 214, 21, 253, 250, 179, 26, 233, +98, 205, 117, 109, 94, 222, 15, 151, 184, 119, 219, 159, 26, 52, 234, 55, +66, 100, 108, 175, 174, 17, 111, 135, 189, 244, 238, 173, 23, 17, 241, 136, +78, 124, 75, 203, 114, 135, 228, 221, 79, 244, 180, 84, 215, 120, 58, 193, +234, 17, 21, 132, 110, 10, 93, 93, 0, 183, 245, 134, 61, 95, 68, 191, +141, 237, 95, 126, 87, 58, 149, 134, 213, 110, 116, 216, 192, 10, 112, 38, +232, 50, 35, 120, 57, 45, 172, 232, 37, 77, 226, 153, 110, 131, 253, 210, +168, 180, 83, 56, 51, 56, 189, 222, 97, 193, 136, 138, 42, 148, 50, 111, +24, 19, 254, 177, 109, 42, 4, 65, 172, 96, 251, 160, 54, 58, 165, 202, +64, 75, 38, 58, 75, 176, 216, 98, 146, 125, 118, 248, 14, 106, 228, 226, +81, 241, 251, 127, 27, 23, 92, 157, 140, 12, 59, 86, 252, 122, 13, 128, +14, 184, 55, 155, 44, 253, 29, 47, 123, 191, 185, 154, 163, 114, 250, 216, +48, 218, 24, 41, 137, 186, 200, 209, 147, 86, 234, 11, 251, 42, 56, 181, +243, 238, 166, 135, 92, 151, 86, 174, 89, 79, 71, 14, 24, 5, 179, 87, +131, 135, 102, 59, 186, 66, 1, 6, 72, 5, 28, 79, 49, 186, 194, 62, +179, 53, 186, 31, 143, 15, 105, 32, 251, 188, 138, 11, 244, 36, 100, 101, +80, 187, 253, 53, 90, 154, 212, 181, 126, 209, 58, 10, 55, 168, 27, 236, +115, 101, 224, 193, 103, 231, 231, 76, 130, 169, 64, 247, 143, 160, 6, 12, +187, 62, 115, 85, 133, 97, 131, 157, 164, 5, 18, 51, 69, 53, 226, 170, +32, 248, 133, 194, 58, 114, 243, 156, 53, 219, 228, 37, 51, 150, 240, 227, +74, 100, 66, 140, 115, 100, 103, 47, 160, 145, 39, 160, 75, 222, 218, 28, +108, 232, 107, 91, 0, 57, 250, 136, 6, 33, 118, 115, 103, 179, 221, 108, +40, 142, 175, 185, 2, 12, 192, 66, 213, 152, 41, 233, 223, 41, 212, 85, +17, 52, 58, 211, 181, 46, 211, 206, 189, 26, 8, 90, 115, 224, 151, 195, +224, 213, 34, 162, 189, 222, 218, 155, 78, 201, 101, 242, 9, 56, 215, 152, +239, 247, 121, 3, 16, 221, 56, 45, 35, 243, 146, 128, 44, 114, 215, 132, +101, 220, 233, 180, 2, 29, 87, 203, 185, 144, 16, 37, 113, 60, 244, 214, +140, 191, 24, 192, 37, 255, 161, 147, 216, 30, 40, 155, 88, 60, 186, 135, +11, 23, 228, 43, 157, 203, 102, 196, 197, 1, 1, 87, 218, 126, 80, 76, +30, 182, 207, 153, 135, 248, 6, 181, 215, 77, 128, 200, 10, 19, 107, 138, +202, 84, 120, 191, 140, 117, 50, 32, 27, 105, 174, 224, 170, 123, 53, 76, +48, 210, 6, 227, 195, 114, 235, 87, 145, 150, 26, 21, 17, 214, 198, 245, +125, 109, 156, 170, 204, 143, 228, 62, 196, 128, 21, 243, 153, 91, 71, 164, +113, 164, 255, 48, 36, 238, 105, 220, 163, 93, 3, 33, 47, 150, 241, 211, +190, 111, 157, 234, 189, 25, 58, 247, 75, 118, 247, 167, 171, 118, 223, 1, +180, 98, 83, 0, 2, 109, 17, 255, 116, 244, 107, 101, 220, 100, 70, 21, +133, 179, 90, 210, 116, 32, 197, 24, 82, 114, 120, 218, 14, 147, 80, 194, +80, 69, 78, 223, 157, 183, 130, 49, 139, 162, 34, 12, 176, 45, 242, 103, +232, 128, 68, 88, 225, 181, 149, 3, 210, 20, 38, 155, 6, 206, 136, 22, +170, 92, 156, 165, 116, 142, 250, 72, 203, 235, 193, 116, 244, 4, 209, 55, +186, 29, 8, 33, 193, 221, 73, 27, 212, 204, 22, 197, 179, 8, 122, 134, +8, 255, 96, 51, 2, 169, 193, 96, 128, 178, 109, 143, 131, 50, 219, 208, +58, 159, 103, 233, 100, 26, 2, 177, 129, 122, 168, 120, 71, 39, 115, 228, +108, 114, 161, 243, 24, 10, 221, 105, 0, 32, 230, 75, 208, 233, 4, 70, +249, 98, 37, 46, 87, 158, 145, 60, 85, 229, 199, 236, 126, 80, 183, 181, +12, 68, 3, 15, 23, 36, 92, 146, 109, 61, 24, 128, 78, 239, 88, 230, +215, 204, 90, 147, 118, 171, 51, 168, 95, 93, 23, 90, 244, 164, 172, 201, +222, 112, 143, 193, 209, 130, 201, 207, 118, 175, 51, 3, 83, 144, 53, 7, +2, 223, 146, 50, 101, 168, 159, 133, 28, 66, 29, 64, 233, 76, 182, 133, +172, 68, 223, 114, 254, 236, 111, 30, 73, 137, 130, 164, 131, 196, 189, 111, +155, 147, 217, 64, 194, 115, 143, 201, 77, 22, 153, 228, 83, 191, 53, 210, +87, 234, 21, 34, 187, 184, 28, 63, 179, 214, 83, 14, 112, 32, 169, 159, +133, 207, 19, 169, 188, 147, 111, 186, 114, 43, 118, 152, 25, 71, 184, 247, +239, 62, 39, 125, 8, 176, 91, 46, 127, 37, 169, 247, 186, 170, 231, 106, +124, 93, 82, 203, 135, 50, 177, 85, 74, 115, 219, 76, 96, 173, 44, 242, +38, 163, 171, 14, 0, 95, 76, 99, 75, 14, 39, 213, 116, 182, 72, 2, +234, 176, 65, 98, 150, 36, 70, 86, 137, 151, 218, 245, 141, 17, 24, 233, +41, 185, 58, 178, 56, 54, 122, 148, 231, 151, 41, 214, 96, 4, 243, 46, +63, 200, 233, 128, 161, 95, 138, 244, 183, 141, 145, 14, 25, 91, 197, 70, +3, 227, 187, 203, 223, 48, 120, 113, 7, 0, 130, 193, 160, 67, 108, 185, +71, 237, 171, 101, 159, 96, 98, 34, 4, 142, 114, 155, 160, 147, 193, 170, +48, 115, 253, 172, 245, 59, 145, 176, 55, 203, 245, 60, 24, 247, 235, 79, +12, 117, 74, 18, 151, 14, 208, 7, 227, 230, 138, 182, 107, 33, 172, 211, +232, 244, 91, 86, 80, 237, 55, 154, 175, 32, 221, 17, 151, 79, 104, 238, +25, 226, 76, 155, 72, 39, 90, 209, 93, 119, 54, 17, 9, 222, 62, 18, +136, 25, 15, 59, 194, 203, 57, 150, 0, 52, 122, 104, 84, 199, 104, 180, +154, 180, 177, 141, 173, 169, 154, 113, 35, 75, 198, 157, 150, 80, 44, 212, +248, 174, 232, 251, 140, 74, 214, 189, 41, 120, 113, 156, 65, 16, 15, 201, +18, 45, 16, 210, 104, 247, 38, 33, 40, 249, 61, 119, 153, 179, 72, 88, +122, 109, 208, 91, 186, 231, 246, 201, 154, 26, 36, 115, 126, 217, 44, 194, +140, 103, 229, 15, 250, 227, 140, 106, 204, 118, 169, 157, 84, 150, 31, 128, +194, 254, 144, 221, 84, 79, 211, 148, 33, 60, 107, 211, 170, 159, 248, 105, +63, 114, 0, 23, 234, 92, 230, 240, 118, 6, 250, 181, 184, 227, 64, 186, +40, 94, 67, 225, 133, 89, 15, 16, 174, 144, 165, 59, 6, 73, 13, 18, +29, 10, 46, 237, 23, 51, 33, 27, 193, 212, 63, 194, 5, 79, 66, 177, +81, 200, 84, 254, 225, 36, 110, 208, 225, 202, 213, 89, 214, 140, 142, 227, +223, 60, 214, 19, 145, 92, 92, 164, 207, 222, 158, 250, 12, 146, 150, 67, +204, 120, 211, 109, 95, 186, 40, 167, 178, 90, 34, 46, 234, 28, 109, 171, +182, 83, 197, 36, 51, 69, 152, 168, 121, 48, 71, 179, 22, 218, 168, 182, +160, 147, 195, 177, 176, 201, 234, 213, 209, 135, 222, 9, 1, 157, 170, 240, +175, 246, 218, 255, 92, 53, 102, 171, 22, 235, 180, 248, 118, 10, 85, 14, +24, 218, 184, 132, 191, 225, 112, 66, 3, 231, 36, 235, 34, 214, 181, 57, +104, 151, 76, 69, 101, 83, 20, 39, 170, 108, 161, 239, 236, 126, 9, 144, +27, 117, 209, 174, 173, 92, 16, 185, 25, 8, 65, 29, 134, 67, 1, 248, +62, 221, 239, 134, 12, 15, 252, 203, 140, 179, 52, 247, 3, 230, 34, 184, +102, 82, 118, 76, 218, 254, 242, 24, 115, 22, 119, 90, 4, 149, 236, 176, +116, 68, 77, 123, 201, 192, 255, 188, 107, 195, 3, 217, 184, 106, 219, 116, +81, 207, 193, 227, 101, 41, 29, 232, 72, 85, 236, 151, 74, 93, 150, 166, +171, 155, 81, 131, 81, 109, 171, 184, 37, 190, 114, 106, 113, 144, 234, 76, +143, 92, 98, 190, 112, 151, 198, 151, 181, 99, 7, 182, 50, 190, 157, 141, +17, 199, 148, 230, 14, 240, 95, 238, 139, 161, 96, 85, 137, 154, 79, 67, +168, 101, 253, 126, 23, 165, 143, 47, 33, 157, 100, 6, 130, 253, 188, 66, +21, 205, 243, 116, 62, 241, 161, 177, 199, 234, 61, 135, 55, 113, 25, 153, +27, 129, 149, 189, 140, 112, 211, 49, 176, 38, 44, 110, 29, 135, 178, 122, +233, 3, 166, 97, 175, 61, 159, 98, 61, 54, 46, 62, 246, 137, 17, 150, +249, 165, 99, 211, 172, 76, 7, 104, 39, 106, 119, 221, 159, 210, 96, 33, +236, 87, 164, 112, 47, 226, 247, 236, 140, 185, 182, 20, 201, 51, 88, 97, +52, 198, 70, 49, 248, 96, 51, 82, 115, 169, 78, 73, 112, 123, 106, 120, +113, 184, 93, 194, 224, 68, 211, 200, 237, 209, 41, 160, 127, 89, 163, 55, +9, 27, 252, 78, 93, 147, 141, 12, 156, 44, 226, 106, 126, 159, 181, 106, +84, 25, 39, 220, 41, 134, 184, 173, 69, 141, 128, 221, 57, 194, 56, 41, +148, 107, 242, 241, 174, 129, 152, 123, 81, 101, 1, 204, 9, 109, 154, 97, +169, 63, 167, 52, 96, 239, 63, 116, 163, 122, 158, 94, 221, 35, 90, 184, +69, 186, 220, 155, 205, 65, 191, 31, 209, 62, 120, 156, 77, 154, 212, 58, +165, 208, 254, 65, 204, 148, 200, 121, 78, 129, 79, 121, 39, 34, 3, 169, +118, 120, 52, 35, 119, 142, 29, 15, 144, 156, 90, 134, 101, 105, 11, 112, +32, 74, 0, 219, 159, 132, 100, 7, 106, 88, 142, 42, 159, 159, 133, 11, +175, 92, 88, 144, 12, 55, 185, 47, 142, 31, 43, 39, 16, 83, 122, 54, +7, 150, 158, 215, 14, 143, 136, 147, 141, 231, 157, 67, 152, 119, 164, 114, +159, 71, 210, 144, 98, 127, 44, 132, 218, 170, 183, 6, 185, 210, 94, 95, +99, 240, 116, 30, 126, 76, 115, 212, 246, 102, 92, 96, 159, 252, 177, 173, +238, 87, 145, 120, 239, 83, 103, 148, 111, 193, 200, 157, 199, 84, 245, 167, +68, 43, 9, 69, 55, 83, 164, 109, 90, 46, 101, 215, 36, 23, 74, 170, +73, 31, 151, 63, 13, 233, 151, 107, 248, 28, 92, 35, 70, 5, 235, 85, +219, 20, 213, 153, 157, 249, 176, 37, 255, 191, 49, 221, 195, 243, 205, 150, +238, 234, 168, 137, 153, 201, 222, 205, 199, 162, 119, 146, 41, 89, 105, 114, +144, 27, 194, 167, 15, 17, 102, 155, 81, 20, 64, 25, 235, 217, 63, 154, +242, 225, 13, 33, 182, 38, 116, 47, 107, 50, 207, 110, 29, 136, 55, 33, +139, 136, 214, 63, 92, 125, 90, 118, 202, 7, 13, 45, 43, 162, 106, 53, +143, 13, 190, 171, 226, 196, 144, 17, 49, 136, 120, 246, 99, 28, 219, 184, +171, 145, 232, 242, 225, 86, 216, 29, 251, 249, 41, 244, 144, 111, 2, 13, +67, 69, 97, 59, 202, 92, 254, 71, 189, 6, 119, 180, 186, 203, 34, 18, +85, 115, 103, 178, 15, 139, 42, 154, 39, 24, 0, 19, 22, 240, 255, 252, +93, 217, 151, 118, 89, 76, 228, 117, 200, 137, 13, 190, 247, 255, 24, 253, +162, 24, 184, 20, 70, 173, 242, 65, 255, 14, 85, 235, 99, 103, 131, 181, +84, 80, 63, 156, 184, 204, 191, 61, 156, 252, 59, 37, 109, 229, 102, 139, +94, 178, 178, 164, 231, 49, 155, 35, 56, 196, 15, 169, 144, 251, 215, 89, +129, 230, 72, 219, 139, 197, 78, 109, 102, 25, 48, 44, 123, 211, 216, 106, +185, 237, 124, 133, 39, 37, 162, 20, 211, 134, 155, 168, 11, 222, 152, 143, +211, 112, 133, 136, 21, 169, 89, 187, 92, 61, 144, 126, 142, 165, 91, 64, +45, 41, 56, 164, 108, 49, 241, 137, 99, 44, 191, 100, 11, 225, 166, 244, +183, 14, 69, 141, 184, 193, 220, 72, 211, 67, 223, 16, 43, 227, 34, 87, +91, 32, 229, 84, 162, 113, 251, 125, 218, 118, 31, 254, 16, 33, 170, 201, +209, 49, 30, 113, 104, 193, 212, 82, 64, 80, 214, 32, 149, 217, 244, 237, +193, 223, 104, 77, 128, 228, 140, 55, 252, 204, 229, 187, 36, 99, 153, 241, +138, 135, 171, 169, 62, 250, 184, 63, 167, 139, 183, 57, 170, 36, 217, 201, +129, 169, 222, 78, 153, 65, 153, 195, 211, 229, 159, 191, 0, 145, 12, 209, +25, 247, 122, 19, 108, 173, 163, 187, 235, 254, 87, 80, 25, 110, 179, 158, +48, 232, 20, 138, 81, 198, 78, 18, 44, 75, 181, 18, 238, 96, 61, 247, +229, 254, 2, 55, 169, 32, 180, 136, 177, 161, 213, 132, 128, 108, 93, 159, +201, 212, 238, 223, 233, 186, 243, 4, 248, 5, 33, 214, 193, 214, 95, 51, +141, 60, 72, 63, 142, 184, 37, 122, 118, 136, 97, 93, 142, 245, 8, 147, +224, 126, 67, 93, 170, 105, 121, 231, 171, 85, 105, 191, 126, 88, 57, 42, +253, 179, 85, 251, 193, 163, 112, 71, 28, 137, 104, 199, 121, 13, 122, 58, +231, 160, 176, 50, 200, 80, 65, 99, 25, 67, 129, 91, 97, 178, 131, 195, +111, 148, 134, 71, 57, 145, 113, 209, 177, 51, 154, 29, 28, 180, 74, 13, +69, 147, 96, 210, 108, 176, 89, 248, 238, 64, 140, 85, 196, 169, 20, 251, +238, 194, 41, 56, 39, 59, 226, 189, 130, 178, 90, 176, 226, 46, 108, 156, +204, 174, 85, 118, 165, 137, 184, 160, 133, 89, 170, 184, 37, 48, 65, 241, +224, 117, 164, 248, 213, 112, 143, 128, 23, 130, 133, 216, 66, 190, 63, 238, +179, 84, 71, 27, 50, 83, 199, 91, 126, 164, 192, 76, 107, 100, 229, 6, +25, 164, 89, 235, 117, 247, 61, 109, 205, 76, 128, 230, 41, 243, 85, 58, +189, 128, 216, 21, 53, 68, 80, 1, 25, 171, 203, 71, 176, 46, 6, 84, +35, 150, 95, 144, 144, 253, 210, 78, 10, 31, 218, 179, 248, 95, 81, 244, +79, 215, 63, 196, 100, 165, 120, 54, 14, 180, 125, 152, 106, 173, 125, 14, +108, 211, 161, 131, 229, 114, 56, 252, 16, 221, 16, 242, 74, 87, 168, 121, +127, 247, 212, 200, 71, 204, 116, 246, 255, 154, 24, 137, 127, 45, 177, 212, +17, 212, 102, 236, 29, 88, 177, 166, 135, 107, 210, 230, 219, 124, 71, 98, +50, 230, 107, 222, 79, 222, 190, 37, 241, 242, 167, 27, 117, 253, 201, 76, +251, 186, 18, 135, 96, 191, 207, 15, 107, 67, 146, 251, 105, 102, 25, 200, +71, 209, 165, 125, 192, 18, 228, 162, 238, 214, 221, 138, 49, 40, 100, 122, +249, 20, 121, 57, 199, 11, 0, 243, 76, 57, 23, 211, 110, 212, 250, 218, +95, 154, 145, 179, 173, 45, 233, 155, 246, 67, 35, 203, 93, 5, 2, 91, +121, 116, 93, 64, 69, 31, 182, 179, 74, 59, 198, 41, 19, 102, 51, 76, +126, 224, 153, 65, 254, 186, 90, 16, 91, 220, 154, 130, 20, 187, 103, 141, +248, 188, 245, 250, 139, 191, 48, 138, 40, 199, 201, 155, 147, 83, 62, 254, +80, 3, 107, 104, 36, 103, 186, 94, 186, 225, 107, 167, 118, 230, 199, 85, +241, 219, 139, 20, 28, 233, 5, 131, 144, 101, 21, 228, 236, 249, 115, 82, +62, 147, 175, 251, 174, 128, 176, 255, 248, 142, 239, 113, 165, 254, 238, 22, +99, 162, 202, 108, 79, 235, 246, 32, 220, 11, 51, 239, 109, 4, 204, 179, +212, 86, 38, 5, 232, 170, 76, 151, 131, 165, 206, 122, 105, 124, 107, 28, +137, 196, 99, 194, 6, 122, 29, 75, 178, 26, 232, 70, 33, 231, 24, 73, +33, 187, 181, 240, 75, 22, 114, 163, 98, 114, 6, 93, 2, 32, 16, 79, +93, 119, 219, 153, 15, 182, 129, 123, 242, 162, 182, 152, 200, 24, 14, 95, +48, 35, 60, 237, 71, 183, 152, 92, 134, 31, 82, 174, 53, 155, 170, 96, +221, 93, 137, 90, 31, 128, 20, 131, 15, 86, 154, 93, 190, 178, 124, 214, +130, 43, 64, 134, 249, 0, 48, 215, 92, 236, 202, 24, 47, 60, 232, 190, +124, 3, 71, 145, 183, 215, 240, 1, 100, 235, 203, 185, 205, 122, 222, 41, +199, 127, 4, 74, 57, 92, 80, 227, 109, 81, 197, 32, 38, 35, 53, 94, +245, 9, 141, 245, 223, 223, 95, 42, 175, 157, 209, 215, 90, 64, 0, 248, +244, 246, 25, 60, 7, 169, 138, 246, 184, 96, 155, 68, 94, 155, 22, 15, +241, 169, 20, 49, 215, 209, 111, 239, 200, 144, 5, 33, 153, 142, 239, 148, +110, 117, 109, 248, 67, 98, 109, 157, 187, 172, 160, 169, 85, 54, 0, 153, +129, 217, 150, 67, 124, 151, 101, 106, 131, 207, 134, 5, 255, 139, 146, 192, +0, 115, 91, 6, 129, 58, 60, 103, 106, 223, 52, 211, 102, 252, 153, 7, +36, 34, 32, 136, 111, 24, 231, 218, 101, 114, 49, 128, 185, 58, 235, 26, +108, 148, 216, 2, 109, 127, 76, 170, 230, 167, 77, 230, 144, 120, 234, 183, +78, 246, 204, 228, 134, 249, 88, 100, 196, 198, 168, 113, 216, 42, 35, 193, +234, 34, 195, 152, 125, 79, 79, 24, 161, 173, 16, 174, 46, 67, 170, 131, +156, 232, 86, 89, 173, 30, 39, 209, 177, 50, 137, 84, 109, 203, 25, 179, +105, 42, 151, 141, 56, 47, 146, 109, 175, 225, 243, 210, 206, 81, 196, 237, +159, 201, 165, 55, 181, 153, 69, 153, 117, 118, 217, 130, 65, 139, 68, 118, +59, 201, 202, 82, 129, 162, 23, 102, 61, 155, 109, 206, 125, 41, 111, 139, +83, 174, 133, 242, 44, 2, 235, 186, 58, 247, 99, 136, 173, 106, 250, 248, +34, 152, 133, 3, 208, 170, 129, 23, 60, 73, 212, 46, 191, 190, 88, 207, +221, 164, 178, 45, 215, 131, 204, 225, 117, 173, 138, 180, 3, 0, 15, 14, +221, 73, 184, 22, 167, 83, 216, 31, 137, 254, 108, 90, 21, 235, 5, 68, +143, 236, 218, 177, 170, 239, 180, 8, 168, 140, 226, 189, 16, 145, 62, 163, +225, 93, 205, 37, 120, 98, 129, 249, 129, 253, 213, 174, 200, 19, 143, 140, +9, 177, 50, 105, 134, 69, 113, 244, 133, 6, 120, 25, 155, 132, 254, 226, +207, 43, 56, 168, 69, 169, 95, 83, 166, 34, 69, 213, 187, 98, 243, 119, +143, 121, 249, 119, 129, 165, 103, 146, 140, 13, 136, 238, 160, 170, 253, 171, +212, 98, 239, 172, 195, 249, 68, 207, 60, 24, 130, 128, 167, 163, 178, 130, +220, 6, 139, 198, 201, 110, 26, 91, 155, 144, 143, 212, 85, 106, 50, 198, +74, 210, 168, 146, 232, 172, 30, 152, 206, 69, 44, 47, 88, 165, 180, 221, +45, 252, 248, 47, 26, 33, 142, 189, 77, 77, 20, 185, 247, 249, 88, 67, +117, 249, 151, 118, 57, 18, 137, 128, 189, 134, 148, 85, 7, 47, 60, 142, +110, 105, 252, 45, 165, 187, 134, 50, 255, 180, 56, 130, 137, 76, 189, 218, +152, 46, 148, 44, 1, 239, 47, 72, 192, 70, 14, 74, 90, 136, 245, 35, +40, 171, 29, 17, 97, 77, 184, 32, 38, 38, 252, 12, 0, 226, 11, 222, +132, 183, 121, 209, 83, 3, 164, 243, 32, 111, 109, 145, 203, 57, 241, 192, +5, 107, 164, 128, 3, 218, 69, 178, 200, 222, 45, 65, 105, 110, 115, 184, +75, 243, 221, 49, 226, 170, 189, 49, 246, 129, 33, 150, 38, 203, 3, 214, +111, 206, 150, 168, 137, 162, 228, 3, 96, 105, 184, 27, 106, 81, 32, 147, +230, 60, 219, 199, 176, 74, 100, 18, 80, 140, 70, 128, 115, 119, 111, 82, +172, 8, 6, 168, 188, 56, 197, 112, 159, 169, 216, 200, 90, 251, 104, 112, +19, 179, 71, 59, 181, 138, 224, 158, 252, 148, 50, 65, 55, 33, 120, 142, +137, 108, 20, 142, 236, 144, 89, 197, 190, 188, 19, 102, 227, 240, 38, 170, +129, 123, 69, 123, 193, 13, 37, 133, 44, 167, 210, 141, 172, 154, 208, 42, +156, 35, 126, 176, 1, 98, 193, 135, 102, 235, 229, 22, 34, 187, 18, 111, +64, 83, 107, 17, 157, 241, 117, 59, 8, 211, 60, 200, 87, 184, 89, 132, +249, 60, 18, 81, 237, 225, 53, 221, 131, 255, 218, 64, 239, 194, 7, 181, +40, 3, 46, 108, 220, 52, 108, 62, 254, 140, 37, 116, 15, 40, 169, 90, +47, 136, 102, 253, 7, 223, 132, 207, 60, 234, 21, 134, 155, 63, 112, 37, +72, 222, 55, 59, 20, 34, 167, 71, 222, 221, 164, 161, 92, 131, 244, 235, +243, 237, 184, 129, 77, 165, 160, 139, 171, 234, 234, 69, 113, 128, 93, 215, +9, 84, 41, 213, 35, 164, 24, 120, 204, 180, 178, 153, 47, 245, 57, 22, +175, 206, 12, 175, 203, 129, 39, 93, 127, 18, 12, 55, 43, 36, 252, 1, +104, 116, 59, 135, 193, 145, 183, 41, 62, 78, 165, 189, 232, 128, 224, 11, +142, 255, 2, 223, 95, 80, 219, 87, 249, 121, 31, 181, 50, 241, 31, 127, +174, 99, 238, 176, 116, 65, 220, 160, 189, 25, 204, 103, 20, 231, 42, 195, +34, 180, 105, 121, 110, 99, 149, 139, 1, 221, 124, 67, 172, 47, 189, 207, +14, 229, 79, 158, 187, 203, 126, 236, 14, 53, 121, 243, 132, 78, 39, 72, +7, 165, 22, 78, 41, 101, 128, 20, 168, 136, 198, 109, 226, 32, 135, 168, +104, 155, 115, 57, 50, 66, 17, 72, 245, 124, 70, 188, 194, 144, 89, 140, +85, 8, 10, 129, 227, 167, 15, 15, 201, 54, 239, 194, 154, 204, 129, 27, +190, 245, 102, 166, 178, 201, 7, 197, 78, 149, 69, 245, 4, 143, 4, 84, +13, 217, 59, 242, 223, 226, 199, 231, 118, 188, 55, 115, 56, 15, 217, 3, +0, 181, 190, 3, 162, 127, 120, 206, 181, 8, 225, 155, 148, 202, 117, 70, +96, 81, 246, 165, 253, 115, 148, 217, 138, 44, 203, 36, 44, 221, 59, 122, +68, 170, 248, 235, 88, 242, 209, 42, 71, 31, 117, 5, 149, 221, 216, 154, +116, 41, 231, 138, 123, 85, 128, 71, 109, 111, 17, 72, 163, 225, 109, 7, +40, 133, 74, 76, 155, 107, 34, 193, 114, 240, 61, 31, 24, 46, 215, 197, +96, 114, 213, 18, 214, 57, 119, 50, 18, 5, 175, 254, 21, 246, 64, 145, +171, 217, 243, 159, 250, 231, 228, 64, 164, 97, 61, 150, 9, 230, 11, 138, +132, 95, 209, 138, 97, 87, 139, 190, 171, 135, 158, 170, 99, 198, 18, 127, +44, 102, 1, 236, 90, 73, 214, 135, 116, 107, 247, 175, 46, 238, 51, 79, +163, 249, 5, 137, 145, 92, 138, 23, 207, 158, 50, 109, 131, 84, 61, 184, +252, 232, 20, 67, 107, 189, 61, 198, 27, 6, 189, 119, 34, 236, 94, 105, +65, 140, 181, 248, 32, 12, 119, 126, 0, 14, 226, 78, 7, 121, 111, 47, +30, 49, 206, 187, 125, 247, 235, 6, 229, 34, 161, 174, 72, 154, 37, 94, +8, 88, 125, 54, 182, 100, 46, 84, 144, 213, 251, 62, 71, 177, 120, 255, +194, 14, 105, 206, 151, 179, 144, 140, 191, 167, 248, 44, 70, 227, 154, 142, +32, 174, 159, 199, 154, 78, 165, 68, 96, 73, 8, 13, 246, 162, 155, 48, +7, 121, 90, 173, 40, 226, 166, 189, 35, 87, 225, 45, 209, 220, 70, 22, +156, 216, 39, 126, 84, 142, 207, 100, 219, 155, 166, 43, 253, 161, 255, 143, +148, 93, 17, 7, 109, 176, 112, 14, 87, 147, 186, 123, 32, 159, 252, 83, +111, 182, 250, 28, 239, 207, 92, 64, 17, 26, 216, 0, 41, 24, 142, 246, +19, 172, 32, 137, 234, 69, 147, 251, 234, 207, 95, 6, 113, 209, 107, 69, +122, 198, 148, 13, 18, 28, 238, 191, 168, 205, 144, 234, 181, 247, 192, 151, +176, 95, 157, 60, 224, 26, 120, 24, 16, 66, 102, 51, 185, 111, 39, 6, +205, 187, 16, 1, 141, 45, 234, 48, 144, 26, 92, 155, 213, 218, 88, 151, +0, 111, 109, 28, 44, 172, 24, 215, 205, 186, 42, 119, 124, 48, 41, 199, +85, 81, 244, 24, 170, 71, 156, 141, 249, 234, 193, 174, 77, 184, 47, 107, +112, 235, 124, 254, 7, 163, 156, 71, 59, 122, 224, 196, 215, 71, 81, 145, +207, 178, 97, 118, 45, 154, 109, 190, 143, 63, 83, 135, 110, 166, 174, 47, +195, 33, 0, 234, 212, 223, 11, 248, 210, 158, 17, 139, 239, 15, 57, 133, +185, 152, 71, 56, 2, 62, 10, 103, 243, 247, 182, 81, 10, 38, 49, 7, +131, 10, 202, 184, 79, 149, 84, 213, 122, 133, 208, 24, 141, 132, 12, 244, +251, 160, 41, 56, 219, 123, 120, 23, 240, 40, 29, 32, 213, 222, 36, 49, +173, 176, 11, 209, 145, 104, 154, 154, 182, 183, 5, 60, 131, 70, 224, 47, +125, 110, 47, 246, 180, 222, 125, 243, 251, 55, 25, 147, 77, 164, 116, 218, +152, 191, 244, 47, 199, 68, 208, 209, 49, 90, 197, 176, 2, 191, 127, 198, +48, 16, 168, 243, 41, 195, 50, 175, 33, 172, 92, 185, 254, 96, 221, 65, +24, 36, 187, 10, 104, 242, 101, 185, 176, 206, 215, 166, 82, 189, 245, 208, +62, 38, 207, 97, 192, 45, 46, 98, 66, 201, 69, 95, 206, 211, 204, 225, +137, 204, 100, 110, 58, 84, 29, 112, 144, 51, 15, 1, 170, 79, 41, 239, +77, 1, 208, 209, 80, 208, 214, 27, 168, 153, 229, 188, 40, 250, 13, 240, +23, 96, 54, 235, 23, 202, 165, 215, 109, 143, 163, 161, 136, 101, 109, 98, +102, 54, 231, 141, 157, 22, 5, 201, 89, 10, 241, 113, 225, 185, 234, 128, +212, 206, 186, 59, 114, 79, 69, 43, 171, 208, 219, 63, 219, 112, 54, 77, +156, 116, 150, 140, 113, 186, 79, 131, 109, 231, 205, 170, 253, 131, 97, 141, +107, 242, 5, 238, 167, 32, 135, 194, 143, 151, 71, 22, 81, 254, 84, 120, +103, 131, 61, 86, 126, 66, 51, 201, 0, 170, 70, 18, 38, 152, 225, 3, +117, 98, 100, 141, 114, 39, 161, 189, 146, 148, 43, 55, 189, 18, 157, 181, +185, 7, 117, 77, 56, 229, 91, 80, 233, 79, 165, 140, 24, 98, 197, 130, +50, 70, 44, 111, 230, 241, 92, 204, 246, 78, 19, 18, 231, 219, 201, 207, +84, 205, 137, 138, 113, 45, 4, 72, 145, 204, 3, 86, 230, 200, 208, 166, +218, 183, 217, 21, 89, 23, 40, 107, 161, 68, 230, 96, 236, 91, 106, 15, +38, 255, 132, 13, 248, 98, 106, 177, 223, 54, 247, 114, 82, 147, 161, 42, +43, 10, 192, 12, 94, 200, 248, 200, 85, 231, 247, 246, 201, 221, 180, 217, +113, 12, 222, 88, 53, 21, 6, 26, 214, 220, 152, 253, 92, 56, 158, 17, +233, 218, 95, 234, 91, 97, 71, 148, 11, 3, 226, 199, 250, 201, 132, 92, +244, 18, 210, 248, 212, 89, 182, 96, 73, 121, 250, 222, 59, 121, 118, 19, +28, 221, 126, 48, 119, 190, 217, 72, 194, 91, 4, 213, 17, 137, 34, 246, +7, 6, 143, 245, 97, 192, 252, 55, 145, 82, 10, 77, 111, 31, 80, 74, +156, 14, 68, 111, 82, 76, 168, 203, 9, 220, 54, 233, 175, 186, 169, 104, +243, 2, 143, 109, 213, 247, 163, 196, 181, 37, 16, 50, 218, 28, 129, 118, +162, 187, 98, 202, 226, 244, 39, 27, 90, 255, 235, 125, 98, 206, 155, 179, +211, 58, 135, 80, 97, 220, 32, 136, 18, 226, 60, 251, 51, 170, 165, 47, +4, 63, 160, 41, 105, 85, 23, 122, 32, 145, 69, 85, 159, 147, 73, 209, +201, 169, 25, 225, 164, 6, 151, 92, 9, 223, 55, 137, 202, 67, 221, 100, +161, 248, 10, 209, 195, 27, 146, 4, 219, 227, 190, 203, 134, 228, 10, 160, +34, 221, 250, 110, 203, 33, 186, 60, 136, 185, 235, 72, 45, 105, 176, 161, +36, 169, 185, 174, 168, 146, 23, 57, 128, 198, 162, 194, 197, 62, 254, 102, +200, 154, 140, 98, 40, 208, 128, 95, 151, 77, 40, 190, 88, 75, 156, 47, +207, 220, 11, 125, 159, 24, 89, 142, 60, 2, 156, 25, 44, 203, 39, 222, +166, 122, 93, 215, 91, 87, 57, 199, 69, 211, 244, 140, 241, 106, 43, 193, +10, 150, 65, 226, 163, 202, 165, 155, 93, 219, 207, 28, 174, 157, 201, 199, +169, 174, 28, 36, 117, 106, 155, 87, 209, 223, 171, 104, 72, 76, 180, 101, +196, 248, 163, 252, 150, 33, 224, 118, 128, 130, 145, 211, 28, 80, 17, 174, +33, 156, 108, 139, 120, 225, 111, 9, 46, 228, 79, 112, 121, 35, 181, 170, +12, 131, 173, 169, 4, 40, 8, 101, 34, 154, 227, 200, 57, 50, 118, 220, +128, 21, 208, 62, 131, 68, 193, 52, 163, 35, 96, 45, 225, 26, 219, 50, +194, 44, 22, 181, 83, 21, 82, 35, 100, 10, 241, 218, 12, 104, 240, 254, +190, 54, 48, 213, 87, 65, 183, 27, 232, 23, 246, 169, 179, 164, 55, 66, +70, 219, 7, 214, 128, 58, 244, 120, 52, 255, 213, 170, 81, 235, 16, 46, +18, 229, 186, 139, 118, 127, 12, 74, 173, 106, 171, 161, 3, 108, 3, 113, +211, 2, 88, 90, 227, 202, 196, 195, 69, 88, 168, 40, 87, 247, 210, 5, +26, 117, 159, 42, 3, 73, 148, 247, 236, 110, 16, 236, 169, 179, 22, 198, +32, 79, 138, 96, 70, 6, 161, 27, 71, 155, 241, 112, 60, 188, 51, 134, +154, 0, 207, 203, 43, 102, 88, 180, 139, 239, 72, 26, 46, 174, 76, 65, +14, 135, 202, 211, 124, 201, 4, 227, 40, 119, 46, 102, 23, 71, 143, 167, +164, 77, 192, 135, 16, 27, 148, 127, 123, 191, 209, 160, 49, 93, 138, 94, +161, 181, 205, 80, 80, 33, 73, 203, 45, 36, 194, 173, 86, 7, 234, 200, +138, 20, 62, 20, 110, 84, 16, 238, 207, 123, 175, 233, 40, 135, 51, 85, +136, 64, 204, 198, 207, 151, 162, 133, 207, 58, 246, 187, 201, 91, 185, 76, +46, 209, 173, 153, 71, 158, 241, 109, 66, 129, 109, 19, 70, 30, 186, 76, +249, 125, 197, 243, 223, 219, 16, 93, 134, 232, 59, 188, 42, 4, 155, 129, +236, 145, 166, 244, 222, 103, 3, 166, 145, 150, 57, 129, 19, 253, 157, 242, +66, 97, 165, 107, 87, 180, 245, 247, 47, 19, 34, 135, 219, 94, 76, 118, +156, 247, 148, 44, 142, 164, 20, 184, 96, 179, 138, 54, 39, 212, 235, 96, +215, 39, 45, 51, 215, 39, 47, 119, 120, 22, 197, 166, 158, 26, 115, 21, +16, 110, 23, 166, 132, 209, 232, 103, 248, 200, 133, 238, 224, 13, 50, 110, +33, 211, 154, 5, 239, 137, 226, 87, 131, 152, 225, 59, 208, 49, 204, 237, +81, 149, 34, 167, 46, 181, 121, 110, 31, 108, 226, 10, 80, 6, 47, 84, +180, 176, 86, 70, 171, 221, 85, 143, 172, 227, 120, 229, 75, 140, 133, 195, +176, 173, 92, 82, 179, 97, 115, 116, 236, 224, 70, 44, 166, 206, 23, 99, +0, 213, 47, 203, 153, 221, 178, 246, 196, 30, 74, 208, 100, 245, 85, 136, +132, 6, 213, 73, 199, 248, 61, 206, 141, 74, 61, 100, 181, 157, 51, 131, +95, 116, 217, 218, 162, 32, 136, 10, 115, 221, 65, 16, 223, 19, 163, 172, +73, 140, 97, 69, 67, 199, 116, 137, 251, 188, 106, 68, 78, 25, 225, 202, +40, 117, 161, 114, 10, 208, 29, 48, 217, 82, 234, 75, 134, 156, 9, 253, +241, 144, 22, 186, 139, 101, 111, 37, 72, 95, 33, 177, 20, 246, 210, 132, +1, 255, 84, 153, 171, 140, 222, 57, 86, 34, 181, 228, 39, 13, 158, 35, +57, 113, 16, 61, 97, 111, 39, 48, 192, 88, 102, 201, 83, 73, 113, 227, +116, 20, 73, 169, 135, 107, 8, 96, 250, 23, 25, 242, 51, 166, 29, 160, +169, 43, 239, 90, 254, 198, 209, 54, 249, 31, 217, 23, 118, 57, 192, 20, +69, 77, 50, 24, 34, 190, 166, 28, 181, 49, 126, 222, 133, 171, 0, 85, +212, 226, 94, 35, 11, 186, 253, 42, 162, 231, 111, 41, 53, 21, 0, 196, +211, 17, 73, 180, 211, 43, 10, 11, 169, 42, 217, 100, 220, 106, 211, 8, +68, 44, 65, 124, 214, 103, 198, 30, 191, 25, 71, 54, 175, 38, 179, 199, +70, 138, 97, 108, 255, 138, 125, 40, 227, 161, 76, 237, 137, 181, 151, 130, +199, 147, 50, 202, 63, 204, 201, 210, 176, 96, 34, 56, 67, 123, 183, 1, +76, 154, 235, 179, 216, 12, 117, 188, 46, 156, 252, 113, 160, 233, 197, 85, +136, 30, 248, 140, 12, 94, 134, 65, 86, 195, 234, 246, 91, 169, 22, 246, +179, 50, 9, 114, 221, 181, 117, 75, 248, 250, 178, 13, 27, 17, 253, 242, +46, 217, 38, 173, 41, 199, 29, 74, 40, 35, 68, 210, 208, 58, 180, 133, +244, 138, 113, 207, 34, 225, 122, 92, 111, 221, 183, 24, 150, 49, 7, 21, +66, 56, 58, 165, 114, 83, 27, 31, 48, 14, 6, 160, 66, 45, 64, 87, +184, 7, 29, 123, 248, 231, 76, 1, 133, 82, 122, 54, 198, 43, 143, 135, +5, 173, 90, 234, 193, 11, 13, 158, 200, 210, 235, 34, 16, 147, 34, 12, +162, 125, 17, 42, 120, 178, 254, 70, 247, 98, 239, 253, 121, 6, 228, 136, +142, 224, 84, 181, 244, 122, 130, 165, 247, 26, 40, 7, 194, 75, 69, 109, +154, 8, 69, 73, 19, 187, 93, 141, 133, 163, 142, 102, 230, 167, 64, 60, +82, 140, 73, 205, 221, 44, 139, 106, 67, 75, 232, 192, 201, 199, 198, 3, +138, 228, 140, 161, 212, 57, 55, 51, 94, 38, 89, 225, 92, 37, 239, 56, +35, 50, 203, 123, 145, 140, 62, 37, 78, 17, 223, 236, 211, 3, 152, 48, +200, 73, 18, 202, 203, 100, 185, 171, 51, 254, 143, 39, 141, 125, 28, 236, +179, 45, 234, 126, 20, 65, 174, 97, 241, 242, 45, 63, 49, 10, 137, 234, +137, 186, 225, 132, 36, 54, 195, 173, 21, 185, 163, 118, 125, 244, 66, 172, +145, 124, 242, 5, 21, 230, 51, 165, 24, 71, 157, 116, 172, 183, 147, 176, +148, 136, 88, 84, 10, 83, 22, 173, 67, 228, 17, 37, 136, 248, 234, 77, +233, 145, 111, 253, 31, 77, 212, 111, 222, 215, 46, 77, 29, 10, 192, 121, +17, 173, 70, 252, 53, 136, 16, 177, 162, 28, 113, 124, 181, 146, 235, 248, +80, 80, 242, 94, 21, 192, 162, 236, 21, 163, 244, 217, 15, 167, 84, 195, +43, 216, 220, 177, 69, 99, 35, 58, 217, 252, 195, 102, 13, 196, 105, 6, +217, 48, 209, 199, 143, 139, 51, 227, 180, 80, 148, 206, 183, 153, 31, 245, +60, 182, 205, 199, 153, 244, 232, 251, 209, 169, 42, 163, 67, 217, 181, 27, +57, 115, 107, 78, 192, 254, 236, 183, 230, 114, 42, 155, 19, 142, 83, 207, +172, 53, 20, 250, 2, 150, 37, 214, 186, 35, 8, 179, 170, 90, 214, 160, +218, 251, 130, 197, 24, 191, 23, 236, 227, 157, 3, 96, 32, 168, 173, 248, +215, 41, 14, 14, 80, 134, 34, 65, 108, 106, 46, 195, 150, 150, 123, 103, +56, 121, 202, 213, 107, 245, 191, 129, 192, 40, 90, 5, 30, 100, 119, 156, +208, 22, 206, 119, 48, 69, 54, 22, 230, 217, 97, 167, 114, 105, 155, 188, +78, 3, 170, 226, 209, 167, 147, 154, 90, 126, 193, 12, 253, 228, 165, 3, +31, 102, 106, 2, 235, 18, 39, 152, 173, 182, 194, 126, 183, 114, 202, 209, +32, 68, 98, 99, 185, 55, 21, 116, 89, 224, 79, 160, 166, 171, 39, 179, +173, 146, 79, 167, 36, 75, 195, 22, 248, 177, 97, 122, 14, 86, 234, 99, +20, 138, 252, 2, 31, 47, 191, 187, 136, 224, 233, 172, 28, 59, 77, 231, +124, 86, 67, 25, 9, 222, 119, 157, 29, 30, 166, 111, 107, 138, 153, 254, +26, 105, 243, 91, 208, 2, 249, 188, 40, 34, 138, 91, 32, 171, 246, 64, +57, 7, 145, 243, 155, 93, 228, 228, 158, 94, 185, 149, 63, 236, 176, 186, +35, 145, 171, 209, 213, 214, 1, 158, 143, 185, 33, 248, 84, 1, 91, 201, +0, 174, 112, 52, 165, 202, 24, 20, 234, 125, 255, 142, 35, 138, 21, 87, +157, 40, 87, 150, 222, 226, 114, 119, 127, 190, 123, 25, 10, 175, 20, 66, +35, 8, 253, 203, 17, 79, 239, 79, 49, 92, 111, 62, 64, 94, 150, 95, +50, 246, 19, 78, 89, 247, 4, 25, 146, 142, 201, 101, 137, 36, 179, 93, +80, 158, 144, 34, 248, 173, 20, 245, 180, 30, 132, 241, 10, 120, 205, 10, +200, 119, 195, 193, 48, 205, 143, 48, 53, 155, 242, 50, 99, 181, 154, 182, +44, 243, 5, 18, 121, 140, 60, 56, 141, 213, 156, 158, 122, 28, 125, 42, +152, 83, 47, 132, 16, 54, 246, 164, 123, 68, 237, 151, 20, 161, 128, 24, +251, 153, 36, 9, 100, 227, 235, 15, 204, 33, 69, 90, 175, 71, 200, 215, +24, 28, 136, 123, 224, 112, 205, 183, 171, 130, 119, 157, 87, 155, 55, 89, +50, 121, 143, 12, 118, 51, 131, 109, 111, 39, 194, 206, 119, 150, 89, 9, +199, 86, 88, 207, 32, 241, 141, 106, 11, 19, 241, 140, 74, 19, 241, 116, +186, 224, 216, 139, 83, 35, 186, 189, 122, 64, 168, 121, 63, 182, 101, 232, +152, 96, 4, 162, 191, 152, 73, 12, 240, 55, 51, 112, 218, 216, 129, 30, +39, 49, 209, 132, 24, 140, 22, 17, 216, 218, 120, 221, 248, 40, 169, 24, +78, 198, 219, 99, 86, 225, 233, 255, 239, 118, 13, 44, 190, 145, 152, 207, +101, 102, 168, 204, 212, 179, 109, 54, 101, 48, 155, 91, 170, 10, 87, 131, +49, 95, 165, 199, 62, 162, 187, 239, 186, 7, 225, 128, 178, 201, 39, 223, +213, 194, 202, 65, 216, 188, 204, 161, 53, 103, 200, 108, 56, 119, 205, 152, +227, 105, 8, 55, 99, 100, 226, 227, 206, 104, 172, 249, 126, 39, 185, 1, +243, 134, 226, 104, 36, 176, 242, 51, 27, 83, 252, 250, 219, 2, 201, 197, +64, 156, 102, 171, 172, 59, 35, 60, 154, 112, 32, 14, 252, 78, 91, 162, +54, 139, 223, 154, 97, 157, 236, 49, 33, 253, 67, 60, 100, 127, 204, 83, +235, 7, 217, 215, 136, 85, 76, 172, 161, 180, 54, 61, 43, 187, 207, 125, +50, 157, 246, 96, 159, 203, 17, 61, 26, 184, 206, 206, 232, 73, 32, 222, +252, 64, 156, 78, 140, 41, 121, 73, 222, 133, 72, 98, 45, 161, 172, 42, +230, 164, 248, 139, 255, 140, 84, 5, 244, 131, 158, 185, 177, 5, 27, 201, +68, 69, 37, 32, 11, 79, 15, 218, 201, 41, 61, 220, 82, 102, 143, 137, +93, 161, 93, 184, 133, 140, 9, 118, 220, 217, 184, 157, 227, 184, 1, 219, +35, 183, 183, 154, 195, 123, 59, 124, 166, 251, 151, 248, 83, 199, 158, 163, +206, 4, 131, 32, 69, 137, 93, 52, 213, 84, 219, 225, 85, 146, 26, 21, +122, 138, 108, 189, 93, 29, 36, 19, 127, 185, 251, 186, 134, 1, 139, 130, +148, 24, 147, 113, 153, 18, 156, 113, 220, 136, 99, 207, 16, 224, 118, 5, +125, 247, 223, 187, 255, 176, 45, 225, 100, 65, 230, 94, 247, 106, 236, 139, +48, 170, 135, 188, 110, 72, 245, 77, 229, 119, 121, 221, 117, 80, 161, 11, +83, 111, 104, 7, 16, 215, 200, 76, 70, 30, 235, 109, 255, 108, 51, 22, +39, 118, 166, 185, 10, 201, 25, 135, 139, 123, 47, 231, 94, 237, 44, 205, +224, 101, 159, 219, 52, 75, 219, 117, 127, 94, 37, 98, 166, 26, 218, 182, +135, 79, 97, 128, 47, 80, 11, 129, 232, 199, 73, 238, 20, 96, 73, 8, +13, 246, 150, 113, 16, 93, 29, 63, 99, 184, 127, 48, 184, 15, 201, 41, +8, 73, 20, 254, 186, 190, 85, 57, 106, 219, 50, 222, 245, 19, 1, 224, +126, 204, 176, 212, 46, 202, 253, 246, 139, 139, 157, 165, 224, 100, 16, 48, +50, 146, 146, 189, 215, 105, 250, 219, 7, 105, 27, 195, 58, 185, 223, 24, +132, 199, 121, 183, 28, 15, 242, 170, 196, 120, 116, 16, 197, 209, 226, 57, +221, 6, 20, 154, 98, 50, 100, 209, 68, 35, 57, 77, 168, 139, 101, 179, +73, 182, 158, 237, 54, 140, 39, 181, 108, 154, 139, 112, 185, 112, 88, 51, +125, 93, 26, 202, 77, 157, 48, 88, 66, 74, 64, 55, 153, 78, 123, 156, +171, 59, 43, 11, 142, 249, 137, 25, 136, 219, 244, 210, 117, 44, 156, 136, +80, 224, 236, 213, 190, 71, 252, 135, 37, 95, 7, 5, 28, 172, 241, 27, +217, 140, 19, 42, 138, 107, 71, 12, 75, 179, 112, 29, 129, 191, 9, 141, +179, 255, 1, 162, 7, 118, 105, 47, 49, 105, 44, 20, 86, 185, 2, 125, +146, 241, 159, 105, 176, 221, 115, 213, 14, 66, 202, 95, 250, 213, 43, 248, +176, 4, 46, 39, 84, 19, 186, 80, 242, 53, 182, 156, 3, 43, 8, 79, +88, 156, 127, 11, 247, 179, 199, 208, 251, 37, 217, 22, 207, 191, 128, 53, +160, 16, 159, 197, 19, 214, 240, 29, 193, 212, 73, 191, 244, 27, 189, 229, +99, 251, 254, 50, 42, 191, 199, 15, 149, 141, 81, 60, 25, 135, 120, 231, +40, 84, 127, 59, 150, 127, 45, 154, 135, 124, 109, 252, 186, 204, 98, 148, +162, 133, 10, 234, 232, 152, 88, 216, 54, 242, 206, 78, 160, 12, 78, 10, +228, 2, 238, 50, 9, 230, 116, 204, 206, 160, 9, 199, 12, 12, 224, 13, +153, 81, 51, 253, 140, 197, 148, 47, 192, 14, 187, 255, 216, 110, 141, 198, +35, 212, 244, 67, 77, 48, 87, 46, 46, 113, 205, 220, 81, 105, 109, 9, +248, 194, 100, 71, 187, 160, 9, 221, 178, 176, 119, 196, 36, 136, 12, 68, +34, 113, 221, 250, 250, 4, 251, 20, 137, 70, 241, 172, 178, 185, 214, 23, +55, 196, 31, 160, 76, 214, 230, 139, 192, 144, 120, 188, 225, 215, 132, 33, +105, 178, 83, 69, 92, 192, 112, 123, 221, 34, 7, 73, 145, 233, 56, 12, +67, 106, 152, 77, 143, 77, 217, 102, 6, 199, 53, 14, 162, 12, 134, 91, +59, 169, 181, 18, 47, 11, 206, 69, 65, 66, 27, 160, 98, 149, 22, 24, +53, 196, 119, 231, 84, 211, 246, 231, 218, 99, 120, 197, 151, 30, 153, 192, +120, 253, 70, 234, 253, 239, 34, 74, 6, 233, 149, 155, 214, 12, 127, 57, +92, 225, 201, 233, 116, 48, 226, 94, 159, 212, 78, 222, 99, 116, 29, 187, +3, 59, 167, 68, 108, 162, 146, 125, 6, 178, 230, 60, 158, 60, 85, 94, +113, 93, 2, 75, 195, 234, 66, 200, 148, 128, 50, 56, 58, 205, 79, 226, +11, 189, 189, 88, 32, 67, 83, 84, 188, 31, 180, 79, 252, 9, 177, 199, +53, 163, 66, 54, 110, 245, 174, 113, 225, 204, 180, 149, 6, 141, 18, 250, +150, 168, 229, 99, 107, 110, 108, 63, 70, 43, 146, 216, 64, 42, 3, 227, +146, 223, 233, 6, 140, 108, 238, 21, 245, 70, 14, 152, 92, 109, 138, 104, +200, 195, 248, 125, 230, 8, 4, 138, 125, 228, 221, 225, 98, 146, 230, 91, +225, 247, 207, 29, 112, 185, 202, 157, 218, 18, 193, 45, 54, 47, 215, 162, +29, 92, 95, 13, 88, 40, 129, 1, 150, 106, 203, 117, 76, 176, 157, 169, +61, 45, 201, 67, 35, 238, 149, 21, 174, 50, 162, 150, 120, 22, 144, 195, +187, 214, 239, 178, 231, 165, 200, 167, 170, 107, 98, 242, 205, 72, 113, 166, +163, 6, 197, 57, 210, 106, 231, 192, 17, 112, 77, 83, 171, 216, 127, 73, +143, 182, 224, 111, 104, 137, 123, 119, 52, 153, 42, 205, 161, 145, 174, 167, +38, 117, 130, 82, 31, 228, 102, 234, 30, 199, 194, 207, 73, 109, 64, 231, +55, 221, 65, 225, 203, 28, 113, 2, 120, 201, 22, 125, 211, 76, 82, 58, +75, 181, 33, 121, 189, 138, 70, 122, 155, 252, 133, 51, 35, 241, 193, 121, +148, 48, 44, 155, 123, 240, 9, 169, 145, 15, 79, 213, 180, 160, 30, 198, +225, 209, 186, 124, 186, 53, 240, 246, 13, 188, 52, 211, 221, 181, 212, 140, +143, 187, 178, 11, 181, 202, 78, 50, 55, 119, 228, 113, 120, 231, 184, 165, +122, 121, 94, 181, 222, 248, 225, 204, 245, 174, 205, 63, 219, 192, 246, 82, +101, 109, 115, 160, 153, 82, 131, 38, 219, 229, 58, 114, 205, 138, 141, 137, +237, 89, 94, 245, 84, 177, 166, 0, 38, 16, 173, 56, 248, 67, 55, 114, +252, 89, 251, 146, 93, 24, 104, 113, 181, 37, 164, 37, 158, 96, 137, 191, +214, 21, 51, 215, 58, 123, 111, 161, 116, 157, 112, 211, 188, 210, 52, 105, +219, 91, 213, 191, 133, 171, 47, 102, 174, 51, 170, 180, 10, 30, 181, 17, +43, 76, 13, 242, 136, 41, 45, 155, 24, 45, 79, 146, 218, 6, 107, 47, +142, 32, 141, 94, 165, 12, 149, 84, 170, 122, 202, 67, 130, 126, 39, 129, +244, 187, 19, 227, 22, 108, 234, 94, 98, 61, 155, 251, 228, 212, 43, 37, +254, 81, 222, 41, 67, 5, 225, 124, 53, 203, 111, 24, 212, 64, 17, 85, +194, 255, 56, 190, 115, 192, 203, 55, 170, 152, 187, 166, 116, 85, 66, 167, +213, 247, 129, 15, 118, 86, 104, 224, 195, 108, 109, 6, 200, 191, 34, 138, +117, 74, 182, 209, 18, 204, 182, 139, 184, 27, 107, 175, 14, 145, 155, 197, +251, 53, 141, 209, 98, 130, 230, 2, 91, 91, 90, 254, 131, 252, 91, 85, +39, 212, 73, 90, 57, 184, 144, 26, 163, 6, 32, 243, 234, 162, 234, 236, +167, 234, 73, 113, 50, 77, 165, 129, 122, 211, 6, 34, 194, 184, 29, 135, +226, 91, 114, 14, 96, 246, 243, 22, 200, 242, 220, 174, 227, 244, 168, 199, +197, 55, 114, 62, 215, 172, 58, 60, 82, 41, 205, 8, 107, 253, 62, 108, +122, 249, 78, 137, 39, 167, 14, 35, 153, 136, 62, 193, 211, 120, 49, 237, +232, 22, 215, 190, 132, 161, 250, 249, 174, 253, 90, 93, 210, 35, 222, 35, +62, 60, 204, 107, 63, 198, 121, 147, 68, 213, 75, 49, 50, 3, 5, 74, +30, 92, 119, 11, 223, 133, 222, 29, 233, 248, 93, 87, 194, 139, 84, 52, +214, 44, 146, 19, 241, 82, 204, 163, 154, 253, 130, 159, 88, 148, 116, 207, +29, 114, 117, 150, 154, 24, 81, 78, 95, 1, 208, 84, 197, 172, 141, 3, +107, 18, 192, 120, 196, 91, 30, 82, 90, 232, 163, 10, 142, 96, 198, 62, +126, 212, 153, 100, 207, 146, 122, 233, 92, 188, 147, 27, 9, 102, 204, 119, +209, 242, 71, 222, 108, 114, 249, 173, 59, 14, 67, 26, 104, 240, 136, 199, +70, 131, 39, 134, 18, 1, 152, 79, 224, 130, 104, 195, 179, 215, 90, 186, +244, 238, 12, 90, 181, 145, 75, 238, 84, 158, 111, 63, 187, 121, 152, 132, +167, 150, 138, 62, 203, 40, 70, 138, 154, 210, 37, 50, 226, 69, 253, 143, +26, 0, 243, 131, 5, 139, 79, 48, 48, 115, 122, 61, 71, 41, 1, 232, +239, 4, 96, 74, 209, 253, 128, 224, 222, 158, 97, 150, 16, 30, 132, 240, +199, 197, 118, 13, 71, 56, 160, 190, 35, 215, 110, 165, 254, 26, 69, 43, +195, 163, 30, 245, 138, 48, 80, 140, 245, 89, 83, 165, 65, 39, 20, 83, +115, 119, 111, 90, 202, 101, 172, 91, 178, 35, 17, 120, 45, 118, 91, 60, +189, 180, 133, 34, 19, 137, 152, 143, 16, 186, 214, 4, 46, 242, 23, 179, +229, 204, 55, 218, 22, 188, 5, 222, 140, 69, 195, 43, 31, 34, 159, 131, +53, 28, 83, 208, 158, 112, 163, 16, 61, 175, 3, 69, 113, 134, 174, 21, +125, 162, 91, 182, 251, 120, 17, 94, 100, 252, 199, 118, 35, 248, 64, 206, +179, 38, 121, 176, 84, 197, 9, 2, 45, 111, 244, 161, 250, 199, 130, 208, +167, 250, 0, 155, 57, 0, 95, 39, 206, 237, 5, 23, 58, 142, 137, 77, +164, 152, 219, 94, 57, 237, 16, 219, 119, 57, 58, 101, 189, 104, 205, 228, +28, 237, 119, 143, 99, 241, 5, 160, 115, 91, 215, 246, 198, 153, 60, 186, +64, 248, 126, 67, 56, 155, 179, 55, 102, 3, 47, 68, 145, 41, 209, 45, +148, 106, 11, 71, 191, 171, 245, 33, 6, 133, 216, 1, 109, 128, 56, 120, +247, 17, 169, 150, 173, 61, 111, 0, 65, 2, 95, 229, 63, 59, 185, 148, +213, 149, 140, 190, 57, 151, 163, 73, 9, 231, 250, 76, 126, 211, 12, 175, +14, 38, 146, 30, 102, 22, 124, 58, 137, 239, 181, 99, 176, 2, 184, 48, +196, 132, 248, 140, 90, 194, 95, 6, 90, 242, 171, 254, 189, 235, 8, 68, +244, 115, 89, 217, 10, 61, 172, 252, 75, 186, 117, 212, 216, 62, 253, 98, +156, 233, 96, 139, 55, 91, 251, 168, 221, 67, 231, 18, 140, 250, 38, 232, +143, 65, 220, 234, 129, 106, 184, 63, 171, 119, 96, 32, 9, 45, 151, 74, +71, 81, 162, 109, 58, 194, 125, 191, 169, 244, 9, 190, 37, 38, 98, 36, +238, 176, 38, 150, 30, 227, 0, 191, 60, 189, 0, 4, 178, 196, 238, 182, +233, 8, 126, 14, 236, 73, 100, 16, 150, 49, 26, 104, 152, 197, 132, 53, +229, 100, 196, 206, 7, 74, 91, 143, 23, 206, 120, 252, 52, 73, 161, 148, +41, 160, 137, 29, 207, 222, 13, 128, 144, 191, 162, 60, 24, 226, 187, 250, +73, 76, 246, 240, 31, 254, 109, 144, 102, 248, 207, 215, 44, 182, 29, 202, +54, 141, 107, 124, 239, 205, 243, 54, 158, 0, 148, 202, 98, 65, 233, 201, +60, 169, 34, 64, 81, 62, 205, 225, 228, 233, 250, 23, 146, 53, 104, 120, +68, 71, 179, 26, 156, 230, 25, 225, 235, 138, 20, 196, 223, 72, 176, 237, +67, 107, 202, 211, 32, 31, 184, 26, 178, 64, 134, 225, 115, 8, 227, 9, +200, 33, 31, 31, 58, 82, 251, 249, 54, 46, 60, 12, 233, 66, 222, 144, +243, 111, 110, 25, 117, 77, 108, 223, 211, 209, 23, 78, 162, 154, 77, 84, +251, 166, 89, 207, 45, 78, 51, 85, 18, 51, 14, 56, 9, 131, 186, 111, +229, 230, 11, 197, 196, 201, 184, 134, 147, 52, 14, 185, 145, 14, 9, 164, +157, 82, 3, 252, 42, 244, 140, 207, 189, 77, 13, 232, 248, 139, 10, 137, +30, 189, 91, 92, 202, 63, 249, 97, 212, 139, 39, 155, 251, 253, 10, 249, +13, 115, 238, 203, 112, 147, 186, 185, 46, 239, 51, 143, 148, 251, 163, 208, +254, 121, 240, 243, 22, 162, 47, 196, 44, 249, 0, 59, 127, 144, 82, 11, +69, 124, 76, 131, 231, 236, 169, 97, 172, 168, 157, 24, 17, 61, 108, 229, +182, 153, 0, 196, 23, 118, 40, 70, 167, 178, 79, 47, 113, 75, 93, 46, +135, 148, 121, 57, 20, 150, 28, 66, 210, 141, 142, 91, 131, 112, 239, 188, +35, 5, 181, 128, 2, 59, 120, 6, 228, 206, 130, 132, 104, 30, 219, 147, +82, 12, 48, 9, 98, 51, 34, 196, 135, 236, 115, 178, 10, 25, 8, 205, +28, 231, 140, 199, 224, 224, 162, 123, 88, 194, 202, 218, 116, 49, 233, 137, +112, 72, 235, 157, 125, 137, 74, 132, 49, 69, 232, 249, 247, 241, 47, 8, +112, 5, 72, 138, 149, 121, 2, 148, 204, 93, 231, 44, 129, 140, 149, 206, +104, 37, 208, 181, 86, 67, 122, 167, 114, 166, 200, 134, 180, 179, 139, 120, +16, 106, 171, 93, 58, 179, 175, 179, 244, 148, 36, 83, 171, 157, 182, 146, +111, 22, 0, 144, 110, 105, 47, 90, 236, 177, 47, 44, 35, 250, 237, 111, +141, 89, 6, 186, 22, 196, 32, 166, 23, 143, 17, 96, 127, 58, 139, 137, +29, 250, 164, 52, 141, 1, 13, 117, 82, 93, 241, 254, 120, 139, 165, 1, +114, 105, 7, 135, 180, 57, 252, 202, 233, 69, 253, 38, 11, 88, 223, 17, +203, 64, 162, 170, 127, 59, 163, 90, 8, 58, 149, 20, 214, 159, 26, 160, +120, 244, 123, 91, 203, 31, 86, 237, 20, 242, 66, 14, 182, 206, 127, 54, +119, 36, 182, 41, 129, 128, 193, 81, 19, 182, 120, 85, 23, 210, 220, 177, +202, 204, 102, 143, 81, 243, 233, 15, 67, 183, 157, 96, 122, 120, 130, 79, +154, 118, 36, 78, 152, 24, 123, 90, 86, 169, 200, 20, 29, 57, 210, 133, +16, 52, 24, 202, 20, 173, 101, 230, 61, 47, 105, 94, 244, 47, 217, 207, +87, 87, 93, 204, 138, 110, 8, 150, 200, 248, 129, 139, 134, 225, 34, 34, +150, 247, 70, 194, 144, 167, 21, 98, 161, 7, 38, 78, 3, 36, 42, 134, +161, 157, 203, 87, 34, 171, 28, 199, 64, 186, 130, 223, 103, 121, 88, 130, +50, 174, 10, 50, 79, 13, 92, 162, 99, 1, 85, 168, 122, 61, 132, 80, +85, 112, 238, 6, 179, 207, 162, 53, 16, 198, 250, 218, 206, 202, 242, 248, +31, 74, 86, 197, 133, 193, 36, 99, 133, 160, 223, 55, 36, 153, 101, 165, +188, 184, 179, 189, 36, 198, 254, 51, 199, 13, 116, 24, 10, 135, 101, 208, +166, 54, 107, 1, 166, 97, 38, 201, 45, 86, 218, 44, 163, 60, 173, 129, +69, 17, 204, 55, 85, 141, 80, 100, 88, 127, 108, 205, 65, 73, 159, 204, +216, 250, 240, 17, 121, 196, 196, 121, 46, 64, 25, 215, 88, 102, 221, 244, +35, 248, 96, 114, 66, 125, 134, 7, 83, 97, 0, 80, 166, 224, 216, 22, +213, 18, 42, 242, 126, 182, 81, 224, 10, 37, 193, 43, 174, 74, 159, 147, +58, 65, 217, 147, 110, 214, 95, 122, 174, 125, 121, 74, 66, 144, 74, 99, +52, 132, 104, 105, 139, 225, 128, 62, 1, 188, 7, 43, 185, 222, 134, 6, +216, 52, 211, 213, 83, 109, 176, 166, 152, 161, 48, 211, 124, 198, 241, 52, +237, 139, 155, 20, 233, 140, 55, 147, 68, 77, 166, 106, 81, 213, 250, 74, +125, 165, 213, 65, 147, 92, 31, 208, 242, 169, 90, 30, 239, 165, 143, 196, +85, 247, 121, 147, 38, 181, 170, 75, 30, 224, 105, 121, 27, 197, 246, 172, +39, 109, 6, 209, 42, 208, 13, 148, 153, 97, 247, 38, 168, 185, 76, 42, +102, 145, 166, 27, 242, 37, 136, 45, 245, 32, 200, 177, 225, 248, 154, 117, +172, 184, 37, 156, 208, 100, 151, 64, 16, 193, 254, 213, 205, 140, 207, 153, +64, 155, 57, 47, 237, 59, 231, 10, 130, 204, 72, 30, 17, 60, 76, 115, +161, 237, 104, 5, 38, 254, 90, 152, 208, 49, 194, 160, 243, 106, 78, 41, +251, 143, 104, 130, 180, 241, 98, 211, 238, 194, 224, 36, 242, 39, 109, 180, +67, 130, 210, 44, 8, 162, 150, 16, 76, 83, 40, 86, 97, 87, 187, 42, +50, 63, 35, 98, 192, 23, 138, 236, 90, 3, 157, 19, 5, 252, 228, 211, +239, 1, 85, 190, 54, 144, 218, 221, 184, 19, 89, 75, 138, 53, 115, 206, +31, 100, 99, 187, 80, 162, 222, 134, 167, 238, 117, 84, 36, 62, 178, 224, +147, 119, 160, 65, 244, 245, 157, 188, 184, 222, 42, 53, 188, 84, 51, 5, +22, 214, 229, 92, 249, 17, 78, 6, 79, 145, 92, 201, 53, 58, 45, 87, +90, 19, 194, 253, 18, 68, 87, 58, 48, 206, 85, 241, 173, 40, 0, 38, +75, 210, 227, 254, 150, 117, 168, 88, 41, 180, 31, 77, 239, 136, 37, 106, +222, 33, 63, 239, 217, 245, 29, 11, 255, 94, 181, 132, 91, 80, 152, 15, +224, 253, 187, 104, 191, 95, 180, 55, 108, 24, 65, 32, 27, 147, 201, 102, +102, 64, 245, 14, 196, 154, 169, 133, 191, 117, 49, 108, 75, 133, 72, 95, +48, 126, 1, 166, 187, 129, 223, 94, 96, 39, 225, 222, 196, 210, 129, 35, +24, 186, 145, 6, 173, 82, 67, 130, 97, 167, 138, 167, 57, 181, 228, 249, +247, 44, 29, 9, 140, 245, 49, 164, 210, 119, 91, 176, 15, 31, 206, 88, +229, 155, 23, 72, 114, 224, 237, 190, 194, 147, 133, 233, 170, 22, 64, 241, +162, 204, 52, 208, 138, 159, 29, 94, 25, 117, 103, 132, 232, 65, 198, 90, +183, 113, 6, 76, 52, 141, 199, 166, 170, 128, 199, 251, 60, 137, 86, 78, +52, 16, 72, 64, 112, 174, 67, 54, 73, 63, 55, 183, 30, 11, 48, 131, +7, 94, 151, 17, 166, 115, 62, 5, 221, 71, 30, 137, 35, 181, 250, 187, +68, 26, 187, 51, 202, 249, 76, 162, 63, 10, 144, 123, 119, 217, 155, 15, +214, 212, 52, 39, 208, 109, 210, 206, 230, 242, 186, 254, 170, 138, 52, 40, +130, 7, 102, 67, 28, 38, 106, 152, 122, 172, 184, 166, 81, 30, 236, 149, +213, 236, 174, 130, 140, 44, 143, 199, 9, 118, 58, 11, 30, 126, 139, 39, +128, 92, 83, 242, 207, 200, 157, 245, 147, 84, 207, 140, 120, 59, 56, 228, +145, 177, 130, 48, 139, 78, 101, 124, 42, 228, 129, 172, 14, 248, 144, 142, +189, 38, 158, 58, 85, 84, 75, 136, 180, 175, 13, 184, 0, 26, 128, 234, +151, 167, 40, 6, 163, 8, 23, 57, 69, 42, 89, 174, 50, 0, 216, 186, +166, 7, 143, 123, 95, 23, 26, 134, 127, 125, 199, 117, 26, 215, 129, 212, +119, 83, 2, 66, 96, 247, 126, 241, 49, 171, 186, 222, 146, 234, 115, 199, +123, 112, 79, 147, 53, 210, 95, 192, 166, 49, 137, 245, 80, 120, 14, 184, +242, 237, 131, 27, 141, 100, 178, 185, 54, 245, 152, 55, 243, 88, 45, 122, +48, 229, 214, 55, 118, 105, 222, 26, 189, 68, 42, 21, 34, 57, 165, 246, +109, 35, 84, 45, 76, 196, 116, 127, 88, 180, 10, 179, 103, 226, 208, 33, +91, 111, 12, 231, 221, 166, 64, 199, 93, 87, 58, 164, 108, 23, 126, 169, +216, 119, 68, 104, 24, 51, 156, 71, 175, 181, 93, 184, 124, 171, 34, 72, +115, 95, 148, 72, 166, 241, 178, 223, 36, 10, 12, 219, 50, 172, 139, 152, +26, 232, 185, 249, 95, 249, 8, 244, 20, 78, 136, 141, 145, 169, 168, 2, +208, 9, 30, 37, 50, 149, 47, 50, 17, 64, 214, 168, 32, 23, 228, 232, +31, 78, 219, 77, 8, 80, 253, 41, 79, 8, 123, 65, 234, 36, 78, 151, +23, 68, 18, 70, 10, 9, 9, 33, 142, 129, 115, 143, 191, 127, 209, 141, +202, 189, 55, 120, 16, 148, 184, 122, 178, 77, 10, 149, 18, 30, 6, 101, +53, 90, 155, 239, 253, 82, 57, 11, 125, 84, 7, 175, 116, 62, 210, 232, +112, 130, 253, 105, 153, 203, 31, 120, 251, 241, 45, 41, 127, 96, 146, 11, +187, 180, 115, 21, 63, 182, 213, 196, 175, 255, 162, 31, 233, 65, 197, 110, +42, 136, 54, 118, 234, 176, 3, 252, 83, 4, 107, 133, 19, 226, 34, 163, +232, 31, 39, 171, 178, 242, 36, 69, 64, 33, 167, 139, 81, 184, 160, 207, +119, 37, 137, 40, 165, 50, 167, 243, 188, 82, 142, 91, 2, 0, 209, 16, +166, 152, 134, 113, 185, 236, 253, 161, 120, 90, 94, 189, 81, 201, 224, 60, +66, 82, 23, 12, 199, 197, 86, 198, 16, 54, 174, 237, 121, 186, 244, 141, +50, 26, 152, 120, 78, 52, 71, 115, 40, 94, 156, 22, 162, 241, 219, 90, +212, 236, 21, 153, 170, 142, 20, 200, 251, 49, 98, 192, 173, 14, 167, 199, +167, 176, 235, 111, 61, 243, 30, 215, 35, 113, 127, 122, 250, 79, 162, 40, +130, 81, 31, 51, 177, 240, 9, 31, 192, 210, 151, 171, 78, 201, 50, 102, +227, 75, 196, 239, 232, 175, 240, 119, 205, 191, 180, 209, 68, 123, 86, 244, +114, 244, 209, 7, 35, 17, 16, 89, 133, 89, 42, 9, 18, 124, 21, 252, +101, 244, 88, 79, 214, 234, 145, 140, 52, 118, 47, 44, 121, 43, 14, 6, +157, 26, 16, 172, 252, 85, 94, 84, 59, 134, 19, 119, 10, 70, 91, 157, +246, 8, 74, 32, 15, 23, 230, 2, 205, 188, 103, 237, 92, 19, 88, 21, +147, 135, 117, 124, 107, 140, 39, 152, 51, 56, 246, 122, 153, 174, 106, 145, +140, 146, 78, 180, 243, 212, 62, 46, 3, 131, 137, 78, 56, 79, 160, 252, +117, 84, 126, 199, 194, 240, 227, 23, 188, 40, 206, 72, 68, 40, 58, 91, +183, 80, 40, 31, 65, 9, 70, 23, 34, 64, 199, 213, 138, 80, 140, 58, +202, 215, 115, 223, 92, 181, 218, 116, 252, 210, 190, 210, 54, 166, 241, 66, +132, 62, 98, 109, 158, 51, 52, 89, 69, 24, 171, 176, 235, 116, 175, 18, +111, 80, 167, 209, 170, 150, 194, 152, 23, 96, 162, 41, 244, 232, 80, 85, +76, 226, 126, 240, 196, 214, 81, 40, 183, 225, 102, 10, 166, 57, 231, 230, +232, 149, 164, 116, 112, 122, 0, 182, 53, 199, 252, 55, 50, 111, 243, 200, +64, 191, 29, 240, 86, 187, 126, 133, 121, 249, 249, 37, 58, 174, 209, 39, +152, 103, 151, 131, 127, 207, 154, 14, 188, 239, 28, 107, 33, 10, 57, 82, +158, 116, 63, 225, 29, 103, 80, 134, 84, 245, 37, 13, 1, 70, 95, 180, +82, 191, 0, 67, 243, 67, 218, 148, 30, 248, 160, 133, 92, 83, 190, 197, +251, 150, 117, 28, 178, 121, 17, 16, 209, 4, 188, 155, 55, 82, 134, 128, +3, 104, 142, 132, 144, 32, 101, 0, 223, 166, 79, 49, 108, 64, 231, 162, +6, 27, 94, 116, 68, 235, 168, 36, 115, 39, 191, 151, 28, 202, 228, 35, +90, 53, 172, 170, 173, 151, 236, 174, 197, 19, 85, 216, 192, 158, 128, 35, +6, 88, 21, 25, 158, 92, 18, 213, 22, 136, 119, 149, 124, 213, 103, 197, +6, 206, 174, 36, 196, 199, 208, 68, 57, 84, 28, 218, 251, 214, 75, 157, +254, 46, 61, 228, 188, 87, 93, 125, 155, 38, 175, 4, 36, 160, 31, 177, +70, 222, 245, 85, 246, 69, 109, 45, 77, 151, 175, 202, 23, 17, 139, 66, +77, 166, 155, 251, 82, 156, 11, 77, 102, 222, 20, 170, 255, 232, 162, 41, +73, 26, 89, 118, 58, 126, 212, 207, 108, 55, 5, 136, 150, 240, 223, 185, +103, 231, 115, 182, 189, 39, 164, 162, 182, 112, 113, 11, 93, 250, 108, 247, +231, 143, 172, 67, 223, 221, 224, 24, 116, 128, 119, 232, 143, 90, 27, 149, +49, 226, 195, 238, 66, 233, 15, 97, 137, 170, 155, 236, 124, 185, 95, 192, +121, 36, 82, 76, 249, 31, 46, 102, 185, 14, 243, 30, 244, 217, 184, 156, +156, 207, 35, 38, 89, 107, 212, 139, 75, 161, 16, 78, 232, 76, 209, 7, +92, 94, 80, 159, 58, 162, 138, 216, 206, 231, 93, 85, 198, 140, 90, 200, +170, 79, 118, 26, 52, 168, 111, 165, 224, 91, 45, 85, 42, 162, 142, 55, +0, 19, 167, 142, 86, 74, 235, 43, 230, 3, 162, 93, 33, 239, 43, 181, +253, 155, 106, 28, 48, 150, 43, 234, 102, 187, 247, 187, 40, 43, 158, 33, +48, 242, 214, 95, 182, 126, 3, 25, 218, 47, 163, 140, 217, 6, 221, 199, +57, 76, 182, 244, 110, 49, 168, 240, 129, 31, 226, 185, 35, 18, 185, 189, +2, 17, 190, 134, 137, 29, 76, 118, 48, 216, 33, 188, 103, 160, 66, 143, +23, 230, 255, 24, 238, 6, 111, 18, 214, 163, 244, 30, 36, 4, 216, 31, +162, 60, 127, 235, 203, 67, 34, 69, 20, 227, 220, 56, 107, 78, 81, 10, +160, 169, 19, 255, 211, 126, 46, 77, 46, 152, 46, 114, 135, 139, 23, 3, +172, 52, 80, 86, 11, 5, 190, 51, 86, 190, 67, 0, 75, 17, 160, 229, +12, 254, 152, 221, 3, 213, 220, 213, 244, 51, 157, 73, 251, 206, 213, 43, +113, 247, 245, 189, 52, 226, 250, 109, 212, 4, 168, 132, 24, 137, 160, 175, +219, 204, 156, 32, 253, 121, 8, 209, 200, 96, 88, 93, 66, 243, 84, 76, +148, 142, 229, 86, 31, 106, 10, 23, 136, 200, 132, 152, 150, 51, 125, 202, +13, 202, 63, 110, 38, 125, 12, 113, 17, 162, 92, 217, 24, 108, 235, 209, +81, 65, 202, 179, 60, 176, 11, 91, 62, 45, 126, 96, 9, 66, 153, 134, +11, 40, 231, 205, 66, 5, 249, 92, 99, 119, 206, 105, 108, 207, 79, 44, +61, 10, 179, 18, 7, 33, 15, 68, 204, 40, 214, 171, 223, 177, 98, 94, +176, 243, 165, 152, 231, 154, 1, 67, 226, 236, 109, 137, 202, 72, 234, 243, +23, 156, 41, 105, 118, 40, 72, 112, 147, 53, 76, 126, 158, 255, 145, 213, +214, 43, 241, 194, 125, 227, 104, 241, 196, 244, 237, 140, 214, 62, 210, 249, +207, 143, 58, 106, 182, 10, 75, 247, 114, 19, 127, 210, 217, 102, 190, 200, +149, 36, 59, 137, 204, 222, 223, 123, 63, 215, 84, 249, 49, 149, 83, 137, +205, 224, 192, 44, 166, 101, 109, 181, 98, 219, 17, 169, 186, 35, 11, 108, +131, 75, 185, 220, 58, 214, 129, 67, 15, 106, 220, 67, 76, 7, 247, 154, +201, 146, 25, 224, 51, 169, 180, 61, 73, 169, 216, 163, 64, 179, 144, 61, +184, 163, 163, 8, 113, 40, 42, 53, 46, 80, 50, 199, 156, 6, 138, 44, +86, 130, 12, 195, 251, 191, 99, 122, 127, 116, 155, 248, 205, 86, 172, 49, +197, 132, 101, 124, 32, 23, 225, 78, 252, 23, 182, 27, 10, 93, 135, 220, +98, 246, 62, 157, 134, 102, 1, 113, 244, 65, 39, 3, 106, 168, 22, 142, +16, 64, 140, 15, 80, 99, 35, 22, 179, 165, 166, 85, 100, 233, 90, 229, +18, 78, 92, 204, 255, 218, 224, 121, 218, 149, 146, 101, 90, 237, 209, 141, +172, 71, 193, 90, 175, 189, 165, 169, 88, 27, 15, 197, 225, 132, 32, 122, +215, 89, 92, 130, 175, 160, 186, 201, 20, 61, 64, 162, 133, 3, 43, 242, +1, 253, 252, 181, 136, 253, 218, 163, 130, 111, 36, 14, 133, 7, 219, 204, +145, 34, 32, 170, 193, 236, 151, 74, 74, 147, 76, 138, 107, 121, 122, 117, +158, 28, 246, 50, 255, 135, 138, 164, 17, 38, 164, 210, 75, 174, 116, 208, +146, 145, 163, 54, 161, 142, 104, 242, 253, 76, 97, 186, 92, 131, 69, 189, +217, 241, 225, 157, 78, 37, 78, 96, 220, 194, 3, 246, 214, 121, 178, 93, +26, 46, 165, 137, 4, 223, 97, 14, 94, 50, 52, 234, 50, 86, 69, 141, +165, 121, 202, 152, 37, 85, 22, 135, 212, 233, 30, 106, 208, 152, 10, 196, +23, 144, 2, 199, 18, 43, 47, 236, 83, 30, 54, 249, 7, 145, 116, 239, +36, 191, 115, 171, 101, 77, 39, 102, 167, 249, 152, 234, 193, 141, 24, 143, +254, 132, 241, 49, 221, 223, 189, 103, 12, 245, 20, 240, 213, 121, 152, 82, +69, 179, 192, 186, 6, 66, 56, 22, 22, 144, 240, 125, 87, 13, 248, 93, +108, 229, 245, 148, 14, 62, 131, 45, 100, 201, 63, 68, 118, 249, 66, 98, +132, 141, 74, 140, 20, 220, 81, 134, 141, 172, 190, 199, 149, 205, 93, 57, +45, 113, 240, 15, 161, 4, 122, 228, 28, 150, 220, 183, 88, 226, 51, 117, +6, 107, 122, 39, 165, 25, 15, 197, 199, 149, 157, 131, 214, 44, 253, 240, +247, 241, 139, 229, 232, 212, 218, 113, 23, 188, 132, 147, 250, 252, 14, 145, +7, 246, 101, 27, 190, 155, 27, 224, 20, 37, 63, 2, 54, 38, 5, 34, +186, 2, 107, 221, 161, 66, 248, 217, 63, 79, 202, 83, 53, 253, 127, 87, +252, 108, 133, 175, 14, 82, 140, 132, 150, 94, 234, 120, 120, 214, 32, 234, +53, 81, 60, 107, 255, 166, 188, 89, 153, 9, 173, 234, 85, 244, 11, 76, +217, 190, 22, 16, 147, 80, 23, 113, 126, 241, 84, 57, 134, 84, 152, 42, +97, 158, 176, 247, 138, 249, 54, 110, 103, 112, 170, 52, 238, 109, 27, 131, +137, 84, 37, 53, 162, 45, 12, 135, 228, 179, 197, 44, 163, 143, 33, 0, +125, 198, 45, 122, 93, 252, 148, 208, 163, 242, 99, 126, 195, 122, 247, 103, +141, 22, 208, 148, 113, 236, 210, 223, 57, 241, 128, 9, 40, 105, 207, 109, +69, 229, 204, 238, 98, 124, 100, 227, 17, 185, 226, 18, 119, 192, 50, 24, +98, 196, 187, 230, 224, 60, 191, 157, 41, 179, 95, 76, 153, 6, 217, 232, +93, 2, 110, 41, 148, 140, 203, 9, 156, 225, 174, 26, 16, 1, 182, 20, +242, 221, 114, 72, 21, 141, 226, 213, 200, 17, 198, 16, 100, 176, 216, 73, +240, 76, 6, 237, 78, 200, 119, 77, 39, 240, 158, 31, 148, 131, 187, 63, +232, 210, 64, 179, 250, 232, 53, 78, 40, 18, 89, 33, 39, 140, 209, 56, +112, 249, 146, 222, 7, 127, 161, 65, 146, 33, 146, 127, 56, 114, 32, 84, +80, 24, 112, 229, 230, 213, 94, 91, 148, 244, 109, 13, 157, 111, 51, 201, +173, 173, 66, 136, 150, 6, 111, 111, 154, 11, 17, 116, 13, 27, 209, 242, +59, 99, 21, 169, 222, 68, 72, 222, 164, 61, 217, 201, 53, 205, 33, 15, +141, 10, 80, 10, 215, 82, 125, 43, 165, 54, 184, 26, 151, 71, 203, 206, +50, 58, 57, 161, 52, 168, 22, 242, 179, 125, 111, 43, 91, 87, 3, 7, +126, 177, 54, 163, 148, 93, 255, 55, 124, 43, 141, 72, 166, 34, 147, 163, +135, 0, 50, 126, 152, 165, 1, 244, 118, 95, 96, 80, 4, 187, 206, 110, +239, 214, 183, 209, 125, 252, 40, 182, 126, 134, 2, 45, 182, 138, 179, 2, +102, 138, 101, 19, 92, 134, 39, 69, 120, 57, 190, 57, 130, 245, 73, 221, +23, 174, 183, 93, 28, 157, 42, 231, 217, 206, 139, 115, 38, 188, 129, 124, +12, 110, 89, 108, 132, 51, 142, 244, 135, 245, 251, 68, 128, 56, 218, 26, +248, 129, 34, 157, 167, 84, 138, 245, 95, 64, 172, 74, 9, 252, 17, 188, +73, 110, 229, 78, 230, 153, 231, 44, 191, 46, 126, 39, 241, 123, 223, 46, +47, 39, 69, 139, 118, 7, 184, 183, 166, 171, 61, 112, 200, 111, 196, 61, +123, 217, 188, 193, 102, 212, 105, 92, 0, 159, 27, 176, 74, 50, 250, 107, +68, 26, 196, 203, 239, 0, 42, 184, 35, 143, 14, 106, 172, 76, 147, 112, +100, 25, 215, 41, 170, 126, 95, 108, 218, 82, 36, 9, 116, 177, 182, 123, +254, 190, 56, 53, 125, 239, 66, 243, 145, 10, 61, 102, 57, 109, 197, 80, +159, 97, 253, 120, 48, 249, 97, 177, 2, 185, 153, 14, 201, 121, 165, 107, +133, 118, 248, 220, 68, 206, 96, 137, 154, 121, 215, 217, 189, 74, 76, 204, +222, 35, 222, 227, 83, 52, 77, 180, 122, 123, 184, 249, 212, 240, 22, 200, +136, 194, 206, 111, 120, 162, 253, 186, 155, 213, 149, 39, 97, 252, 132, 95, +70, 241, 47, 54, 19, 143, 188, 149, 148, 238, 161, 194, 121, 17, 93, 111, +133, 242, 201, 212, 183, 138, 152, 178, 37, 230, 140, 107, 137, 122, 163, 75, +5, 135, 225, 186, 32, 50, 131, 104, 197, 16, 87, 163, 180, 251, 170, 27, +181, 241, 85, 179, 126, 116, 219, 206, 79, 242, 5, 101, 41, 165, 80, 223, +66, 32, 68, 71, 88, 53, 117, 216, 209, 172, 112, 212, 129, 152, 49, 109, +61, 236, 79, 222, 156, 11, 239, 31, 202, 61, 123, 205, 58, 128, 7, 95, +27, 139, 135, 91, 119, 192, 187, 13, 99, 165, 103, 254, 140, 195, 234, 100, +79, 231, 154, 176, 233, 82, 214, 191, 60, 193, 53, 143, 213, 250, 131, 91, +40, 145, 225, 212, 106, 77, 201, 106, 185, 120, 141, 225, 195, 5, 110, 132, +235, 189, 95, 42, 90, 55, 194, 116, 222, 147, 91, 172, 175, 220, 232, 23, +95, 201, 4, 150, 102, 250, 23, 196, 86, 120, 28, 42, 188, 48, 46, 144, +66, 85, 124, 42, 187, 137, 212, 196, 230, 245, 111, 147, 204, 161, 63, 35, +100, 22, 144, 232, 208, 88, 101, 151, 10, 31, 210, 90, 1, 4, 202, 135, +120, 102, 81, 121, 189, 201, 44, 222, 209, 48, 188, 152, 108, 250, 65, 173, +13, 240, 1, 123, 109, 36, 163, 137, 172, 69, 250, 162, 10, 75, 89, 57, +102, 147, 77, 18, 93, 4, 104, 216, 225, 207, 229, 24, 57, 187, 228, 99, +218, 204, 58, 115, 44, 120, 209, 99, 200, 214, 156, 221, 139, 17, 131, 159, +164, 233, 160, 6, 2, 27, 15, 60, 204, 219, 18, 190, 164, 210, 203, 188, +34, 116, 36, 134, 101, 193, 75, 88, 189, 222, 245, 174, 203, 0, 199, 161, +57, 22, 4, 219, 77, 24, 36, 141, 70, 215, 219, 31, 92, 105, 10, 70, +102, 169, 244, 215, 230, 169, 88, 240, 157, 190, 5, 130, 186, 232, 76, 117, +45, 230, 181, 115, 67, 35, 172, 15, 165, 30, 125, 180, 57, 245, 25, 97, +244, 170, 182, 180, 107, 24, 231, 195, 140, 97, 50, 220, 220, 193, 196, 144, +49, 32, 90, 62, 206, 109, 85, 35, 135, 220, 249, 255, 78, 103, 207, 98, +156, 228, 213, 254, 22, 231, 247, 191, 152, 250, 37, 8, 172, 204, 136, 181, +30, 75, 9, 174, 226, 175, 172, 238, 237, 107, 27, 230, 46, 197, 240, 140, +162, 225, 65, 165, 249, 209, 49, 152, 19, 102, 96, 96, 206, 145, 40, 39, +155, 68, 8, 228, 176, 0, 112, 6, 27, 164, 12, 220, 185, 140, 95, 71, +202, 125, 234, 15, 246, 52, 206, 5, 103, 198, 6, 65, 12, 209, 87, 223, +121, 239, 124, 120, 128, 156, 194, 250, 239, 133, 247, 227, 76, 107, 73, 38, +228, 241, 33, 19, 61, 138, 70, 37, 45, 58, 239, 13, 176, 27, 17, 41, +202, 233, 62, 223, 175, 157, 36, 234, 192, 23, 180, 64, 61, 231, 103, 173, +83, 169, 241, 51, 201, 81, 67, 217, 79, 246, 203, 247, 233, 117, 253, 153, +252, 50, 54, 251, 120, 254, 215, 105, 168, 47, 128, 61, 139, 243, 91, 142, +166, 179, 26, 97, 65, 171, 167, 244, 114, 188, 192, 101, 23, 55, 115, 205, +222, 209, 59, 111, 83, 147, 188, 26, 163, 123, 244, 252, 98, 148, 104, 110, +81, 27, 167, 67, 200, 85, 251, 80, 163, 117, 36, 78, 137, 95, 34, 59, +163, 172, 164, 89, 247, 72, 64, 181, 41, 86, 255, 184, 158, 238, 185, 226, +70, 112, 123, 179, 3, 73, 1, 111, 110, 161, 49, 29, 112, 124, 244, 110, +238, 247, 14, 14, 76, 199, 159, 197, 179, 250, 244, 247, 85, 172, 56, 98, +70, 232, 99, 204, 226, 75, 121, 73, 239, 205, 191, 210, 74, 92, 4, 0, +234, 193, 196, 194, 173, 68, 44, 15, 40, 155, 166, 205, 197, 52, 207, 169, +123, 143, 5, 179, 234, 31, 202, 86, 56, 24, 233, 62, 121, 211, 133, 19, +209, 88, 32, 158, 85, 70, 85, 248, 249, 48, 225, 47, 86, 13, 128, 6, +140, 36, 31, 128, 58, 215, 176, 81, 129, 125, 172, 224, 209, 207, 246, 173, +207, 193, 22, 97, 60, 173, 183, 77, 253, 155, 18, 178, 36, 113, 186, 216, +70, 53, 47, 176, 176, 110, 88, 134, 81, 218, 164, 230, 45, 241, 27, 80, +100, 97, 7, 241, 118, 72, 200, 165, 187, 155, 190, 94, 40, 30, 205, 153, +71, 104, 141, 15, 220, 15, 153, 177, 200, 155, 239, 120, 101, 136, 17, 153, +255, 88, 163, 185, 221, 199, 216, 98, 69, 95, 59, 175, 164, 233, 253, 133, +225, 2, 156, 121, 93, 233, 11, 172, 164, 252, 66, 25, 59, 141, 195, 114, +131, 224, 50, 139, 227, 135, 240, 4, 171, 14, 206, 140, 207, 55, 211, 159, +135, 8, 193, 239, 233, 207, 53, 244, 238, 84, 19, 73, 1, 94, 104, 42, +148, 26, 3, 101, 198, 153, 239, 239, 34, 230, 253, 108, 6, 54, 59, 54, +252, 49, 86, 67, 90, 174, 196, 140, 239, 181, 64, 85, 11, 44, 9, 229, +249, 136, 72, 125, 199, 191, 242, 156, 145, 81, 70, 193, 44, 181, 133, 36, +211, 242, 30, 144, 244, 7, 89, 97, 98, 244, 61, 184, 3, 174, 101, 173, +221, 239, 145, 166, 225, 182, 82, 202, 76, 76, 150, 198, 93, 120, 100, 254, +47, 21, 168, 61, 38, 165, 48, 31, 76, 59, 37, 89, 106, 87, 203, 179, +248, 156, 162, 64, 50, 76, 5, 123, 113, 9, 215, 226, 23, 205, 44, 245, +117, 179, 251, 160, 106, 205, 130, 187, 253, 151, 224, 24, 32, 107, 210, 221, +62, 9, 133, 192, 119, 143, 232, 69, 204, 98, 5, 86, 121, 17, 245, 180, +249, 233, 48, 185, 56, 62, 20, 215, 140, 6, 220, 139, 44, 46, 180, 236, +215, 250, 81, 195, 254, 101, 135, 40, 135, 235, 141, 22, 183, 1, 31, 3, +89, 252, 87, 207, 58, 24, 161, 225, 28, 217, 174, 122, 71, 46, 100, 25, +85, 189, 177, 45, 185, 53, 210, 109, 222, 240, 244, 82, 75, 188, 17, 191, +45, 184, 220, 132, 105, 75, 151, 12, 5, 236, 148, 150, 10, 22, 199, 26, +143, 142, 159, 137, 87, 142, 70, 241, 67, 5, 15, 235, 87, 20, 224, 207, +210, 38, 60, 245, 34, 238, 108, 193, 204, 194, 179, 7, 131, 158, 63, 245, +255, 95, 34, 247, 63, 100, 39, 85, 51, 182, 220, 69, 125, 88, 223, 39, +160, 176, 115, 100, 232, 150, 20, 40, 205, 132, 231, 201, 97, 40, 66, 207, +53, 195, 39, 59, 4, 191, 140, 210, 66, 46, 104, 196, 64, 35, 22, 151, +210, 88, 220, 108, 96, 95, 175, 97, 70, 25, 90, 111, 112, 123, 106, 204, +22, 59, 106, 248, 232, 178, 149, 32, 36, 16, 254, 191, 202, 95, 177, 177, +116, 95, 213, 205, 170, 254, 96, 184, 233, 166, 10, 156, 95, 254, 105, 205, +55, 158, 61, 129, 215, 98, 230, 107, 3, 63, 157, 155, 207, 247, 157, 79, +254, 138, 189, 94, 248, 244, 152, 167, 111, 16, 202, 234, 81, 38, 253, 1, +180, 210, 24, 89, 184, 252, 85, 6, 35, 223, 9, 34, 83, 254, 224, 69, +138, 199, 37, 90, 24, 21, 136, 15, 51, 50, 30, 54, 216, 227, 156, 117, +242, 100, 52, 163, 89, 33, 164, 98, 17, 89, 176, 21, 155, 15, 146, 216, +86, 117, 168, 3, 121, 75, 252, 116, 80, 199, 162, 215, 74, 4, 31, 118, +186, 206, 249, 116, 221, 99, 65, 54, 33, 13, 78, 210, 35, 210, 53, 122, +190, 198, 221, 183, 134, 204, 79, 8, 25, 210, 188, 253, 85, 201, 46, 250, +3, 232, 208, 37, 12, 223, 72, 151, 148, 238, 168, 204, 252, 31, 1, 28, +118, 248, 170, 149, 73, 59, 32, 202, 101, 151, 15, 8, 189, 163, 217, 141, +150, 116, 65, 129, 166, 147, 54, 1, 66, 214, 228, 77, 76, 12, 105, 1, +82, 129, 123, 28, 50, 106, 239, 115, 189, 81, 165, 89, 64, 162, 72, 173, +162, 12, 143, 161, 42, 195, 52, 49, 79, 130, 231, 207, 125, 113, 21, 43, +184, 120, 97, 79, 162, 36, 125, 204, 253, 23, 235, 22, 87, 250, 129, 46, +51, 140, 184, 122, 5, 176, 91, 77, 121, 99, 94, 246, 217, 247, 181, 100, +190, 81, 43, 71, 97, 216, 82, 144, 50, 215, 72, 88, 136, 202, 167, 146, +20, 108, 111, 48, 8, 128, 77, 59, 179, 227, 116, 102, 106, 170, 123, 183, +150, 15, 20, 226, 177, 244, 199, 210, 225, 96, 11, 232, 230, 107, 230, 92, +88, 7, 200, 250, 162, 143, 245, 215, 194, 174, 126, 31, 145, 211, 158, 210, +125, 222, 86, 80, 105, 207, 96, 197, 240, 16, 121, 229, 16, 43, 32, 18, +97, 116, 249, 105, 53, 10, 109, 163, 226, 90, 43, 205, 27, 190, 20, 75, +5, 119, 97, 81, 100, 236, 30, 13, 42, 30, 148, 237, 225, 149, 35, 17, +17, 5, 142, 35, 250, 215, 197, 155, 17, 111, 145, 129, 53, 57, 0, 200, +249, 89, 176, 189, 1, 116, 36, 15, 140, 182, 95, 214, 143, 116, 235, 82, +165, 53, 192, 181, 183, 131, 106, 5, 142, 35, 31, 235, 177, 90, 203, 121, +167, 216, 165, 33, 47, 225, 21, 227, 222, 235, 82, 74, 195, 197, 215, 79, +205, 108, 145, 185, 88, 224, 207, 185, 43, 148, 199, 55, 206, 55, 53, 36, +83, 228, 15, 155, 240, 52, 139, 36, 169, 202, 140, 11, 148, 201, 100, 116, +5, 4, 93, 209, 255, 14, 104, 27, 30, 138, 224, 182, 136, 68, 27, 18, +127, 61, 231, 13, 79, 211, 129, 170, 83, 133, 121, 42, 201, 91, 161, 157, +93, 92, 228, 230, 85, 42, 72, 252, 142, 85, 49, 49, 90, 248, 105, 64, +101, 17, 183, 104, 71, 66, 88, 231, 243, 185, 127, 109, 96, 16, 144, 67, +137, 142, 51, 15, 176, 229, 195, 244, 121, 225, 235, 1, 47, 26, 187, 199, +29, 84, 42, 209, 192, 23, 24, 66, 139, 105, 59, 42, 98, 42, 59, 121, +42, 19, 252, 216, 83, 170, 15, 153, 227, 209, 242, 192, 84, 127, 225, 7, +106, 52, 122, 11, 197, 13, 114, 196, 194, 67, 217, 106, 201, 9, 33, 188, +44, 80, 156, 138, 13, 234, 189, 29, 240, 190, 247, 231, 194, 113, 145, 182, +63, 184, 81, 203, 88, 173, 43, 148, 126, 63, 55, 30, 179, 169, 8, 4, +211, 7, 73, 48, 152, 169, 65, 139, 239, 39, 42, 66, 67, 209, 4, 20, +102, 193, 58, 22, 155, 229, 248, 233, 99, 238, 62, 173, 71, 56, 43, 153, +129, 253, 161, 69, 87, 94, 50, 53, 1, 18, 167, 179, 253, 232, 5, 244, +180, 73, 202, 206, 199, 177, 156, 168, 144, 156, 112, 247, 187, 93, 121, 233, +149, 16, 80, 145, 67, 175, 57, 252, 185, 218, 56, 13, 0, 164, 160, 84, +19, 68, 168, 14, 89, 77, 225, 2, 14, 83, 124, 56, 55, 162, 229, 39, +196, 249, 27, 240, 90, 133, 241, 237, 79, 169, 233, 173, 143, 255, 36, 249, +166, 116, 116, 177, 216, 149, 224, 26, 64, 44, 177, 25, 5, 253, 13, 50, +65, 237, 15, 138, 43, 95, 108, 20, 129, 184, 138, 121, 110, 240, 91, 12, +102, 187, 183, 232, 196, 253, 140, 90, 174, 171, 9, 150, 159, 88, 97, 56, +227, 158, 92, 227, 209, 227, 137, 248, 248, 182, 167, 229, 110, 188, 85, 30, +74, 7, 72, 99, 106, 178, 181, 90, 248, 101, 59, 184, 64, 26, 188, 1, +76, 145, 191, 118, 78, 161, 90, 157, 108, 121, 235, 154, 90, 112, 236, 204, +226, 67, 193, 204, 136, 84, 224, 47, 165, 0, 44, 46, 226, 144, 113, 146, +133, 73, 73, 101, 61, 49, 183, 45, 136, 209, 10, 185, 207, 24, 241, 253, +134, 113, 248, 233, 113, 75, 161, 177, 2, 66, 216, 62, 176, 59, 4, 163, +90, 175, 96, 238, 243, 195, 62, 32, 61, 225, 75, 178, 126, 96, 109, 122, +231, 239, 180, 196, 203, 20, 193, 0, 203, 49, 146, 34, 127, 250, 192, 204, +89, 255, 86, 9, 155, 120, 161, 237, 64, 148, 50, 54, 120, 95, 190, 121, +93, 65, 125, 191, 202, 190, 16, 112, 191, 77, 28, 125, 90, 84, 128, 7, +218, 251, 177, 71, 144, 162, 60, 43, 217, 255, 49, 53, 101, 131, 42, 192, +64, 123, 188, 33, 217, 147, 248, 63, 75, 61, 69, 149, 248, 90, 112, 148, +132, 15, 114, 114, 66, 235, 198, 222, 166, 108, 140, 172, 248, 14, 252, 63, +158, 153, 145, 61, 115, 160, 194, 30, 202, 34, 18, 158, 139, 132, 175, 73, +77, 36, 10, 85, 156, 180, 44, 92, 245, 67, 124, 21, 55, 3, 181, 208, +16, 78, 144, 45, 150, 153, 171, 99, 203, 120, 102, 144, 205, 149, 16, 168, +245, 60, 67, 171, 105, 163, 74, 101, 197, 243, 77, 206, 187, 79, 125, 54, +232, 50, 99, 60, 209, 21, 224, 203, 240, 54, 5, 64, 190, 113, 52, 43, +114, 153, 57, 24, 246, 249, 67, 5, 116, 108, 167, 24, 152, 157, 145, 145, +184, 135, 9, 21, 19, 40, 208, 87, 254, 48, 249, 255, 162, 39, 75, 119, +20, 188, 245, 166, 23, 134, 69, 64, 7, 242, 184, 89, 17, 166, 36, 158, +76, 105, 235, 212, 75, 14, 179, 168, 51, 204, 42, 50, 187, 5, 118, 76, +173, 58, 155, 172, 195, 168, 44, 28, 129, 9, 188, 8, 114, 79, 57, 233, +150, 175, 36, 213, 59, 176, 207, 25, 10, 148, 80, 3, 116, 14, 120, 161, +233, 250, 36, 212, 116, 26, 203, 37, 129, 42, 24, 65, 190, 157, 65, 193, +132, 195, 181, 27, 125, 161, 237, 17, 53, 203, 32, 29, 134, 120, 218, 120, +84, 139, 39, 121, 244, 190, 167, 179, 165, 113, 169, 219, 31, 137, 86, 15, +43, 237, 99, 71, 43, 151, 167, 221, 182, 112, 157, 111, 40, 91, 133, 17, +87, 222, 83, 221, 39, 188, 149, 51, 45, 135, 104, 27, 148, 246, 248, 28, +160, 219, 125, 198, 41, 151, 206, 26, 167, 167, 94, 41, 105, 251, 4, 35, +251, 166, 1, 111, 156, 209, 126, 39, 93, 105, 234, 197, 64, 185, 177, 48, +182, 153, 99, 34, 27, 109, 126, 192, 183, 20, 117, 131, 209, 93, 37, 71, +96, 87, 4, 183, 52, 16, 4, 125, 12, 53, 9, 76, 104, 151, 170, 9, +186, 74, 152, 140, 173, 231, 52, 113, 11, 115, 6, 75, 62, 208, 192, 102, +71, 112, 204, 74, 206, 20, 82, 5, 153, 16, 194, 186, 179, 190, 170, 219, +251, 109, 24, 88, 223, 137, 185, 190, 217, 168, 80, 101, 210, 105, 223, 115, +124, 71, 91, 192, 48, 42, 206, 220, 14, 48, 3, 232, 99, 51, 247, 39, +146, 151, 148, 230, 92, 113, 123, 184, 124, 169, 55, 5, 249, 226, 156, 86, +81, 167, 144, 164, 169, 73, 241, 61, 56, 20, 247, 116, 172, 147, 170, 3, +6, 80, 189, 3, 220, 11, 62, 56, 129, 179, 145, 205, 91, 46, 65, 29, +114, 184, 208, 118, 239, 103, 33, 224, 177, 109, 150, 19, 19, 100, 136, 166, +97, 101, 168, 9, 7, 29, 143, 169, 93, 186, 76, 23, 3, 227, 93, 240, +235, 94, 195, 2, 46, 188, 75, 37, 252, 60, 62, 186, 250, 143, 133, 96, +127, 208, 127, 55, 176, 247, 232, 99, 196, 99, 197, 107, 162, 234, 47, 109, +27, 121, 66, 73, 160, 1, 52, 29, 72, 89, 252, 231, 65, 236, 250, 198, +186, 129, 21, 102, 98, 57, 20, 184, 221, 174, 48, 37, 11, 185, 123, 187, +102, 78, 92, 3, 69, 161, 222, 33, 150, 250, 117, 85, 118, 111, 4, 145, +242, 62, 255, 27, 48, 72, 87, 253, 32, 157, 130, 68, 63, 224, 223, 227, +29, 217, 177, 173, 61, 206, 34, 14, 205, 70, 161, 224, 28, 131, 197, 203, +105, 33, 178, 131, 144, 186, 147, 119, 167, 172, 7, 116, 52, 214, 52, 191, +16, 20, 138, 241, 150, 60, 17, 30, 90, 22, 144, 187, 227, 163, 134, 176, +66, 121, 14, 1, 232, 99, 93, 57, 25, 113, 177, 243, 126, 46, 49, 0, +67, 207, 198, 255, 38, 164, 52, 221, 52, 220, 90, 196, 191, 73, 33, 136, +99, 74, 195, 31, 231, 194, 199, 182, 140, 82, 157, 188, 8, 12, 81, 84, +107, 2, 2, 35, 89, 168, 58, 130, 16, 60, 88, 163, 212, 87, 132, 194, +194, 63, 187, 98, 243, 115, 64, 245, 175, 9, 218, 0, 32, 210, 197, 40, +166, 44, 15, 234, 238, 33, 153, 224, 250, 120, 51, 0, 227, 120, 219, 44, +30, 86, 64, 104, 234, 171, 137, 78, 125, 204, 253, 60, 134, 211, 218, 47, +15, 145, 50, 231, 108, 143, 126, 99, 80, 109, 242, 211, 146, 142, 83, 22, +234, 150, 48, 123, 227, 52, 208, 213, 137, 83, 217, 82, 43, 155, 212, 230, +162, 139, 107, 243, 220, 45, 253, 220, 250, 97, 103, 239, 54, 14, 22, 131, +74, 171, 99, 219, 98, 40, 216, 176, 158, 82, 250, 106, 254, 2, 99, 49, +56, 168, 119, 184, 140, 182, 116, 186, 29, 103, 223, 20, 9, 95, 6, 36, +28, 134, 90, 8, 57, 65, 158, 33, 238, 155, 61, 210, 236, 126, 109, 144, +252, 222, 44, 104, 106, 212, 140, 195, 31, 222, 141, 131, 55, 1, 160, 236, +52, 155, 170, 173, 154, 85, 238, 6, 154, 93, 244, 172, 20, 207, 3, 249, +143, 52, 22, 77, 100, 14, 227, 254, 35, 66, 27, 37, 222, 98, 7, 22, +145, 202, 214, 116, 214, 33, 222, 138, 32, 154, 51, 86, 104, 119, 28, 107, +68, 13, 217, 155, 196, 223, 205, 180, 94, 22, 149, 156, 167, 202, 45, 125, +37, 105, 207, 145, 26, 162, 155, 167, 7, 155, 51, 201, 3, 72, 182, 154, +209, 14, 197, 215, 140, 114, 186, 121, 172, 94, 77, 16, 142, 0, 103, 184, +23, 29, 55, 101, 211, 60, 229, 54, 78, 121, 246, 79, 212, 96, 239, 52, +182, 132, 42, 214, 208, 28, 48, 252, 79, 113, 145, 90, 110, 46, 145, 190, +80, 63, 166, 210, 77, 34, 111, 125, 51, 102, 10, 3, 194, 209, 9, 160, +15, 155, 36, 235, 142, 252, 125, 174, 44, 186, 78, 171, 54, 62, 14, 227, +191, 192, 234, 43, 84, 99, 96, 201, 1, 12, 101, 98, 237, 12, 249, 186, +148, 221, 17, 209, 11, 181, 148, 166, 177, 44, 162, 16, 85, 35, 214, 85, +114, 100, 249, 76, 82, 74, 70, 30, 146, 99, 230, 15, 157, 117, 154, 219, +131, 163, 193, 175, 216, 30, 147, 176, 224, 116, 82, 144, 224, 131, 249, 50, +247, 196, 237, 65, 178, 102, 105, 252, 20, 31, 166, 17, 217, 207, 140, 216, +254, 123, 59, 77, 17, 111, 98, 168, 210, 237, 76, 110, 107, 16, 100, 40, +46, 208, 81, 201, 160, 52, 137, 25, 180, 136, 37, 214, 173, 172, 95, 113, +210, 195, 95, 222, 172, 118, 119, 189, 98, 253, 123, 107, 18, 98, 111, 201, +224, 197, 109, 136, 150, 149, 5, 87, 124, 188, 37, 201, 73, 198, 26, 6, +62, 134, 188, 136, 206, 126, 101, 46, 234, 17, 202, 47, 135, 223, 57, 59, +53, 114, 38, 89, 31, 1, 76, 76, 238, 143, 11, 190, 30, 76, 230, 46, +162, 51, 0, 186, 207, 126, 107, 219, 156, 18, 104, 247, 158, 244, 145, 20, +84, 31, 68, 141, 55, 190, 221, 105, 102, 56, 81, 154, 125, 71, 123, 126, +236, 179, 81, 231, 220, 167, 119, 206, 115, 106, 59, 166, 166, 3, 137, 43, +56, 32, 5, 45, 215, 145, 162, 47, 148, 234, 114, 18, 3, 166, 248, 209, +117, 192, 103, 35, 83, 79, 19, 212, 230, 12, 128, 214, 142, 148, 173, 234, +212, 62, 78, 144, 8, 141, 63, 252, 255, 188, 27, 191, 132, 53, 215, 220, +19, 191, 75, 253, 145, 230, 122, 156, 115, 250, 73, 171, 210, 22, 233, 244, +91, 58, 47, 75, 68, 116, 182, 98, 182, 75, 66, 36, 159, 64, 205, 176, +102, 50, 237, 38, 107, 148, 58, 61, 64, 1, 249, 68, 75, 235, 104, 25, +228, 147, 233, 46, 25, 190, 118, 196, 34, 39, 1, 60, 201, 67, 77, 64, +9, 43, 0, 150, 41, 73, 57, 254, 211, 96, 93, 129, 231, 63, 12, 177, +106, 238, 70, 73, 87, 251, 7, 254, 51, 212, 34, 34, 137, 127, 209, 207, +70, 60, 68, 71, 74, 208, 119, 211, 153, 100, 173, 21, 178, 95, 113, 6, +103, 244, 204, 200, 141, 58, 156, 13, 21, 109, 169, 215, 206, 184, 10, 248, +214, 219, 2, 22, 108, 37, 247, 157, 102, 167, 253, 142, 139, 177, 62, 243, +59, 147, 69, 231, 150, 123, 177, 231, 224, 33, 29, 75, 184, 115, 143, 218, +4, 10, 125, 35, 50, 201, 143, 44, 175, 108, 206, 247, 152, 81, 249, 135, +221, 23, 132, 80, 104, 24, 6, 10, 208, 155, 97, 45, 9, 52, 29, 232, +152, 176, 75, 242, 241, 111, 128, 127, 144, 96, 159, 171, 73, 250, 52, 163, +43, 158, 232, 89, 227, 65, 219, 151, 153, 227, 61, 46, 232, 177, 170, 203, +237, 9, 253, 225, 222, 224, 200, 86, 146, 180, 104, 8, 15, 189, 184, 94, +177, 36, 57, 170, 206, 62, 47, 152, 67, 77, 106, 10, 26, 180, 44, 124, +175, 5, 81, 96, 215, 143, 142, 152, 61, 2, 81, 216, 66, 142, 216, 71, +8, 175, 245, 51, 144, 186, 166, 28, 230, 64, 159, 150, 90, 249, 65, 151, +10, 136, 91, 38, 146, 1, 243, 23, 141, 224, 125, 108, 4, 166, 186, 241, +55, 10, 202, 251, 230, 96, 252, 248, 197, 48, 29, 239, 129, 204, 184, 15, +10, 89, 130, 175, 144, 59, 155, 33, 171, 121, 32, 19, 252, 109, 220, 191, +115, 237, 37, 243, 233, 121, 122, 90, 250, 66, 142, 44, 35, 203, 218, 145, +243, 140, 28, 161, 213, 153, 231, 76, 138, 76, 251, 151, 7, 11, 64, 193, +73, 230, 191, 196, 153, 83, 5, 94, 107, 104, 1, 65, 203, 149, 153, 209, +76, 82, 60, 0, 21, 153, 63, 172, 119, 106, 223, 51, 212, 244, 144, 25, +25, 126, 216, 9, 93, 42, 46, 188, 134, 154, 195, 84, 46, 126, 128, 136, +111, 21, 90, 103, 219, 198, 39, 161, 53, 255, 151, 213, 105, 135, 115, 226, +94, 28, 48, 252, 80, 33, 60, 213, 206, 247, 191, 175, 195, 227, 118, 54, +185, 205, 195, 248, 11, 238, 202, 13, 236, 38, 182, 1, 1, 51, 111, 190, +234, 249, 87, 189, 234, 35, 148, 226, 72, 131, 77, 249, 214, 48, 36, 116, +58, 228, 77, 168, 222, 190, 115, 193, 157, 174, 213, 105, 120, 23, 98, 134, +22, 205, 150, 192, 202, 128, 65, 128, 85, 254, 99, 135, 227, 170, 80, 96, +234, 225, 173, 172, 156, 179, 234, 81, 185, 34, 227, 155, 41, 242, 244, 138, +148, 58, 255, 232, 63, 146, 184, 233, 157, 105, 206, 181, 53, 42, 165, 59, +77, 71, 206, 219, 169, 168, 246, 61, 114, 171, 147, 22, 101, 218, 92, 93, +58, 103, 80, 240, 152, 80, 137, 179, 181, 175, 203, 245, 111, 231, 4, 41, +158, 94, 224, 189, 172, 122, 97, 92, 93, 126, 47, 229, 239, 52, 225, 102, +38, 25, 61, 196, 121, 227, 94, 27, 148, 133, 61, 98, 247, 7, 82, 187, +159, 106, 74, 51, 245, 171, 42, 69, 188, 227, 34, 178, 136, 210, 137, 62, +86, 101, 8, 204, 106, 6, 234, 105, 133, 51, 69, 50, 164, 84, 182, 73, +94, 107, 10, 134, 19, 165, 111, 191, 145, 238, 0, 8, 188, 57, 123, 185, +132, 9, 169, 43, 215, 92, 74, 108, 176, 219, 88, 26, 227, 255, 172, 198, +175, 40, 106, 120, 227, 148, 24, 151, 195, 121, 182, 70, 177, 251, 105, 27, +168, 16, 142, 207, 176, 74, 47, 217, 161, 139, 28, 60, 228, 196, 246, 233, +249, 184, 212, 36, 196, 96, 125, 79, 197, 37, 17, 133, 251, 89, 226, 187, +232, 38, 238, 158, 183, 92, 96, 35, 3, 28, 247, 68, 111, 103, 174, 110, +81, 164, 146, 165, 195, 219, 114, 27, 207, 83, 255, 253, 126, 88, 242, 198, +111, 102, 218, 249, 114, 9, 153, 221, 223, 176, 188, 88, 17, 208, 46, 178, +238, 36, 253, 109, 224, 222, 79, 154, 125, 18, 200, 101, 116, 57, 1, 129, +97, 201, 151, 111, 183, 222, 140, 135, 114, 156, 95, 84, 178, 241, 159, 177, +112, 62, 25, 125, 115, 232, 102, 251, 62, 203, 14, 5, 150, 92, 99, 241, +219, 53, 250, 69, 48, 65, 141, 243, 130, 124, 225, 30, 176, 59, 17, 175, +145, 254, 49, 241, 235, 137, 226, 136, 42, 0, 251, 160, 205, 156, 192, 10, +9, 85, 55, 14, 59, 38, 172, 192, 24, 221, 66, 54, 237, 238, 147, 90, +228, 189, 22, 9, 220, 164, 100, 218, 76, 176, 128, 184, 136, 152, 252, 67, +162, 227, 119, 133, 5, 15, 108, 130, 165, 211, 24, 19, 34, 74, 234, 209, +206, 203, 5, 232, 5, 133, 92, 251, 111, 242, 81, 57, 100, 12, 116, 139, +189, 113, 167, 141, 181, 174, 47, 10, 105, 237, 10, 170, 195, 140, 245, 184, +206, 44, 7, 175, 182, 148, 159, 209, 239, 141, 192, 194, 7, 189, 225, 93, +37, 161, 90, 81, 167, 97, 32, 161, 12, 147, 110, 81, 128, 14, 78, 146, +252, 19, 252, 221, 57, 196, 233, 98, 192, 166, 49, 199, 150, 96, 30, 247, +169, 183, 252, 210, 201, 226, 23, 114, 193, 229, 123, 251, 93, 187, 191, 44, +195, 214, 222, 243, 9, 180, 215, 34, 89, 67, 220, 162, 195, 200, 67, 126, +247, 59, 142, 35, 82, 238, 128, 25, 51, 135, 152, 238, 100, 52, 59, 118, +152, 147, 111, 133, 138, 41, 196, 210, 24, 241, 10, 35, 73, 163, 94, 97, +181, 32, 144, 24, 172, 191, 205, 12, 25, 230, 108, 130, 138, 248, 164, 98, +141, 92, 99, 56, 180, 192, 55, 63, 70, 173, 164, 57, 26, 95, 135, 243, +255, 159, 211, 163, 47, 128, 71, 155, 98, 187, 81, 159, 191, 1, 55, 225, +241, 16, 174, 240, 168, 122, 37, 40, 97, 207, 157, 157, 176, 7, 252, 81, +133, 214, 128, 83, 249, 33, 72, 143, 4, 87, 8, 197, 231, 21, 222, 74, +138, 132, 149, 108, 102, 24, 221, 154, 83, 187, 80, 31, 7, 63, 116, 180, +169, 84, 202, 18, 188, 14, 118, 98, 166, 75, 244, 10, 1, 219, 79, 105, +163, 0, 249, 253, 96, 86, 201, 39, 97, 83, 83, 174, 48, 249, 73, 39, +191, 208, 168, 34, 67, 151, 254, 16, 18, 135, 92, 157, 224, 225, 41, 254, +45, 203, 41, 197, 216, 141, 15, 210, 33, 219, 67, 189, 220, 69, 50, 19, +79, 43, 75, 122, 1, 93, 44, 65, 197, 15, 29, 234, 39, 175, 233, 136, +5, 65, 123, 116, 109, 136, 63, 92, 59, 31, 158, 1, 40, 219, 158, 94, +39, 236, 207, 198, 124, 247, 209, 150, 168, 146, 27, 164, 80, 109, 251, 220, +101, 150, 29, 142, 44, 199, 71, 232, 27, 36, 118, 69, 230, 84, 26, 172, +252, 227, 46, 19, 35, 168, 239, 5, 15, 220, 128, 95, 212, 106, 205, 242, +56, 128, 9, 20, 28, 24, 33, 11, 177, 244, 110, 237, 131, 233, 183, 223, +121, 115, 90, 225, 223, 160, 83, 66, 136, 70, 58, 153, 13, 104, 136, 207, +39, 234, 129, 140, 247, 219, 176, 72, 120, 211, 185, 133, 118, 131, 212, 59, +186, 178, 199, 228, 54, 231, 97, 187, 224, 97, 237, 206, 215, 9, 22, 12, +12, 147, 21, 38, 165, 78, 149, 245, 145, 118, 103, 245, 129, 120, 5, 142, +49, 0, 211, 224, 239, 77, 114, 48, 172, 158, 171, 19, 224, 201, 82, 218, +78, 168, 91, 134, 15, 40, 187, 114, 42, 26, 8, 142, 211, 61, 233, 8, +155, 177, 147, 149, 232, 160, 1, 177, 135, 245, 144, 69, 22, 157, 156, 200, +109, 133, 201, 157, 212, 254, 134, 213, 191, 255, 101, 255, 20, 235, 105, 62, +221, 210, 159, 64, 246, 136, 181, 60, 41, 149, 129, 224, 46, 79, 173, 136, +105, 125, 192, 244, 16, 236, 172, 194, 247, 136, 160, 191, 219, 24, 101, 151, +204, 189, 254, 69, 160, 79, 84, 149, 43, 108, 90, 65, 16, 75, 49, 182, +29, 211, 188, 135, 145, 131, 108, 143, 97, 95, 38, 38, 244, 117, 92, 157, +91, 38, 118, 118, 134, 108, 123, 83, 215, 239, 228, 186, 45, 112, 202, 166, +127, 199, 80, 183, 251, 112, 113, 237, 49, 148, 92, 31, 54, 242, 208, 12, +47, 101, 74, 79, 19, 78, 122, 60, 125, 85, 133, 3, 52, 123, 236, 60, +62, 178, 101, 111, 91, 89, 228, 63, 62, 116, 53, 148, 71, 46, 153, 133, +244, 59, 87, 117, 171, 67, 182, 119, 3, 204, 215, 205, 128, 248, 11, 59, +34, 15, 115, 249, 177, 240, 198, 58, 52, 23, 101, 132, 118, 39, 181, 199, +49, 39, 98, 196, 23, 179, 199, 62, 65, 165, 246, 218, 161, 150, 163, 253, +94, 124, 215, 10, 245, 71, 135, 168, 59, 251, 229, 157, 39, 75, 179, 211, +83, 33, 172, 81, 2, 30, 222, 174, 66, 80, 11, 196, 187, 123, 255, 127, +187, 208, 236, 106, 88, 54, 93, 253, 37, 33, 155, 82, 26, 156, 57, 87, +148, 130, 44, 84, 207, 171, 200, 131, 82, 28, 61, 122, 155, 114, 160, 253, +29, 177, 50, 168, 100, 73, 18, 132, 92, 136, 67, 24, 156, 149, 164, 120, +109, 130, 170, 156, 164, 248, 104, 83, 152, 231, 211, 100, 78, 59, 170, 147, +101, 86, 254, 127, 143, 124, 178, 232, 35, 35, 243, 3, 220, 198, 182, 146, +71, 250, 50, 61, 152, 253, 101, 219, 219, 159, 58, 34, 239, 111, 144, 29, +8, 99, 24, 212, 123, 176, 171, 0, 132, 253, 35, 140, 166, 157, 68, 215, +217, 105, 78, 224, 18, 118, 216, 79, 227, 101, 59, 153, 27, 217, 243, 250, +193, 213, 100, 184, 69, 78, 229, 7, 144, 107, 5, 214, 223, 139, 123, 44, +140, 165, 131, 215, 65, 77, 181, 143, 101, 218, 198, 87, 47, 191, 10, 102, +231, 0, 239, 23, 128, 83, 11, 218, 62, 104, 185, 73, 211, 216, 40, 70, +231, 92, 187, 172, 255, 66, 159, 93, 156, 35, 172, 123, 2, 230, 123, 236, +241, 154, 88, 136, 179, 147, 174, 89, 50, 5, 158, 169, 128, 127, 215, 231, +82, 83, 159, 66, 241, 205, 103, 143, 20, 248, 239, 143, 31, 210, 249, 39, +25, 8, 8, 242, 111, 111, 188, 35, 190, 251, 17, 114, 164, 49, 24, 113, +159, 50, 115, 56, 190, 180, 91, 125, 237, 99, 116, 211, 36, 208, 115, 12, +73, 61, 99, 110, 81, 64, 83, 163, 131, 154, 211, 9, 165, 11, 30, 177, +177, 43, 241, 7, 108, 203, 224, 75, 25, 246, 160, 33, 148, 32, 131, 183, +190, 0, 219, 28, 208, 242, 134, 174, 91, 92, 51, 36, 240, 43, 139, 147, +101, 183, 51, 216, 249, 42, 166, 52, 133, 115, 249, 6, 240, 23, 27, 23, +77, 180, 40, 175, 240, 173, 104, 70, 137, 83, 82, 171, 155, 215, 136, 131, +4, 172, 19, 100, 255, 146, 160, 199, 128, 177, 130, 163, 56, 104, 107, 102, +44, 178, 196, 187, 0, 38, 53, 230, 191, 148, 218, 207, 105, 66, 106, 103, +52, 241, 119, 233, 63, 63, 182, 45, 101, 61, 210, 89, 175, 101, 98, 89, +172, 252, 236, 36, 54, 143, 131, 55, 35, 189, 128, 57, 73, 34, 229, 250, +206, 253, 43, 37, 53, 136, 172, 73, 221, 27, 205, 207, 21, 120, 92, 6, +220, 166, 66, 95, 45, 241, 209, 112, 72, 22, 31, 221, 232, 220, 157, 248, +78, 105, 214, 230, 41, 193, 211, 46, 249, 26, 11, 242, 42, 225, 116, 207, +166, 141, 116, 185, 223, 86, 218, 190, 255, 185, 250, 199, 181, 56, 188, 132, +37, 27, 85, 248, 112, 161, 182, 164, 153, 129, 40, 37, 13, 8, 67, 236, +36, 182, 151, 130, 96, 131, 65, 26, 103, 239, 65, 243, 234, 162, 7, 90, +237, 24, 99, 145, 47, 181, 99, 65, 38, 36, 112, 157, 239, 225, 127, 161, +168, 6, 66, 231, 252, 142, 154, 225, 138, 189, 243, 66, 142, 71, 61, 239, +55, 230, 59, 40, 224, 134, 104, 100, 189, 166, 249, 66, 91, 146, 154, 28, +67, 78, 138, 40, 114, 71, 172, 3, 168, 233, 9, 106, 228, 143, 56, 193, +227, 243, 144, 51, 222, 94, 224, 43, 79, 149, 212, 245, 52, 68, 200, 17, +235, 45, 164, 147, 62, 118, 52, 216, 195, 78, 13, 66, 190, 188, 241, 142, +234, 182, 85, 48, 148, 214, 123, 57, 223, 188, 229, 119, 169, 180, 193, 70, +250, 215, 249, 29, 88, 123, 88, 226, 210, 171, 170, 32, 80, 85, 3, 26, +219, 109, 97, 134, 11, 96, 118, 71, 130, 86, 182, 77, 116, 137, 214, 28, +140, 242, 227, 178, 167, 200, 214, 175, 107, 96, 132, 33, 40, 64, 93, 206, +90, 129, 132, 221, 170, 242, 113, 235, 251, 172, 193, 35, 58, 85, 70, 9, +75, 104, 71, 161, 99, 214, 6, 33, 204, 250, 172, 199, 33, 183, 246, 250, +109, 251, 50, 106, 114, 16, 134, 150, 19, 219, 21, 60, 63, 251, 204, 157, +45, 106, 233, 133, 154, 145, 135, 201, 77, 59, 178, 176, 217, 109, 236, 19, +19, 200, 5, 165, 235, 81, 14, 42, 153, 40, 189, 86, 92, 90, 239, 77, +53, 136, 65, 112, 94, 130, 104, 71, 55, 79, 22, 250, 34, 178, 14, 91, +24, 145, 250, 4, 197, 96, 72, 118, 142, 31, 83, 137, 14, 57, 115, 36, +202, 144, 10, 19, 123, 176, 23, 93, 35, 90, 145, 73, 163, 124, 66, 156, +8, 82, 243, 22, 204, 59, 77, 49, 222, 1, 246, 7, 75, 15, 234, 110, +9, 232, 29, 156, 239, 250, 88, 24, 244, 123, 15, 169, 66, 180, 254, 210, +233, 134, 27, 100, 162, 103, 158, 223, 149, 226, 167, 140, 53, 34, 57, 105, +221, 112, 116, 72, 207, 169, 98, 200, 189, 33, 72, 181, 162, 166, 4, 29, +98, 157, 184, 244, 188, 127, 186, 35, 186, 202, 24, 21, 185, 160, 63, 17, +112, 78, 96, 49, 87, 60, 154, 215, 49, 196, 179, 122, 60, 253, 154, 86, +177, 227, 70, 1, 80, 205, 58, 66, 103, 146, 170, 108, 34, 134, 149, 134, +160, 225, 152, 63, 18, 199, 101, 158, 199, 235, 124, 98, 105, 8, 62, 100, +92, 248, 81, 59, 108, 190, 156, 216, 106, 103, 90, 69, 199, 160, 21, 66, +203, 125, 157, 189, 8, 115, 15, 158, 77, 105, 124, 171, 180, 227, 134, 50, +208, 245, 254, 35, 231, 215, 231, 193, 218, 216, 68, 204, 229, 233, 95, 120, +177, 105, 108, 92, 9, 181, 119, 196, 19, 97, 5, 145, 254, 112, 156, 70, +9, 68, 39, 84, 33, 80, 2, 21, 228, 184, 145, 218, 19, 202, 231, 144, +3, 29, 22, 14, 146, 193, 90, 216, 63, 95, 197, 70, 198, 68, 235, 132, +16, 31, 100, 179, 19, 105, 19, 178, 210, 222, 118, 148, 37, 202, 50, 222, +84, 246, 89, 36, 25, 183, 80, 175, 79, 154, 38, 119, 89, 125, 133, 56, +21, 61, 187, 123, 80, 224, 187, 15, 84, 46, 19, 1, 24, 246, 250, 32, +226, 193, 49, 118, 252, 1, 47, 172, 161, 175, 60, 113, 56, 248, 198, 100, +117, 78, 138, 154, 40, 231, 118, 120, 23, 223, 8, 239, 145, 51, 43, 82, +146, 83, 129, 43, 146, 75, 171, 20, 186, 157, 174, 137, 205, 187, 198, 37, +10, 108, 65, 154, 212, 207, 63, 178, 11, 51, 5, 62, 172, 122, 219, 147, +16, 223, 243, 134, 146, 161, 173, 118, 113, 185, 212, 199, 29, 83, 5, 241, +42, 54, 160, 57, 100, 116, 111, 218, 193, 39, 66, 67, 141, 161, 179, 141, +54, 87, 16, 43, 15, 93, 41, 240, 62, 66, 231, 59, 42, 48, 46, 207, +141, 27, 160, 156, 247, 138, 129, 130, 68, 34, 66, 69, 177, 45, 108, 26, +36, 50, 109, 46, 238, 82, 187, 219, 166, 225, 115, 204, 121, 228, 122, 92, +65, 67, 69, 162, 104, 10, 117, 17, 33, 113, 110, 10, 9, 2, 41, 24, +227, 173, 49, 10, 2, 147, 115, 197, 93, 133, 139, 86, 38, 138, 102, 92, +17, 94, 115, 74, 101, 5, 12, 222, 186, 229, 16, 126, 16, 234, 105, 191, +184, 182, 27, 59, 152, 118, 179, 114, 78, 65, 15, 21, 43, 215, 7, 215, +110, 207, 152, 128, 14, 106, 188, 73, 230, 183, 23, 101, 92, 95, 250, 115, +245, 40, 58, 167, 157, 201, 1, 229, 233, 39, 243, 103, 253, 104, 135, 248, +219, 74, 127, 91, 135, 224, 240, 42, 6, 70, 70, 48, 23, 52, 78, 12, +212, 203, 55, 134, 108, 107, 185, 237, 129, 120, 234, 54, 243, 252, 231, 19, +190, 190, 46, 48, 115, 200, 145, 119, 195, 140, 122, 21, 85, 120, 189, 33, +208, 59, 39, 181, 57, 55, 128, 144, 149, 120, 65, 77, 113, 75, 203, 194, +251, 217, 77, 110, 56, 54, 93, 240, 101, 219, 52, 174, 163, 153, 193, 24, +16, 112, 103, 178, 252, 57, 2, 7, 55, 184, 80, 176, 248, 128, 236, 73, +250, 66, 218, 63, 16, 230, 149, 32, 149, 237, 199, 168, 81, 147, 63, 211, +251, 112, 223, 62, 92, 60, 114, 156, 203, 12, 225, 232, 250, 166, 123, 194, +227, 56, 82, 4, 104, 168, 170, 38, 93, 122, 232, 207, 228, 68, 58, 247, +162, 96, 128, 20, 249, 114, 93, 37, 199, 229, 152, 134, 168, 14, 212, 153, +137, 31, 241, 189, 163, 223, 247, 196, 22, 67, 27, 105, 10, 235, 28, 24, +177, 249, 230, 19, 247, 145, 228, 151, 195, 17, 201, 93, 226, 167, 76, 227, +85, 207, 200, 139, 37, 148, 40, 243, 214, 60, 55, 241, 183, 126, 160, 97, +6, 129, 104, 182, 207, 250, 77, 123, 235, 211, 158, 171, 52, 171, 186, 53, +121, 24, 137, 105, 164, 247, 172, 132, 201, 31, 135, 123, 0, 164, 164, 235, +167, 103, 63, 40, 54, 102, 46, 197, 185, 194, 14, 195, 159, 182, 120, 4, +36, 14, 194, 219, 155, 23, 233, 148, 169, 113, 158, 92, 103, 68, 247, 133, +214, 252, 9, 220, 50, 198, 251, 75, 34, 10, 115, 209, 172, 147, 168, 185, +81, 70, 174, 155, 80, 111, 246, 78, 199, 155, 192, 2, 241, 162, 123, 123, +77, 228, 101, 22, 241, 89, 245, 63, 3, 235, 76, 162, 20, 12, 81, 228, +254, 50, 146, 76, 149, 112, 226, 88, 231, 167, 229, 27, 250, 21, 98, 84, +235, 251, 213, 238, 209, 111, 34, 144, 181, 190, 22, 60, 112, 244, 98, 241, +19, 51, 163, 4, 198, 8, 50, 194, 200, 241, 155, 192, 97, 95, 173, 49, +94, 169, 112, 21, 87, 23, 229, 226, 75, 60, 134, 126, 21, 10, 86, 84, +238, 113, 19, 77, 205, 3, 158, 105, 241, 98, 86, 237, 233, 190, 97, 136, +202, 234, 147, 121, 253, 156, 176, 238, 222, 71, 35, 185, 127, 212, 211, 0, +86, 129, 131, 93, 111, 167, 121, 138, 69, 251, 4, 90, 229, 43, 48, 144, +138, 0, 48, 249, 202, 203, 46, 117, 175, 27, 96, 230, 119, 93, 156, 129, +186, 122, 133, 114, 160, 196, 50, 81, 97, 63, 13, 188, 146, 63, 4, 220, +222, 165, 9, 236, 124, 117, 145, 91, 244, 186, 233, 35, 78, 241, 45, 38, +127, 179, 165, 20, 253, 131, 171, 41, 230, 158, 162, 83, 50, 19, 23, 83, +128, 121, 67, 248, 17, 145, 98, 112, 190, 250, 237, 243, 248, 64, 146, 41, +16, 44, 154, 33, 60, 162, 161, 156, 229, 176, 172, 49, 42, 240, 235, 85, +90, 162, 151, 170, 183, 27, 21, 183, 40, 134, 187, 193, 75, 183, 76, 63, +235, 27, 90, 133, 26, 138, 83, 150, 77, 206, 233, 166, 204, 90, 125, 211, +133, 229, 10, 166, 12, 146, 184, 152, 107, 242, 245, 52, 145, 154, 34, 249, +13, 102, 253, 209, 20, 3, 225, 88, 156, 137, 30, 182, 206, 211, 255, 149, +39, 64, 133, 16, 125, 5, 115, 220, 51, 122, 242, 121, 222, 212, 239, 237, +208, 31, 72, 98, 36, 131, 185, 9, 124, 14, 55, 236, 196, 38, 68, 82, +17, 197, 255, 168, 199, 158, 94, 52, 58, 126, 100, 57, 118, 184, 214, 42, +65, 249, 156, 128, 82, 139, 234, 63, 119, 55, 89, 108, 207, 209, 226, 34, +198, 134, 54, 131, 154, 87, 96, 31, 11, 241, 1, 11, 97, 61, 167, 20, +223, 188, 163, 31, 250, 189, 13, 29, 196, 209, 218, 119, 102, 13, 172, 149, +149, 219, 251, 64, 238, 211, 212, 136, 82, 237, 150, 140, 188, 201, 123, 191, +83, 133, 193, 253, 25, 27, 246, 72, 60, 212, 227, 241, 209, 206, 142, 29, +11, 11, 146, 182, 203, 214, 25, 192, 236, 197, 176, 6, 216, 105, 145, 191, +115, 161, 107, 170, 194, 121, 148, 205, 65, 116, 157, 96, 173, 217, 30, 96, +174, 239, 178, 151, 121, 46, 3, 86, 65, 32, 120, 195, 66, 86, 144, 206, +91, 36, 148, 42, 216, 208, 164, 203, 149, 69, 230, 49, 78, 224, 177, 23, +175, 103, 191, 111, 181, 130, 255, 215, 189, 173, 134, 189, 64, 36, 226, 134, +89, 116, 138, 92, 81, 246, 202, 10, 243, 21, 81, 165, 210, 235, 49, 99, +217, 19, 184, 54, 71, 102, 132, 49, 135, 228, 156, 67, 170, 38, 173, 200, +239, 244, 255, 65, 211, 100, 161, 118, 111, 218, 219, 87, 23, 57, 9, 246, +102, 252, 157, 205, 98, 12, 97, 198, 183, 141, 223, 154, 23, 180, 123, 80, +156, 144, 231, 95, 42, 135, 31, 244, 164, 121, 138, 116, 154, 207, 222, 138, +32, 84, 185, 56, 114, 9, 244, 11, 213, 237, 166, 91, 31, 217, 20, 179, +168, 121, 139, 237, 181, 221, 90, 174, 2, 176, 34, 210, 130, 241, 130, 240, +178, 89, 176, 130, 185, 243, 52, 101, 116, 112, 6, 60, 84, 6, 110, 29, +246, 66, 10, 164, 130, 46, 75, 163, 179, 45, 250, 32, 57, 48, 74, 169, +133, 44, 167, 241, 103, 31, 119, 243, 74, 208, 4, 162, 17, 11, 72, 126, +10, 81, 117, 188, 103, 222, 163, 78, 206, 72, 216, 73, 2, 221, 230, 122, +107, 141, 126, 1, 236, 63, 51, 169, 160, 14, 165, 208, 174, 9, 91, 74, +252, 146, 198, 79, 238, 175, 39, 102, 75, 150, 40, 109, 143, 117, 77, 153, +234, 82, 38, 162, 23, 242, 107, 124, 217, 13, 51, 55, 92, 1, 28, 138, +62, 209, 69, 222, 63, 62, 150, 221, 74, 232, 220, 181, 21, 36, 203, 182, +193, 183, 173, 113, 157, 241, 208, 131, 172, 0, 176, 55, 229, 63, 54, 84, +197, 105, 196, 154, 60, 52, 50, 191, 230, 202, 129, 85, 235, 75, 245, 172, +58, 230, 0, 251, 250, 104, 123, 247, 224, 120, 118, 30, 50, 223, 144, 233, +243, 213, 58, 228, 124, 24, 168, 194, 24, 192, 4, 63, 107, 39, 55, 202, +196, 254, 149, 141, 189, 136, 218, 108, 203, 100, 198, 121, 240, 252, 208, 200, +230, 178, 117, 199, 2, 55, 165, 214, 210, 246, 142, 178, 63, 86, 249, 156, +100, 172, 202, 197, 148, 222, 76, 185, 221, 248, 71, 7, 231, 224, 158, 236, +27, 44, 53, 58, 181, 65, 176, 146, 223, 254, 5, 249, 207, 218, 160, 212, +245, 14, 114, 246, 153, 139, 55, 230, 89, 143, 125, 133, 103, 249, 123, 91, +229, 195, 214, 65, 251, 219, 11, 48, 167, 72, 9, 131, 110, 207, 244, 197, +159, 23, 51, 161, 135, 251, 220, 52, 242, 122, 199, 21, 231, 34, 185, 84, +140, 112, 3, 164, 231, 64, 162, 192, 103, 182, 162, 112, 2, 142, 22, 148, +62, 71, 79, 232, 85, 38, 15, 87, 230, 232, 112, 203, 94, 230, 172, 233, +219, 158, 246, 87, 61, 155, 22, 14, 157, 23, 61, 99, 196, 97, 70, 216, +173, 236, 211, 120, 197, 28, 231, 47, 215, 66, 71, 46, 66, 28, 29, 223, +77, 173, 144, 82, 220, 222, 99, 229, 74, 53, 88, 116, 123, 162, 240, 168, +216, 142, 205, 144, 183, 127, 135, 4, 162, 91, 176, 78, 26, 178, 249, 104, +195, 76, 105, 206, 143, 20, 158, 220, 22, 67, 201, 237, 78, 241, 56, 111, +63, 160, 240, 168, 131, 253, 62, 8, 51, 88, 43, 174, 217, 235, 243, 71, +50, 210, 7, 235, 56, 63, 128, 111, 32, 244, 187, 217, 170, 77, 152, 65, +7, 200, 30, 47, 83, 126, 139, 170, 142, 219, 184, 156, 54, 102, 249, 94, +32, 2, 204, 206, 77, 230, 60, 184, 143, 167, 110, 241, 203, 60, 44, 174, +128, 150, 186, 215, 218, 189, 87, 107, 216, 84, 76, 166, 171, 91, 23, 16, +208, 211, 181, 234, 61, 203, 224, 172, 128, 129, 66, 7, 249, 0, 75, 157, +235, 49, 244, 154, 157, 107, 205, 70, 146, 38, 188, 6, 218, 133, 231, 204, +168, 234, 133, 17, 245, 85, 253, 163, 242, 168, 56, 9, 99, 142, 236, 237, +67, 20, 226, 60, 4, 86, 83, 208, 243, 19, 127, 168, 6, 156, 67, 179, +66, 170, 242, 211, 170, 199, 188, 71, 231, 191, 67, 42, 109, 37, 117, 154, +231, 116, 63, 232, 206, 107, 141, 17, 127, 143, 79, 247, 160, 62, 151, 234, +116, 126, 14, 223, 8, 5, 52, 82, 8, 99, 17, 9, 7, 4, 208, 106, +11, 208, 156, 157, 85, 51, 236, 128, 41, 66, 99, 243, 220, 153, 131, 111, +78, 189, 95, 219, 51, 100, 41, 150, 188, 218, 35, 37, 176, 31, 122, 252, +207, 222, 214, 142, 95, 19, 136, 159, 195, 209, 39, 182, 19, 97, 185, 72, +83, 165, 208, 249, 83, 4, 244, 230, 30, 7, 13, 161, 90, 200, 121, 138, +67, 151, 252, 197, 165, 44, 215, 9, 81, 118, 179, 159, 15, 3, 156, 105, +151, 104, 109, 161, 202, 143, 199, 41, 187, 172, 154, 64, 105, 69, 67, 173, +226, 34, 234, 111, 69, 244, 45, 230, 49, 11, 18, 158, 56, 184, 55, 124, +46, 252, 215, 109, 236, 124, 156, 172, 148, 159, 44, 147, 129, 50, 49, 230, +128, 213, 137, 161, 125, 140, 222, 36, 90, 117, 223, 146, 237, 122, 39, 118, +188, 93, 11, 40, 49, 114, 230, 80, 31, 221, 58, 199, 174, 192, 112, 31, +236, 98, 56, 76, 27, 199, 78, 28, 48, 62, 246, 207, 30, 85, 50, 31, +4, 143, 58, 241, 131, 83, 203, 70, 241, 124, 150, 160, 88, 30, 227, 177, +213, 75, 139, 122, 83, 83, 41, 97, 140, 78, 157, 188, 172, 85, 52, 202, +76, 47, 145, 76, 126, 144, 228, 49, 239, 103, 196, 149, 203, 133, 159, 201, +215, 241, 71, 245, 114, 49, 125, 228, 22, 192, 235, 230, 246, 247, 100, 110, +76, 74, 214, 226, 221, 120, 140, 250, 108, 9, 203, 40, 92, 19, 184, 136, +86, 76, 250, 177, 64, 76, 214, 79, 190, 86, 8, 131, 178, 0, 200, 171, +245, 144, 94, 2, 236, 11, 187, 119, 165, 83, 130, 252, 49, 126, 254, 131, +38, 43, 245, 170, 53, 7, 183, 205, 84, 71, 16, 127, 86, 249, 31, 169, +65, 33, 207, 146, 111, 155, 43, 145, 85, 250, 216, 38, 95, 18, 129, 186, +14, 3, 158, 43, 183, 44, 205, 90, 37, 141, 27, 130, 115, 4, 121, 67, +113, 43, 109, 251, 71, 103, 32, 129, 163, 73, 116, 252, 32, 149, 17, 150, +117, 168, 218, 56, 163, 173, 125, 84, 103, 136, 195, 89, 46, 27, 45, 153, +6, 184, 81, 93, 131, 28, 42, 171, 87, 177, 135, 109, 24, 78, 80, 103, +110, 168, 3, 251, 165, 139, 171, 25, 77, 166, 250, 193, 166, 168, 195, 160, +12, 25, 110, 36, 0, 132, 247, 199, 195, 30, 177, 14, 176, 197, 58, 142, +93, 43, 151, 126, 28, 184, 231, 179, 113, 227, 26, 165, 98, 180, 183, 218, +182, 150, 125, 231, 102, 231, 206, 39, 57, 121, 193, 43, 11, 254, 173, 29, +251, 45, 171, 106, 87, 114, 38, 58, 153, 72, 84, 193, 36, 2, 142, 215, +121, 147, 160, 11, 37, 243, 213, 217, 181, 152, 112, 191, 155, 217, 136, 117, +175, 182, 125, 134, 218, 58, 212, 239, 39, 250, 119, 220, 113, 214, 143, 204, +124, 11, 153, 200, 158, 215, 253, 40, 35, 17, 232, 45, 217, 47, 191, 159, +199, 82, 41, 106, 158, 244, 222, 254, 133, 109, 151, 43, 187, 203, 165, 61, +163, 205, 7, 217, 12, 252, 123, 90, 255, 255, 88, 221, 122, 76, 173, 185, +85, 185, 33, 228, 226, 161, 72, 217, 34, 197, 140, 190, 18, 7, 142, 177, +203, 49, 93, 91, 12, 12, 29, 35, 100, 136, 58, 22, 174, 49, 71, 209, +218, 199, 125, 51, 110, 117, 45, 205, 141, 81, 192, 148, 211, 238, 218, 84, +227, 191, 160, 49, 110, 207, 190, 8, 156, 184, 167, 148, 228, 69, 19, 39, +3, 210, 204, 196, 230, 123, 64, 123, 133, 115, 33, 85, 15, 45, 144, 218, +31, 192, 34, 60, 208, 166, 113, 151, 122, 249, 171, 207, 8, 164, 207, 138, +246, 217, 251, 34, 27, 145, 144, 57, 60, 165, 203, 117, 199, 80, 141, 218, +36, 65, 24, 115, 33, 152, 139, 152, 34, 72, 99, 192, 219, 49, 65, 187, +217, 14, 208, 56, 62, 143, 12, 51, 225, 187, 38, 19, 114, 83, 118, 117, +17, 249, 224, 185, 225, 237, 71, 79, 67, 75, 51, 0, 92, 123, 155, 122, +154, 105, 101, 235, 17, 160, 35, 152, 108, 45, 151, 154, 92, 149, 63, 255, +77, 153, 104, 98, 208, 251, 112, 189, 38, 102, 205, 117, 255, 232, 150, 109, +51, 70, 5, 11, 224, 41, 141, 200, 227, 170, 1, 220, 34, 103, 112, 185, +169, 207, 141, 183, 172, 61, 129, 113, 126, 200, 59, 197, 93, 245, 240, 58, +232, 40, 90, 125, 37, 134, 210, 82, 118, 234, 200, 115, 169, 124, 188, 1, +172, 236, 31, 79, 211, 213, 146, 195, 206, 105, 57, 241, 59, 237, 145, 32, +6, 24, 253, 23, 60, 211, 2, 94, 42, 190, 180, 213, 177, 23, 167, 104, +3, 226, 171, 208, 95, 96, 57, 53, 141, 115, 88, 174, 10, 206, 234, 150, +182, 157, 242, 93, 97, 80, 9, 154, 152, 166, 94, 141, 238, 212, 68, 231, +244, 0, 36, 167, 2, 9, 169, 16, 151, 170, 33, 51, 1, 105, 210, 194, +224, 146, 221, 227, 137, 63, 144, 14, 5, 140, 30, 193, 203, 47, 90, 20, +233, 169, 66, 192, 91, 252, 161, 140, 67, 202, 12, 24, 190, 242, 46, 208, +121, 8, 194, 164, 164, 125, 216, 194, 242, 125, 131, 35, 5, 45, 18, 152, +157, 240, 35, 56, 246, 144, 175, 2, 7, 123, 13, 158, 168, 115, 221, 195, +54, 236, 35, 132, 246, 7, 100, 108, 120, 17, 23, 210, 61, 238, 38, 73, +149, 28, 249, 29, 5, 232, 28, 131, 84, 79, 155, 26, 82, 96, 150, 219, +122, 167, 231, 56, 233, 176, 154, 213, 126, 14, 155, 13, 68, 157, 25, 236, +244, 64, 125, 74, 247, 241, 123, 177, 102, 43, 244, 122, 173, 75, 132, 244, +248, 236, 246, 161, 138, 68, 86, 2, 52, 121, 232, 96, 100, 207, 238, 219, +64, 197, 162, 8, 97, 144, 89, 121, 66, 146, 166, 233, 7, 145, 217, 223, +51, 254, 128, 1, 211, 1, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, +48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, +48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, +48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, +48, 48, 48, 48, 48, 48, 48, 48, 10, 48, 48, 48, 48, 48, 48, 48, +48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, +48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, +48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, +48, 48, 48, 48, 48, 48, 48, 48, 48, 10, 48, 48, 48, 48, 48, 48, +48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, +48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, +48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, +48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 10, 48, 48, 48, 48, 48, +48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, +48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, +48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, +48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 10, 48, 48, 48, 48, +48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, +48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, +48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, +48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 10, 48, 48, 48, +48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, +48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, +48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, +48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 10, 48, 48, +48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, +48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, +48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, +48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 10, 99, +108, 101, 97, 114, 116, 111, 109, 97, 114, 107, 10, 128, 3 +}; diff --git a/source/blender/editors/gpencil/gpencil_buttons.c b/source/blender/editors/gpencil/gpencil_buttons.c index 760faf01b6c..53ef16a70a0 100644 --- a/source/blender/editors/gpencil/gpencil_buttons.c +++ b/source/blender/editors/gpencil/gpencil_buttons.c @@ -143,9 +143,9 @@ static void gp_drawui_layer (uiLayout *layout, bGPdata *gpd, bGPDlayer *gpl, con /* name */ if (gpl->flag & GP_LAYER_HIDE) - sprintf(name, "%s (Hidden)", gpl->info); + BLI_snprintf(name, sizeof(name), "%s (Hidden)", gpl->info); else - sprintf(name, "%s (Locked)", gpl->info); + BLI_snprintf(name, sizeof(name), "%s (Locked)", gpl->info); uiItemL(sub, name, ICON_NONE); /* delete button (only if hidden but not locked!) */ diff --git a/source/blender/editors/include/ED_armature.h b/source/blender/editors/include/ED_armature.h index 2e9186b6c2f..d345f16b768 100644 --- a/source/blender/editors/include/ED_armature.h +++ b/source/blender/editors/include/ED_armature.h @@ -62,7 +62,7 @@ typedef struct EditBone normal bones when leaving editmode. */ void *temp; /* Used to store temporary data */ - char name[32]; + char name[64]; /* MAX_NAME */ float roll; /* Roll along axis. We'll ultimately use the axis/angle method for determining the transformation matrix of the bone. The axis is tail-head while roll provides the angle. Refer to Graphics diff --git a/source/blender/editors/include/ED_image.h b/source/blender/editors/include/ED_image.h index 27c61e98e21..957b58b141c 100644 --- a/source/blender/editors/include/ED_image.h +++ b/source/blender/editors/include/ED_image.h @@ -66,5 +66,8 @@ int ED_space_image_show_uvshadow(struct SpaceImage *sima, struct Object *obedit) /* UI level image (texture) updating... render calls own stuff (too) */ void ED_image_update_frame(const struct Main *mainp, int cfra); +void ED_image_draw_info(struct ARegion *ar, int color_manage, int channels, + int x, int y, const char cp[4], const float fp[4], int *zp, float *zpf); + #endif /* ED_IMAGE_H */ diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h index 0562f400700..2148b0d04a6 100644 --- a/source/blender/editors/include/ED_view3d.h +++ b/source/blender/editors/include/ED_view3d.h @@ -266,8 +266,8 @@ int lasso_inside_edge(int mcords[][2], short moves, int x0, int y0, int x1, int /* get 3d region from context, also if mouse is in header or toolbar */ struct RegionView3D *ED_view3d_context_rv3d(struct bContext *C); -struct ARegion *ED_view3d_context_region_unlock(struct bContext *C); -int ED_operator_rv3d_unlock_poll(struct bContext *C); +int ED_view3d_context_user_region(struct bContext *C, struct View3D **v3d_r, struct ARegion **ar_r); +int ED_operator_rv3d_user_region_poll(struct bContext *C); void ED_view3d_init_mats_rv3d(struct Object *ob, struct RegionView3D *rv3d); void ED_view3d_init_mats_rv3d_gl(struct Object *ob, struct RegionView3D *rv3d); @@ -287,7 +287,8 @@ void ED_view3d_quadview_update(struct ScrArea *sa, struct ARegion *ar, short do_ int ED_view3d_lock(struct RegionView3D *rv3d); uint64_t ED_view3d_datamask(struct Scene *scene, struct View3D *v3d); -uint64_t ED_viewedit_datamask(struct bScreen *screen); +uint64_t ED_view3d_screen_datamask(struct bScreen *screen); +uint64_t ED_view3d_object_datamask(struct Scene *scene); /* camera lock functions */ int ED_view3d_camera_lock_check(struct View3D *v3d, struct RegionView3D *rv3d); diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 4948073f9c6..7ff69277843 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -831,7 +831,9 @@ static void ui_menu_block_set_keymaps(const bContext *C, uiBlock *block) if(but->optype) { IDProperty *prop= (but->opptr)? but->opptr->data: NULL; - if(WM_key_event_operator_string(C, but->optype->idname, but->opcontext, prop, TRUE, buf, sizeof(buf))) { + if(WM_key_event_operator_string(C, but->optype->idname, but->opcontext, prop, TRUE, + buf, sizeof(buf))) + { UI_MENU_KEY_STR_CAT } } @@ -846,7 +848,9 @@ static void ui_menu_block_set_keymaps(const bContext *C, uiBlock *block) IDP_AssignString(prop_menu_name, mt->idname, sizeof(mt->idname)); - if(WM_key_event_operator_string(C, "WM_OT_call_menu", WM_OP_INVOKE_REGION_WIN, prop_menu, FALSE, buf, sizeof(buf))) { + if(WM_key_event_operator_string(C, "WM_OT_call_menu", WM_OP_INVOKE_REGION_WIN, prop_menu, FALSE, + buf, sizeof(buf))) + { UI_MENU_KEY_STR_CAT } } @@ -2920,7 +2924,7 @@ static void autocomplete_id(bContext *C, char *str, void *arg_v) /* search if str matches the beginning of an ID struct */ if(str[0]) { - AutoComplete *autocpl= autocomplete_begin(str, 22); + AutoComplete *autocpl= autocomplete_begin(str, MAX_ID_NAME-2); ID *id; for(id= listb->first; id; id= id->next) diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c index 1f1228a9bc5..56f7fd04080 100644 --- a/source/blender/editors/interface/interface_draw.c +++ b/source/blender/editors/interface/interface_draw.c @@ -1511,8 +1511,8 @@ void ui_draw_but_TRACKPREVIEW(ARegion *ar, uiBut *but, uiWidgetColors *UNUSED(wc else if(scopes->track_preview) { /* additional margin around image */ /* NOTE: should be kept in sync with value from BKE_movieclip_update_scopes */ - const int margin= 2; - float zoomx, zoomy, track_pos[2], off_x, off_y; + const int margin= 3; + float zoomx, zoomy, track_pos[2], off_x, off_y, x0, y0; int a; ImBuf *drawibuf; @@ -1529,11 +1529,11 @@ void ui_draw_but_TRACKPREVIEW(ARegion *ar, uiBut *but, uiWidgetColors *UNUSED(wc off_x= ((int)track_pos[0]-track_pos[0]+0.5)*zoomx; off_y= ((int)track_pos[1]-track_pos[1]+0.5)*zoomy; + x0= (int)(off_x+rect.xmin-zoomx*(margin-0.5f))+1; + y0= (int)(off_y+rect.ymin-zoomy*(margin-0.5f))+1; drawibuf= scale_trackpreview_ibuf(scopes->track_preview, zoomx, zoomy); - glaDrawPixelsSafe(off_x+rect.xmin-zoomx*(margin-0.5f), off_y+rect.ymin-zoomy*(margin-0.5f), - rect.xmax-rect.xmin+2+(int)(zoomx*(margin-0.5f)-off_x), - rect.ymax-rect.ymin+2+(int)(zoomy*(margin-0.5f)-off_y), + glaDrawPixelsSafe(x0, y0, rect.xmax-x0+1, rect.ymax-y0+1, drawibuf->x, GL_RGBA, GL_UNSIGNED_BYTE, drawibuf->rect); IMB_freeImBuf(drawibuf); diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 525b15ac7e3..3a19bb2a90c 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -4388,7 +4388,9 @@ static void but_shortcut_name_func(bContext *C, void *arg1, int UNUSED(event)) IDProperty *prop= (but->opptr)? but->opptr->data: NULL; /* complex code to change name of button */ - if(WM_key_event_operator_string(C, but->optype->idname, but->opcontext, prop, TRUE, buf, sizeof(buf))) { + if(WM_key_event_operator_string(C, but->optype->idname, but->opcontext, prop, TRUE, + buf, sizeof(buf))) + { char *butstr_orig; // XXX but->str changed... should not, remove the hotkey from it diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index e4cc605e3f5..e31d7e39d89 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -444,7 +444,7 @@ extern void ui_draw_aligned_panel(struct uiStyle *style, uiBlock *block, rcti *r /* interface_draw.c */ extern void ui_dropshadow(rctf *rct, float radius, float aspect, int select); -void ui_draw_gradient(rcti *rect, float *hsv, int type, float alpha); +void ui_draw_gradient(rcti *rect, const float hsv[3], int type, float alpha); void ui_draw_but_HISTOGRAM(ARegion *ar, uiBut *but, struct uiWidgetColors *wcol, rcti *rect); void ui_draw_but_WAVEFORM(ARegion *ar, uiBut *but, struct uiWidgetColors *wcol, rcti *rect); diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index 84f0c61cd0c..a01efa25d19 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -1208,7 +1208,7 @@ static void rna_search_cb(const struct bContext *C, void *arg_but, const char *s if(itemptr.type && RNA_struct_is_ID(itemptr.type)) { ID *id= itemptr.data; - char name_ui[32]; + char name_ui[MAX_ID_NAME]; #if 0 /* this name is used for a string comparison and can't be modified, TODO */ name_uiprefix_id(name_ui, id); @@ -2742,6 +2742,11 @@ const char *uiLayoutIntrospect(uiLayout *layout) return str; } +static void ui_layout_operator_buts__reset_cb(bContext *UNUSED(C), void *op_pt, void *UNUSED(arg_dummy2)) +{ + WM_operator_properties_reset((wmOperator *)op_pt); +} + /* this function does not initialize the layout, functions can be called on the layout before and after */ void uiLayoutOperatorButs(const bContext *C, uiLayout *layout, wmOperator *op,int (*check_prop)(struct PointerRNA *, struct PropertyRNA *), const char label_align, const short flag) { @@ -2803,7 +2808,22 @@ void uiLayoutOperatorButs(const bContext *C, uiLayout *layout, wmOperator *op,in uiItemL(layout, IFACE_("No Properties"), ICON_NONE); } } - + + /* its possible that reset can do nothing if all have PROP_SKIP_SAVE enabled + * but this is not so important if this button is drawn in those cases + * (which isn't all that likely anyway) - campbell */ + if (op->properties->len) { + uiBlock *block; + uiBut *but; + uiLayout *col; /* needed to avoid alignment errors with previous buttons */ + + col= uiLayoutColumn(layout, 0); + block= uiLayoutGetBlock(col); + but = uiDefIconTextBut(block , BUT, 0, ICON_FILE_REFRESH, "Reset", 0, 0, 18, 20, NULL, 0.0, 0.0, 0.0, 0.0, + "Reset operator defaults"); + uiButSetFunc(but, ui_layout_operator_buts__reset_cb, op, NULL); + } + /* set various special settings for buttons */ { uiBut *but; diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index c535f2c1ad0..0c5aed83c1b 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -409,7 +409,9 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but) /* operator keymap (not menus, they already have it) */ prop= (but->opptr)? but->opptr->data: NULL; - if(WM_key_event_operator_string(C, but->optype->idname, but->opcontext, prop, TRUE, buf, sizeof(buf))) { + if(WM_key_event_operator_string(C, but->optype->idname, but->opcontext, prop, TRUE, + buf, sizeof(buf))) + { BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), TIP_("Shortcut: %s"), buf); data->color[data->totline]= 0x888888; data->totline++; @@ -2109,7 +2111,7 @@ uiBlock *ui_block_func_COL(bContext *C, uiPopupBlockHandle *handle, void *arg_bu uiBut *but= arg_but; uiBlock *block; - block= uiBeginBlock(C, handle->region, "colorpicker", UI_EMBOSS); + block= uiBeginBlock(C, handle->region, __func__, UI_EMBOSS); if (but->rnaprop) { if (RNA_property_subtype(but->rnaprop) == PROP_COLOR_GAMMA) { @@ -2299,8 +2301,8 @@ uiPopupBlockHandle *ui_popup_menu_create(bContext *C, ARegion *butregion, uiBut uiStyle *style= UI_GetStyle(); uiPopupBlockHandle *handle; uiPopupMenu *pup; - pup= MEM_callocN(sizeof(uiPopupMenu), "menu dummy"); - pup->block= uiBeginBlock(C, NULL, "ui_button_menu_create", UI_EMBOSSP); + pup= MEM_callocN(sizeof(uiPopupMenu), __func__); + pup->block= uiBeginBlock(C, NULL, __func__, 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; @@ -2361,7 +2363,7 @@ uiPopupMenu *uiPupMenuBegin(bContext *C, const char *title, int icon) uiPopupMenu *pup= MEM_callocN(sizeof(uiPopupMenu), "popup menu"); uiBut *but; - pup->block= uiBeginBlock(C, NULL, "uiPupMenuBegin", UI_EMBOSSP); + pup->block= uiBeginBlock(C, NULL, __func__, UI_EMBOSSP); pup->block->flag |= UI_BLOCK_POPUP_MEMORY; pup->block->puphash= ui_popup_menu_hash(title); pup->layout= uiBlockLayout(pup->block, UI_LAYOUT_VERTICAL, UI_LAYOUT_MENU, 0, 0, 200, 0, style); diff --git a/source/blender/editors/interface/interface_style.c b/source/blender/editors/interface/interface_style.c index 0e9dbaf3022..16b543737d0 100644 --- a/source/blender/editors/interface/interface_style.c +++ b/source/blender/editors/interface/interface_style.c @@ -180,7 +180,7 @@ void uiStyleFontDrawExt(uiFontStyle *fs, rcti *rect, const char *str, if (fs->kerning == 1) BLF_enable(fs->uifont_id, BLF_KERNING_DEFAULT); - BLF_draw(fs->uifont_id, str, 65535); /* XXX, use real length */ + BLF_draw(fs->uifont_id, str, BLF_DRAW_STR_DUMMY_MAX); BLF_disable(fs->uifont_id, BLF_CLIPPING); if (fs->shadow) BLF_disable(fs->uifont_id, BLF_SHADOW); @@ -243,7 +243,7 @@ void uiStyleFontDrawRotated(uiFontStyle *fs, rcti *rect, const char *str) if (fs->kerning == 1) BLF_enable(fs->uifont_id, BLF_KERNING_DEFAULT); - BLF_draw(fs->uifont_id, str, 65535); /* XXX, use real length */ + BLF_draw(fs->uifont_id, str, BLF_DRAW_STR_DUMMY_MAX); BLF_disable(fs->uifont_id, BLF_ROTATION); BLF_disable(fs->uifont_id, BLF_CLIPPING); if (fs->shadow) @@ -291,7 +291,7 @@ void UI_DrawString(float x, float y, const char *str) uiStyleFontSet(&style->widget); BLF_position(style->widget.uifont_id, x, y, 0.0f); - BLF_draw(style->widget.uifont_id, str, 65535); /* XXX, use real length */ + BLF_draw(style->widget.uifont_id, str, BLF_DRAW_STR_DUMMY_MAX); if (style->widget.kerning == 1) BLF_disable(style->widget.uifont_id, BLF_KERNING_DEFAULT); diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 8df43b92760..3a72c98e8f0 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -140,7 +140,7 @@ static void id_search_cb(const bContext *C, void *arg_template, const char *str, continue; if(BLI_strcasestr(id->name+2, str)) { - char name_ui[32]; + char name_ui[MAX_ID_NAME]; name_uiprefix_id(name_ui, id); iconid= ui_id_icon_get((bContext*)C, id, 1); @@ -181,7 +181,7 @@ static uiBlock *id_search_menu(bContext *C, ARegion *ar, void *arg_litem) /* fake button, it holds space for search items */ uiDefBut(block, LABEL, 0, "", 10, 15, w, h, NULL, 0, 0, 0, 0, NULL); - but= uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, 256, 10, 0, w, 19, template.prv_rows, template.prv_cols, ""); + but= uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, sizeof(search), 10, 0, w, 19, template.prv_rows, template.prv_cols, ""); uiButSetSearchFunc(but, id_search_cb, &template, id_search_call_cb, idptr.data); } /* list view */ @@ -189,7 +189,7 @@ static uiBlock *id_search_menu(bContext *C, ARegion *ar, void *arg_litem) /* fake button, it holds space for search items */ uiDefBut(block, LABEL, 0, "", 10, 15, 150, uiSearchBoxhHeight(), NULL, 0, 0, 0, 0, NULL); - but= uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, 256, 10, 0, 150, 19, 0, 0, ""); + but= uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, sizeof(search), 10, 0, 150, 19, 0, 0, ""); uiButSetSearchFunc(but, id_search_cb, &template, id_search_call_cb, idptr.data); } @@ -414,11 +414,11 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str } if(id->us > 1) { - char str[32]; + char numstr[32]; - BLI_snprintf(str, sizeof(str), "%d", id->us); + BLI_snprintf(numstr, sizeof(numstr), "%d", id->us); - but= uiDefBut(block, BUT, 0, str, 0,0,UI_UNIT_X + ((id->us < 10) ? 0:10), UI_UNIT_Y, NULL, 0, 0, 0, 0, + but= uiDefBut(block, BUT, 0, numstr, 0,0,UI_UNIT_X + ((id->us < 10) ? 0:10), UI_UNIT_Y, NULL, 0, 0, 0, 0, TIP_("Display 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)); @@ -1622,7 +1622,7 @@ static uiBlock *curvemap_clipping_func(bContext *C, struct ARegion *ar, void *cu uiBut *bt; float width= 8*UI_UNIT_X; - block= uiBeginBlock(C, ar, "curvemap_clipping_func", UI_EMBOSS); + block = uiBeginBlock(C, ar, __func__, UI_EMBOSS); /* use this for a fake extra empy space around the buttons */ uiDefBut(block, LABEL, 0, "", -4, 16, width+8, 6*UI_UNIT_Y, NULL, 0, 0, 0, 0, ""); @@ -1681,7 +1681,7 @@ static uiBlock *curvemap_tools_func(bContext *C, struct ARegion *ar, void *cumap uiBlock *block; short yco= 0, menuwidth=10*UI_UNIT_X; - block= uiBeginBlock(C, ar, "curvemap_tools_func", UI_EMBOSS); + block= uiBeginBlock(C, ar, __func__, UI_EMBOSS); uiBlockSetButmFunc(block, curvemap_tools_dofunc, cumap_v); uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, IFACE_("Reset View"), 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 1, ""); @@ -1703,7 +1703,7 @@ static uiBlock *curvemap_brush_tools_func(bContext *C, struct ARegion *ar, void uiBlock *block; short yco= 0, menuwidth=10*UI_UNIT_X; - block= uiBeginBlock(C, ar, "curvemap_tools_func", UI_EMBOSS); + block= uiBeginBlock(C, ar, __func__, UI_EMBOSS); uiBlockSetButmFunc(block, curvemap_tools_dofunc, cumap_v); uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, IFACE_("Reset View"), 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 1, ""); @@ -2282,7 +2282,8 @@ void uiTemplateList(uiLayout *layout, bContext *C, PointerRNA *ptr, const char * uiBlock *block; uiBut *but; Panel *pa; - char *name, str[32]; + const char *name; + char numstr[32]; int rnaicon=0, icon=0, i= 0, activei= 0, len= 0, items, found, min, max; /* validate arguments */ @@ -2373,7 +2374,7 @@ void uiTemplateList(uiLayout *layout, bContext *C, PointerRNA *ptr, const char * uiItemL(row, (name)? name: "", icon); if(name) - MEM_freeN(name); + MEM_freeN((void *)name); } i++; @@ -2386,8 +2387,8 @@ void uiTemplateList(uiLayout *layout, bContext *C, PointerRNA *ptr, const char * uiItemL(row, "", ICON_NONE); /* next/prev button */ - BLI_snprintf(str, sizeof(str), "%d :", i); - but= uiDefIconTextButR_prop(block, NUM, 0, 0, str, 0,0,UI_UNIT_X*5,UI_UNIT_Y, activeptr, activeprop, 0, 0, 0, 0, 0, ""); + BLI_snprintf(numstr, sizeof(numstr), "%d :", i); + but= uiDefIconTextButR_prop(block, NUM, 0, 0, numstr, 0,0,UI_UNIT_X*5,UI_UNIT_Y, activeptr, activeprop, 0, 0, 0, 0, 0, ""); if(i == 0) uiButSetFlag(but, UI_BUT_DISABLED); } @@ -2471,12 +2472,15 @@ static void operator_search_cb(const bContext *C, void *UNUSED(arg), const char int len= strlen(ot->name); /* display name for menu, can hold hotkey */ - BLI_strncpy(name, ot->name, 256); + BLI_strncpy(name, ot->name, sizeof(name)); /* check for hotkey */ - if(len < 256-6) { - if(WM_key_event_operator_string(C, ot->idname, WM_OP_EXEC_DEFAULT, NULL, TRUE, &name[len+1], 256-len-1)) + if(len < sizeof(name)-6) { + if (WM_key_event_operator_string(C, ot->idname, WM_OP_EXEC_DEFAULT, NULL, TRUE, + &name[len+1], sizeof(name)-len-1)) + { name[len]= '|'; + } } if(0==uiSearchItemAdd(items, name, ot, 0)) diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index d8a34262e81..f5c62f65512 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -130,9 +130,12 @@ typedef struct uiWidgetType { static float cornervec[WIDGET_CURVE_RESOLU][2]= {{0.0, 0.0}, {0.195, 0.02}, {0.383, 0.067}, {0.55, 0.169}, {0.707, 0.293}, {0.831, 0.45}, {0.924, 0.617}, {0.98, 0.805}, {1.0, 1.0}}; -static float jit[8][2]= {{0.468813 , -0.481430}, {-0.155755 , -0.352820}, -{0.219306 , -0.238501}, {-0.393286 , -0.110949}, {-0.024699 , 0.013908}, -{0.343805 , 0.147431}, {-0.272855 , 0.269918}, {0.095909 , 0.388710}}; +#define WIDGET_AA_JITTER 8 +static float jit[WIDGET_AA_JITTER][2]= { + { 0.468813 , -0.481430}, {-0.155755 , -0.352820}, + { 0.219306 , -0.238501}, {-0.393286 , -0.110949}, + {-0.024699 , 0.013908}, { 0.343805 , 0.147431}, + {-0.272855 , 0.269918}, { 0.095909 , 0.388710}}; static float num_tria_vert[3][2]= { {-0.352077, 0.532607}, {-0.352077, -0.549313}, {0.330000, -0.008353}}; @@ -165,14 +168,14 @@ static unsigned int check_tria_face[4][3]= { GLubyte checker_stipple_sml[32*32/8] = { - 255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0, \ - 255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0, \ - 0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255, \ - 0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255, \ - 255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0, \ - 255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0, \ - 0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255, \ - 0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255, \ + 255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0, + 255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0, + 0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255, + 0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255, + 255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0, + 255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0, + 0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255, + 0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255, }; /* ************************************************* */ @@ -192,7 +195,7 @@ void ui_draw_anti_tria(float x1, float y1, float x2, float y2, float x3, float y glVertexPointer(2, GL_FLOAT, 0, tri_arr); /* for each AA step */ - for(j=0; j<8; j++) { + for (j = 0; j < WIDGET_AA_JITTER; j++) { glTranslatef(1.0f * jit[j][0], 1.0f * jit[j][1], 0.0f); glDrawArrays(GL_TRIANGLES, 0, 3); glTranslatef(-1.0f * jit[j][0], -1.0f * jit[j][1], 0.0f); @@ -212,7 +215,7 @@ void ui_draw_anti_roundbox(int mode, float minx, float miny, float maxx, float m color[3] *= 0.125f; glColor4fv(color); - for(j=0; j<8; j++) { + for (j = 0; j < WIDGET_AA_JITTER; j++) { glTranslatef(1.0f * jit[j][0], 1.0f * jit[j][1], 0.0f); uiDrawBox(mode, minx, miny, maxx, maxy, rad); glTranslatef(-1.0f * jit[j][0], -1.0f * jit[j][1], 0.0f); @@ -749,6 +752,11 @@ static void widgetbase_draw(uiWidgetBase *wtb, uiWidgetColors *wcol) float quad_strip[WIDGET_SIZE_MAX*2+2][2]; /* + 2 because the last pair is wrapped */ float quad_strip_emboss[WIDGET_SIZE_MAX*2][2]; /* only for emboss */ + const unsigned char tcol[4] = {wcol->outline[0], + wcol->outline[1], + wcol->outline[2], + UCHAR_MAX / WIDGET_AA_JITTER}; + widget_verts_to_quad_strip(wtb, wtb->totvert, quad_strip); if(wtb->emboss) { @@ -757,11 +765,11 @@ static void widgetbase_draw(uiWidgetBase *wtb, uiWidgetColors *wcol) glEnableClientState(GL_VERTEX_ARRAY); - for(j=0; j<8; j++) { + for (j = 0; j < WIDGET_AA_JITTER; j++) { glTranslatef(1.0f * jit[j][0], 1.0f * jit[j][1], 0.0f); /* outline */ - glColor4ub(wcol->outline[0], wcol->outline[1], wcol->outline[2], 32); + glColor4ubv(tcol); glVertexPointer(2, GL_FLOAT, 0, quad_strip); glDrawArrays(GL_QUAD_STRIP, 0, wtb->totvert*2 + 2); @@ -782,16 +790,20 @@ static void widgetbase_draw(uiWidgetBase *wtb, uiWidgetColors *wcol) /* decoration */ if(wtb->tria1.tot || wtb->tria2.tot) { + const unsigned char tcol[4] = {wcol->item[0], + wcol->item[1], + wcol->item[2], + (unsigned char)((float)wcol->item[3] / WIDGET_AA_JITTER)}; /* for each AA step */ - for(j=0; j<8; j++) { + for (j = 0; j < WIDGET_AA_JITTER; j++) { glTranslatef(1.0f * jit[j][0], 1.0f * jit[j][1], 0.0f); if(wtb->tria1.tot) { - glColor4ub(wcol->item[0], wcol->item[1], wcol->item[2], 32); + glColor4ubv(tcol); widget_trias_draw(&wtb->tria1); } if(wtb->tria2.tot) { - glColor4ub(wcol->item[0], wcol->item[1], wcol->item[2], 32); + glColor4ubv(tcol); widget_trias_draw(&wtb->tria2); } @@ -1875,7 +1887,7 @@ static void ui_draw_but_HSVCIRCLE(uiBut *but, uiWidgetColors *wcol, rcti *rect) /* ************ custom buttons, old stuff ************** */ /* draws in resolution of 20x4 colors */ -void ui_draw_gradient(rcti *rect, float *hsv, int type, float alpha) +void ui_draw_gradient(rcti *rect, const float hsv[3], int type, float alpha) { int a; float h= hsv[0], s= hsv[1], v= hsv[2]; @@ -2489,10 +2501,8 @@ static void widget_swatch(uiBut *but, uiWidgetColors *wcol, rcti *rect, int stat if (color_profile) linearrgb_to_srgb_v3_v3(col, col); - wcol->inner[0]= FTOCHAR(col[0]); - wcol->inner[1]= FTOCHAR(col[1]); - wcol->inner[2]= FTOCHAR(col[2]); - wcol->inner[3]= FTOCHAR(col[3]); + F4TOCHAR4(col, wcol->inner); + wcol->shaded = 0; wcol->alpha_check = (wcol->inner[3] < 255); @@ -3264,7 +3274,7 @@ void ui_draw_menu_item(uiFontStyle *fstyle, rcti *rect, const char *name, int ic void ui_draw_preview_item(uiFontStyle *fstyle, rcti *rect, const char *name, int iconid, int state) { rcti trect = *rect; - + float font_dims[2] = {0.0f, 0.0f}; uiWidgetType *wt= widget_type(UI_WTYPE_MENU_ITEM); wt->state(wt, state); @@ -3276,10 +3286,12 @@ void ui_draw_preview_item(uiFontStyle *fstyle, rcti *rect, const char *name, int glColor3ubv((unsigned char*)wt->wcol.text); else glColor3ubv((unsigned char*)wt->wcol.text_sel); - + + BLF_width_and_height(fstyle->uifont_id, name, &font_dims[0], &font_dims[1]); + trect.xmin += 0; - trect.xmax = trect.xmin + BLF_width(fstyle->uifont_id, name) + 10; + trect.xmax = trect.xmin + font_dims[0] + 10; trect.ymin += 10; - trect.ymax = trect.ymin + BLF_height(fstyle->uifont_id, name); + trect.ymax = trect.ymin + font_dims[1]; uiStyleFontDraw(fstyle, &trect, name); } diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c index 57d46de9cb7..b8201d762df 100644 --- a/source/blender/editors/interface/view2d.c +++ b/source/blender/editors/interface/view2d.c @@ -1507,7 +1507,7 @@ View2DScrollers *UI_view2d_scrollers_calc(const bContext *C, View2D *v2d, short static void scroll_printstr(Scene *scene, float x, float y, float val, int power, short unit, char dir) { int len; - char str[32]; + char timecode_str[32]; /* adjust the scale unit to work ok */ if (dir == 'v') { @@ -1522,10 +1522,10 @@ static void scroll_printstr(Scene *scene, float x, float y, float val, int power } /* get string to print */ - ANIM_timecode_string_from_frame(str, scene, power, (unit == V2D_UNIT_SECONDS), val); + ANIM_timecode_string_from_frame(timecode_str, scene, power, (unit == V2D_UNIT_SECONDS), val); /* get length of string, and adjust printing location to fit it into the horizontal scrollbar */ - len= strlen(str); + len= strlen(timecode_str); if (dir == 'h') { /* seconds/timecode display has slightly longer strings... */ if (unit == V2D_UNIT_SECONDS) @@ -1536,12 +1536,12 @@ static void scroll_printstr(Scene *scene, float x, float y, float val, int power /* Add degree sympbol to end of string for vertical scrollbar? */ if ((dir == 'v') && (unit == V2D_UNIT_DEGREES)) { - str[len]= 186; - str[len+1]= 0; + timecode_str[len]= 186; + timecode_str[len+1]= 0; } /* draw it */ - BLF_draw_default_ascii(x, y, 0.0f, str, sizeof(str)-1); + BLF_draw_default_ascii(x, y, 0.0f, timecode_str, sizeof(timecode_str)); } /* Draw scrollbars in the given 2d-region */ @@ -2093,11 +2093,11 @@ void UI_view2d_text_cache_draw(ARegion *ar) } if(v2s->rect.xmin >= v2s->rect.xmax) - BLF_draw_default((float)v2s->mval[0]+xofs, (float)v2s->mval[1]+yofs, 0.0, str, 65535); + BLF_draw_default((float)v2s->mval[0]+xofs, (float)v2s->mval[1]+yofs, 0.0, str, BLF_DRAW_STR_DUMMY_MAX); else { BLF_clipping_default(v2s->rect.xmin-4, v2s->rect.ymin-4, v2s->rect.xmax+4, v2s->rect.ymax+4); BLF_enable_default(BLF_CLIPPING); - BLF_draw_default(v2s->rect.xmin+xofs, v2s->rect.ymin+yofs, 0.0f, str, 65535); + BLF_draw_default(v2s->rect.xmin+xofs, v2s->rect.ymin+yofs, 0.0f, str, BLF_DRAW_STR_DUMMY_MAX); BLF_disable_default(BLF_CLIPPING); } } diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c index a993e651b5f..2959d525cfb 100644 --- a/source/blender/editors/interface/view2d_ops.c +++ b/source/blender/editors/interface/view2d_ops.c @@ -1207,6 +1207,7 @@ typedef struct v2dScrollerMove { float delta; /* amount moved by mouse on axis of interest */ float scrollbarwidth; /* width of the scrollbar itself, used for page up/down clicks */ + int scrollbar_orig; /* initial location of scrollbar x/y, mouse relative */ int lastx, lasty; /* previous mouse coordinates (in screen coordinates) for determining movement */ } v2dScrollerMove; @@ -1302,15 +1303,16 @@ static void scroller_activate_init(bContext *C, wmOperator *op, wmEvent *event, vsm->v2d= v2d; vsm->ar= ar; vsm->scroller= in_scroller; - + /* store mouse-coordinates, and convert mouse/screen coordinates to region coordinates */ vsm->lastx = event->x; vsm->lasty = event->y; - /* 'zone' depends on where mouse is relative to bubble * - zooming must be allowed on this axis, otherwise, default to pan */ scrollers= UI_view2d_scrollers_calc(C, v2d, V2D_ARG_DUMMY, V2D_ARG_DUMMY, V2D_ARG_DUMMY, V2D_ARG_DUMMY); + + if (in_scroller == 'h') { /* horizontal scroller - calculate adjustment factor first */ mask_size= (float)(v2d->hor.xmax - v2d->hor.xmin); @@ -1325,6 +1327,7 @@ static void scroller_activate_init(bContext *C, wmOperator *op, wmEvent *event, } vsm->scrollbarwidth = scrollers->hor_max - scrollers->hor_min; + vsm->scrollbar_orig = ((scrollers->hor_max + scrollers->hor_min) / 2) + ar->winrct.xmin; } else { /* vertical scroller - calculate adjustment factor first */ @@ -1340,6 +1343,7 @@ static void scroller_activate_init(bContext *C, wmOperator *op, wmEvent *event, } vsm->scrollbarwidth = scrollers->vert_max - scrollers->vert_min; + vsm->scrollbar_orig = ((scrollers->vert_max + scrollers->vert_min) / 2) + + ar->winrct.ymin; } UI_view2d_scrollers_free(scrollers); @@ -1464,6 +1468,7 @@ static int scroller_activate_modal(bContext *C, wmOperator *op, wmEvent *event) break; case LEFTMOUSE: + case MIDDLEMOUSE: if (event->val==KM_RELEASE) { /* single-click was in empty space outside bubble, so scroll by 1 'page' */ if (ELEM(vsm->zone, SCROLLHANDLE_MIN_OUTSIDE, SCROLLHANDLE_MAX_OUTSIDE)) { @@ -1484,6 +1489,7 @@ static int scroller_activate_modal(bContext *C, wmOperator *op, wmEvent *event) } } break; + } return OPERATOR_RUNNING_MODAL; @@ -1508,6 +1514,21 @@ static int scroller_activate_invoke(bContext *C, wmOperator *op, wmEvent *event) scroller_activate_init(C, op, event, in_scroller); vsm= (v2dScrollerMove *)op->customdata; + /* support for quick jump to location - gtk and qt do this on linux */ + if (event->type == MIDDLEMOUSE) { + switch (vsm->scroller) { + case 'h': /* horizontal scroller - so only horizontal movement ('cur' moves opposite to mouse) */ + vsm->delta= (float)(event->x - vsm->scrollbar_orig); + break; + case 'v': /* vertical scroller - so only vertical movement ('cur' moves opposite to mouse) */ + vsm->delta= (float)(event->y - vsm->scrollbar_orig); + break; + } + scroller_activate_apply(C, op); + + vsm->zone= SCROLLHANDLE_BAR; + } + /* check if zoom zones are inappropriate (i.e. zoom widgets not shown), so cannot continue * NOTE: see view2d.c for latest conditions, and keep this in sync with that */ @@ -1669,6 +1690,10 @@ void UI_view2d_keymap(wmKeyConfig *keyconf) { wmKeyMap *keymap= WM_keymap_find(keyconf, "View2D", 0, 0); + /* scrollers */ + WM_keymap_add_item(keymap, "VIEW2D_OT_scroller_activate", LEFTMOUSE, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "VIEW2D_OT_scroller_activate", MIDDLEMOUSE, KM_PRESS, 0, 0); + /* pan/scroll */ WM_keymap_add_item(keymap, "VIEW2D_OT_pan", MIDDLEMOUSE, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "VIEW2D_OT_pan", MIDDLEMOUSE, KM_PRESS, KM_SHIFT, 0); @@ -1713,12 +1738,13 @@ void UI_view2d_keymap(wmKeyConfig *keyconf) /* borderzoom - drag */ WM_keymap_add_item(keymap, "VIEW2D_OT_zoom_border", BKEY, KM_PRESS, KM_SHIFT, 0); - - /* scrollers */ - WM_keymap_add_item(keymap, "VIEW2D_OT_scroller_activate", LEFTMOUSE, KM_PRESS, 0, 0); /* Alternative keymap for buttons listview */ keymap= WM_keymap_find(keyconf, "View2D Buttons List", 0, 0); + + WM_keymap_add_item(keymap, "VIEW2D_OT_scroller_activate", LEFTMOUSE, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "VIEW2D_OT_scroller_activate", MIDDLEMOUSE, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "VIEW2D_OT_pan", MIDDLEMOUSE, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "VIEW2D_OT_pan", MOUSEPAN, 0, 0, 0); WM_keymap_add_item(keymap, "VIEW2D_OT_scroll_down", WHEELDOWNMOUSE, KM_PRESS, 0, 0); @@ -1732,6 +1758,5 @@ void UI_view2d_keymap(wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "VIEW2D_OT_zoom_out", PADMINUS, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "VIEW2D_OT_zoom_in", PADPLUSKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "VIEW2D_OT_reset", HOMEKEY, KM_PRESS, 0, 0); - WM_keymap_add_item(keymap, "VIEW2D_OT_scroller_activate", LEFTMOUSE, KM_PRESS, 0, 0); } diff --git a/source/blender/editors/mesh/editmesh.c b/source/blender/editors/mesh/editmesh.c index 7c237808e85..26645b66c7f 100644 --- a/source/blender/editors/mesh/editmesh.c +++ b/source/blender/editors/mesh/editmesh.c @@ -565,8 +565,6 @@ void free_editMesh(EditMesh *em) em->totvert= em->totedge= em->totface= 0; -// XXX if(em->retopo_paint_data) retopo_free_paint_data(em->retopo_paint_data); - em->retopo_paint_data= NULL; em->act_face = NULL; } @@ -1632,7 +1630,6 @@ typedef struct UndoMesh { EditSelectionC *selected; int totvert, totedge, totface, totsel; int selectmode, shapenr; - char retopo_mode; CustomData vdata, edata, fdata; } UndoMesh; @@ -1646,7 +1643,6 @@ static void free_undoMesh(void *umv) if(um->edges) MEM_freeN(um->edges); if(um->faces) MEM_freeN(um->faces); if(um->selected) MEM_freeN(um->selected); -// XXX if(um->retopo_paint_data) retopo_free_paint_data(um->retopo_paint_data); CustomData_free(&um->vdata, um->totvert); CustomData_free(&um->edata, um->totedge); CustomData_free(&um->fdata, um->totface); @@ -1748,9 +1744,6 @@ static void *editMesh_to_undoMesh(void *emv) else if(ese->type == EDITFACE) a = esec->index = ((EditFace*)ese->data)->tmp.l; } -// XXX um->retopo_paint_data= retopo_paint_data_copy(em->retopo_paint_data); -// um->retopo_mode= scene->toolsettings->retopo_mode; - return um; } @@ -1857,16 +1850,6 @@ static void undoMesh_to_editMesh(void *umv, void *emv) EM_nvertices_selected(em); EM_nedges_selected(em); EM_nfaces_selected(em); - -// XXX retopo_free_paint(); -// em->retopo_paint_data= retopo_paint_data_copy(um->retopo_paint_data); -// scene->toolsettings->retopo_mode= um->retopo_mode; -// if(scene->toolsettings->retopo_mode) { -// XXX if(G.vd->depths) G.vd->depths->damaged= 1; -// retopo_queue_updates(G.vd); -// retopo_paint_view_update(G.vd); -// } - } static void *getEditMesh(bContext *C) diff --git a/source/blender/editors/mesh/editmesh_mods.c b/source/blender/editors/mesh/editmesh_mods.c index a6630090a5e..5004559ba60 100644 --- a/source/blender/editors/mesh/editmesh_mods.c +++ b/source/blender/editors/mesh/editmesh_mods.c @@ -2477,7 +2477,7 @@ static int select_linked_limited_invoke(ViewContext *vc, short all, short sel) static void linked_limit_default(bContext *C, wmOperator *op) { - if(!RNA_property_is_set(op->ptr, "limit")) { + if(!RNA_struct_property_is_set(op->ptr, "limit")) { Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh(obedit->data); if(em->selectmode == SCE_SELECT_FACE) @@ -3401,34 +3401,6 @@ void EM_select_swap(EditMesh *em) /* exported for UV */ // if (EM_texFaceCheck()) } - -static int select_inverse_mesh_exec(bContext *C, wmOperator *UNUSED(op)) -{ - Object *obedit= CTX_data_edit_object(C); - EditMesh *em= BKE_mesh_get_editmesh(((Mesh *)obedit->data)); - - EM_select_swap(em); - - WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); - - BKE_mesh_end_editmesh(obedit->data, em); - return OPERATOR_FINISHED; -} - -void MESH_OT_select_inverse(wmOperatorType *ot) -{ - /* identifiers */ - ot->name= "Select Inverse"; - ot->description= "Select inverse of (un)selected vertices, edges or faces"; - ot->idname= "MESH_OT_select_inverse"; - - /* api callbacks */ - ot->exec= select_inverse_mesh_exec; - ot->poll= ED_operator_editmesh; - - /* flags */ - ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; -} /* ******************** (de)select all operator **************** */ diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index 658a8db449f..f0687031bae 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -3944,808 +3944,6 @@ short sharesFace(EditMesh *em, EditEdge* e1, EditEdge* e2) return 0; } -#if 0 - -typedef struct SlideUv { - float origuv[2]; - float *uv_up, *uv_down; - //float *fuv[4]; - LinkNode *fuv_list; -} SlideUv; - -typedef struct SlideVert { - EditEdge *up,*down; - EditVert origvert; -} SlideVert; - -int EdgeSlide(EditMesh *em, wmOperator *op, short immediate, float imperc) -{ - return 0; -/* XXX REFACTOR - #if 0'd for now, otherwise can't make 64bit windows builds on 64bit machine */ -useless: - goto useless // because it doesn't do anything right now - -// NumInput num; XXX - Mesh *me= NULL; // XXX - EditFace *efa; - EditEdge *eed,*first=NULL,*last=NULL, *temp = NULL; - EditVert *ev, *nearest; - LinkNode *edgelist = NULL, *vertlist=NULL, *look; - GHash *vertgh; - - SlideVert *tempsv; - float perc = 0, percp = 0,vertdist; // XXX, projectMat[4][4]; - float shiftlabda= 0.0f,len = 0.0f; - int i = 0,j, numsel, numadded=0, timesthrough = 0, vertsel=0, prop=1, cancel = 0,flip=0; - int wasshift = 0; - - /* UV correction vars */ - GHash **uvarray= NULL; - int uvlay_tot= CustomData_number_of_layers(&em->fdata, CD_MTFACE); - int uvlay_idx; - SlideUv *slideuvs=NULL, *suv=NULL, *suv_last=NULL; - float uv_tmp[2]; - LinkNode *fuv_link; - - short event, draw=1; - int mval[2], mvalo[2]; - char str[128]; - float labda = 0.0f; - -// initNumInput(&num); - -// view3d_get_object_project_mat(curarea, obedit, projectMat); - - mvalo[0] = -1; mvalo[1] = -1; - numsel =0; - - // Get number of selected edges and clear some flags - for(eed=em->edges.first;eed;eed=eed->next) { - eed->f1 = 0; - eed->f2 = 0; - if(eed->f & SELECT) numsel++; - } - - for(ev=em->verts.first;ev;ev=ev->next) { - ev->f1 = 0; - } - - //Make sure each edge only has 2 faces - // make sure loop doesn't cross face - for(efa=em->faces.first;efa;efa=efa->next) { - int ct = 0; - if(efa->e1->f & SELECT) { - ct++; - efa->e1->f1++; - if(efa->e1->f1 > 2) { - BKE_report(op->reports, RPT_ERROR, "3+ face edge"); - return 0; - } - } - if(efa->e2->f & SELECT) { - ct++; - efa->e2->f1++; - if(efa->e2->f1 > 2) { - BKE_report(op->reports, RPT_ERROR, "3+ face edge"); - return 0; - } - } - if(efa->e3->f & SELECT) { - ct++; - efa->e3->f1++; - if(efa->e3->f1 > 2) { - BKE_report(op->reports, RPT_ERROR, "3+ face edge"); - return 0; - } - } - if(efa->e4 && efa->e4->f & SELECT) { - ct++; - efa->e4->f1++; - if(efa->e4->f1 > 2) { - BKE_report(op->reports, RPT_ERROR, "3+ face edge"); - return 0; - } - } - // Make sure loop is not 2 edges of same face - if(ct > 1) { - BKE_report(op->reports, RPT_ERROR, "Loop crosses itself"); - return 0; - } - } - // Get # of selected verts - for(ev=em->verts.first;ev;ev=ev->next) { - if(ev->f & SELECT) vertsel++; - } - - // Test for multiple segments - if(vertsel > numsel+1) { - BKE_report(op->reports, RPT_ERROR, "Please choose a single edge loop"); - return 0; - } - - // Get the edgeloop in order - mark f1 with SELECT once added - for(eed=em->edges.first;eed;eed=eed->next) { - if((eed->f & SELECT) && !(eed->f1 & SELECT)) { - // If this is the first edge added, just put it in - if(!edgelist) { - BLI_linklist_prepend(&edgelist,eed); - numadded++; - first = eed; - last = eed; - eed->f1 = SELECT; - } else { - if(editedge_getSharedVert(eed, last)) { - BLI_linklist_append(&edgelist,eed); - eed->f1 = SELECT; - numadded++; - last = eed; - } else if(editedge_getSharedVert(eed, first)) { - BLI_linklist_prepend(&edgelist,eed); - eed->f1 = SELECT; - numadded++; - first = eed; - } - } - } - if(eed->next == NULL && numadded != numsel) { - eed=em->edges.first; - timesthrough++; - } - - // It looks like there was an unexpected case - Hopefully should not happen - if(timesthrough >= numsel*2) { - BLI_linklist_free(edgelist,NULL); - BKE_report(op->reports, RPT_ERROR, "Could not order loop"); - return 0; - } - } - - // Put the verts in order in a linklist - look = edgelist; - while(look) { - eed = look->link; - if(!vertlist) { - if(look->next) { - temp = look->next->link; - - //This is the first entry takes care of extra vert - if(eed->v1 != temp->v1 && eed->v1 != temp->v2) { - BLI_linklist_append(&vertlist,eed->v1); - eed->v1->f1 = 1; - } else { - BLI_linklist_append(&vertlist,eed->v2); - eed->v2->f1 = 1; - } - } else { - //This is the case that we only have 1 edge - BLI_linklist_append(&vertlist,eed->v1); - eed->v1->f1 = 1; - } - } - // for all the entries - if(eed->v1->f1 != 1) { - BLI_linklist_append(&vertlist,eed->v1); - eed->v1->f1 = 1; - } else if(eed->v2->f1 != 1) { - BLI_linklist_append(&vertlist,eed->v2); - eed->v2->f1 = 1; - } - look = look->next; - } - - // populate the SlideVerts - - vertgh = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "EdgeSlide gh"); - look = vertlist; - while(look) { - i=0; - j=0; - ev = look->link; - tempsv = (struct SlideVert*)MEM_mallocN(sizeof(struct SlideVert),"SlideVert"); - tempsv->up = NULL; - tempsv->down = NULL; - tempsv->origvert.co[0] = ev->co[0]; - tempsv->origvert.co[1] = ev->co[1]; - tempsv->origvert.co[2] = ev->co[2]; - tempsv->origvert.no[0] = ev->no[0]; - tempsv->origvert.no[1] = ev->no[1]; - tempsv->origvert.no[2] = ev->no[2]; - // i is total edges that vert is on - // j is total selected edges that vert is on - - for(eed=em->edges.first;eed;eed=eed->next) { - if(eed->v1 == ev || eed->v2 == ev) { - i++; - if(eed->f & SELECT) { - j++; - } - } - } - // If the vert is in the middle of an edge loop, it touches 2 selected edges and 2 unselected edges - if(i == 4 && j == 2) { - for(eed=em->edges.first;eed;eed=eed->next) { - if(editedge_containsVert(eed, ev)) { - if(!(eed->f & SELECT)) { - if(!tempsv->up) { - tempsv->up = eed; - } else if (!(tempsv->down)) { - tempsv->down = eed; - } - } - } - } - } - // If it is on the end of the loop, it touches 1 selected and as least 2 more unselected - if(i >= 3 && j == 1) { - for(eed=em->edges.first;eed;eed=eed->next) { - if(editedge_containsVert(eed, ev) && eed->f & SELECT) { - for(efa = em->faces.first;efa;efa=efa->next) { - if(editface_containsEdge(efa, eed)) { - if(editedge_containsVert(efa->e1, ev) && efa->e1 != eed) { - if(!tempsv->up) { - tempsv->up = efa->e1; - } else if (!(tempsv->down)) { - tempsv->down = efa->e1; - } - } - if(editedge_containsVert(efa->e2, ev) && efa->e2 != eed) { - if(!tempsv->up) { - tempsv->up = efa->e2; - } else if (!(tempsv->down)) { - tempsv->down = efa->e2; - } - } - if(editedge_containsVert(efa->e3, ev) && efa->e3 != eed) { - if(!tempsv->up) { - tempsv->up = efa->e3; - } else if (!(tempsv->down)) { - tempsv->down = efa->e3; - } - } - if(efa->e4) { - if(editedge_containsVert(efa->e4, ev) && efa->e4 != eed) { - if(!tempsv->up) { - tempsv->up = efa->e4; - } else if (!(tempsv->down)) { - tempsv->down = efa->e4; - } - } - } - - } - } - } - } - } - if(i > 4 && j == 2) { - BLI_ghash_free(vertgh, NULL, (GHashValFreeFP)MEM_freeN); - BLI_linklist_free(vertlist,NULL); - BLI_linklist_free(edgelist,NULL); - return 0; - } - BLI_ghash_insert(vertgh,ev,tempsv); - - look = look->next; - } - - // make sure the UPs nad DOWNs are 'faceloops' - // Also find the nearest slidevert to the cursor -// XXX getmouseco_areawin(mval); - look = vertlist; - nearest = NULL; - vertdist = -1; - while(look) { - tempsv = BLI_ghash_lookup(vertgh,(EditVert*)look->link); - - if(!tempsv->up || !tempsv->down) { - BKE_report(op->reports, RPT_ERROR, "Missing rails"); - BLI_ghash_free(vertgh, NULL, (GHashValFreeFP)MEM_freeN); - BLI_linklist_free(vertlist,NULL); - BLI_linklist_free(edgelist,NULL); - return 0; - } - - if(me->drawflag & ME_DRAWEXTRA_EDGELEN) { - if(!(tempsv->up->f & SELECT)) { - tempsv->up->f |= SELECT; - tempsv->up->f2 |= 16; - } else { - tempsv->up->f2 |= ~16; - } - if(!(tempsv->down->f & SELECT)) { - tempsv->down->f |= SELECT; - tempsv->down->f2 |= 16; - } else { - tempsv->down->f2 |= ~16; - } - } - - if(look->next != NULL) { - SlideVert *sv; - - sv = BLI_ghash_lookup(vertgh,(EditVert*)look->next->link); - - if(sv) { - float tempdist, co[2]; - - if(!sharesFace(em, tempsv->up,sv->up)) { - EditEdge *swap; - swap = sv->up; - sv->up = sv->down; - sv->down = swap; - } - -// view3d_project_float(curarea, tempsv->origvert.co, co, projectMat); - - tempdist = sqrt(pow(co[0] - mval[0],2)+pow(co[1] - mval[1],2)); - - if(vertdist < 0) { - vertdist = tempdist; - nearest = (EditVert*)look->link; - } else if ( tempdist < vertdist ) { - vertdist = tempdist; - nearest = (EditVert*)look->link; - } - } - } - - - - look = look->next; - } - - - if (uvlay_tot) { // XXX && (scene->toolsettings->uvcalc_flag & UVCALC_TRANSFORM_CORRECT)) { - int maxnum = 0; - uvarray = MEM_callocN( uvlay_tot * sizeof(GHash *), "SlideUVs Array"); - suv_last = slideuvs = MEM_callocN( uvlay_tot * (numadded+1) * sizeof(SlideUv), "SlideUVs"); /* uvLayers * verts */ - suv = NULL; - - for (uvlay_idx=0; uvlay_idx<uvlay_tot; uvlay_idx++) { - - uvarray[uvlay_idx] = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "EdgeSlideUV gh"); - - for(ev=em->verts.first;ev;ev=ev->next) { - ev->tmp.l = 0; - } - look = vertlist; - while(look) { - float *uv_new; - tempsv = BLI_ghash_lookup(vertgh,(EditVert*)look->link); - - ev = look->link; - suv = NULL; - for(efa = em->faces.first;efa;efa=efa->next) { - if (ev->tmp.l != -1) { /* test for self, in this case its invalid */ - int k=-1; /* face corner */ - - /* Is this vert in the faces corner? */ - if (efa->v1==ev) k=0; - else if (efa->v2==ev) k=1; - else if (efa->v3==ev) k=2; - else if (efa->v4 && efa->v4==ev) k=3; - - if (k != -1) { - MTFace *tf = CustomData_em_get_n(&em->fdata, efa->data, CD_MTFACE, uvlay_idx); - EditVert *ev_up, *ev_down; - - uv_new = tf->uv[k]; - - if (ev->tmp.l) { - if (fabs(suv->origuv[0]-uv_new[0]) > 0.0001 || fabs(suv->origuv[1]-uv_new[1])) { - ev->tmp.l = -1; /* Tag as invalid */ - BLI_linklist_free(suv->fuv_list,NULL); - suv->fuv_list = NULL; - BLI_ghash_remove(uvarray[uvlay_idx],ev, NULL, NULL); - suv = NULL; - break; - } - } else { - ev->tmp.l = 1; - suv = suv_last; - - suv->fuv_list = NULL; - suv->uv_up = suv->uv_down = NULL; - suv->origuv[0] = uv_new[0]; - suv->origuv[1] = uv_new[1]; - - BLI_linklist_prepend(&suv->fuv_list, uv_new); - BLI_ghash_insert(uvarray[uvlay_idx],ev,suv); - - suv_last++; /* advance to next slide UV */ - maxnum++; - } - - /* Now get the uvs along the up or down edge if we can */ - if (suv) { - if (!suv->uv_up) { - ev_up = editedge_getOtherVert(tempsv->up,ev); - if (efa->v1==ev_up) suv->uv_up = tf->uv[0]; - else if (efa->v2==ev_up) suv->uv_up = tf->uv[1]; - else if (efa->v3==ev_up) suv->uv_up = tf->uv[2]; - else if (efa->v4 && efa->v4==ev_up) suv->uv_up = tf->uv[3]; - } - if (!suv->uv_down) { /* if the first face was apart of the up edge, it cant be apart of the down edge */ - ev_down = editedge_getOtherVert(tempsv->down,ev); - if (efa->v1==ev_down) suv->uv_down = tf->uv[0]; - else if (efa->v2==ev_down) suv->uv_down = tf->uv[1]; - else if (efa->v3==ev_down) suv->uv_down = tf->uv[2]; - else if (efa->v4 && efa->v4==ev_down) suv->uv_down = tf->uv[3]; - } - - /* Copy the pointers to the face UV's */ - BLI_linklist_prepend(&suv->fuv_list, uv_new); - } - } - } - } - look = look->next; - } - } /* end uv map loop */ - } /* end uvlay_tot */ - - - - // we should have enough info now to slide - - len = 0.0f; - - percp = -1; - while(draw) { - /* For the % calculation */ - int mval[2]; - float rc[2]; - float v2[2], v3[2]; - EditVert *centerVert, *upVert, *downVert; - -// XXX getmouseco_areawin(mval); - - if (!immediate && (mval[0] == mvalo[0] && mval[1] == mvalo[1])) { - PIL_sleep_ms(10); - } else { - char *p = str; - int ctrl= 0, shift= 0; // XXX - - mvalo[0] = mval[0]; - mvalo[1] = mval[1]; - - - tempsv = BLI_ghash_lookup(vertgh,nearest); - - centerVert = editedge_getSharedVert(tempsv->up, tempsv->down); - upVert = editedge_getOtherVert(tempsv->up, centerVert); - downVert = editedge_getOtherVert(tempsv->down, centerVert); - -// view3d_project_float(curarea, upVert->co, v2, projectMat); -// view3d_project_float(curarea, downVert->co, v3, projectMat); - - /* Determine the % on which the loop should be cut */ - - rc[0]= v3[0]-v2[0]; - rc[1]= v3[1]-v2[1]; - len= rc[0]*rc[0]+ rc[1]*rc[1]; - if (len==0) {len = 0.0001;} - - if (shift) { - wasshift = 0; - labda= ( rc[0]*((mval[0]-v2[0])) + rc[1]*((mval[1]-v2[1])) )/len; - } - else { - if (wasshift==0) { - wasshift = 1; - shiftlabda = labda; - } - labda= ( rc[0]*((mval[0]-v2[0])) + rc[1]*((mval[1]-v2[1])) )/len / 10.0 + shiftlabda; - } - - - if(labda<=0.0) labda=0.0; - else if(labda>=1.0)labda=1.0; - - perc=((1-labda)*2)-1; - - if(shift == 0 && ctrl==0) { - perc *= 100; - perc = floor(perc); - perc /= 100; - } else if (ctrl) { - perc *= 10; - perc = floor(perc); - perc /= 10; - } - - if(prop == 0) { - len = len_v3v3(upVert->co,downVert->co)*((perc+1)/2); - if(flip == 1) { - len = len_v3v3(upVert->co,downVert->co) - len; - } - } - - if (0) // XXX hasNumInput(&num)) - { -// XXX applyNumInput(&num, &perc); - - if (prop) - { - perc = MIN2(perc, 1); - perc = MAX2(perc, -1); - } - else - { - len = MIN2(perc, len_v3v3(upVert->co,downVert->co)); - len = MAX2(len, 0); - } - } - - //Adjust Edgeloop - if(immediate) { - perc = imperc; - } - percp = perc; - if(prop) { - look = vertlist; - while(look) { - EditVert *tempev; - ev = look->link; - tempsv = BLI_ghash_lookup(vertgh,ev); - - tempev = editedge_getOtherVert((perc>=0)?tempsv->up:tempsv->down, ev); - interp_v3_v3v3(ev->co, tempsv->origvert.co, tempev->co, fabs(perc)); - - if (0) { // XXX scene->toolsettings->uvcalc_flag & UVCALC_TRANSFORM_CORRECT) { - for (uvlay_idx=0; uvlay_idx<uvlay_tot; uvlay_idx++) { - suv = BLI_ghash_lookup( uvarray[uvlay_idx], ev ); - if (suv && suv->fuv_list && suv->uv_up && suv->uv_down) { - interp_v2_v2v2(uv_tmp, suv->origuv, (perc>=0)?suv->uv_up:suv->uv_down, fabs(perc)); - fuv_link = suv->fuv_list; - while (fuv_link) { - VECCOPY2D(((float *)fuv_link->link), uv_tmp); - fuv_link = fuv_link->next; - } - } - } - } - - look = look->next; - } - } - else { - //Non prop code - look = vertlist; - while(look) { - float newlen; - ev = look->link; - tempsv = BLI_ghash_lookup(vertgh,ev); - newlen = (len / len_v3v3(editedge_getOtherVert(tempsv->up,ev)->co,editedge_getOtherVert(tempsv->down,ev)->co)); - if(newlen > 1.0) {newlen = 1.0;} - if(newlen < 0.0) {newlen = 0.0;} - if(flip == 0) { - interp_v3_v3v3(ev->co, editedge_getOtherVert(tempsv->down,ev)->co, editedge_getOtherVert(tempsv->up,ev)->co, fabs(newlen)); - if (0) { // XXX scene->toolsettings->uvcalc_flag & UVCALC_TRANSFORM_CORRECT) { - /* dont do anything if no UVs */ - for (uvlay_idx=0; uvlay_idx<uvlay_tot; uvlay_idx++) { - suv = BLI_ghash_lookup( uvarray[uvlay_idx], ev ); - if (suv && suv->fuv_list && suv->uv_up && suv->uv_down) { - interp_v2_v2v2(uv_tmp, suv->uv_down, suv->uv_up, fabs(newlen)); - fuv_link = suv->fuv_list; - while (fuv_link) { - VECCOPY2D(((float *)fuv_link->link), uv_tmp); - fuv_link = fuv_link->next; - } - } - } - } - } else{ - interp_v3_v3v3(ev->co, editedge_getOtherVert(tempsv->up,ev)->co, editedge_getOtherVert(tempsv->down,ev)->co, fabs(newlen)); - - if (0) { // XXX scene->toolsettings->uvcalc_flag & UVCALC_TRANSFORM_CORRECT) { - /* dont do anything if no UVs */ - for (uvlay_idx=0; uvlay_idx<uvlay_tot; uvlay_idx++) { - suv = BLI_ghash_lookup( uvarray[uvlay_idx], ev ); - if (suv && suv->fuv_list && suv->uv_up && suv->uv_down) { - interp_v2_v2v2(uv_tmp, suv->uv_up, suv->uv_down, fabs(newlen)); - fuv_link = suv->fuv_list; - while (fuv_link) { - VECCOPY2D(((float *)fuv_link->link), uv_tmp); - fuv_link = fuv_link->next; - } - } - } - } - } - look = look->next; - } - - } - - // Highlight the Control Edges -// scrarea_do_windraw(curarea); -// persp(PERSP_VIEW); -// glPushMatrix(); -// mymultmatrix(obedit->obmat); - - glColor3ub(0, 255, 0); - glBegin(GL_LINES); - glVertex3fv(upVert->co); - glVertex3fv(downVert->co); - glEnd(); - - if(prop == 0) { - // draw start edge for non-prop - glPointSize(5); - glBegin(GL_POINTS); - glColor3ub(255,0,255); - if(flip) { - glVertex3fv(upVert->co); - } else { - glVertex3fv(downVert->co); - } - glEnd(); - } - - - glPopMatrix(); - - if(prop) { - p += sprintf(str, "(P)ercentage: "); - } else { - p += sprintf(str, "Non (P)rop Length: "); - } - - if (0) // XXX hasNumInput(&num)) - { - char num_str[20]; - - // XX outputNumInput(&num, num_str); - p += sprintf(p, "%s", num_str); - } - else - { - if (prop) - { - p += sprintf(p, "%f", perc); - } - else - { - p += sprintf(p, "%f", len); - } - } - - - if (prop == 0) { - p += sprintf(p, ", Press (F) to flip control side"); - } - -// headerprint(str); -// screen_swapbuffers(); - } - if(!immediate) { - while(qtest()) { - short val=0; - event= extern_qread(&val); // extern_qread stores important events for the mainloop to handle - - /* val==0 on key-release event */ - if (val) { - if(ELEM(event, ESCKEY, RIGHTMOUSE)) { - prop = 1; // Go back to prop mode - imperc = 0; // This is the % that gets set for immediate - immediate = 1; //Run through eval code 1 more time - cancel = 1; // Return -1 - mvalo[0] = -1; - } else if(ELEM3(event, PADENTER, LEFTMOUSE, RETKEY)) { - draw = 0; // End looping now - } else if(event==MIDDLEMOUSE) { - perc = 0; - immediate = 1; - } else if(event==PKEY) { -// XXX initNumInput(&num); /* reset num input */ - if (prop) { - prop = 0; -// XXX num.flag |= NUM_NO_NEGATIVE; - } - else { - prop = 1; - } - mvalo[0] = -1; - } else if(event==FKEY) { - (flip == 1) ? (flip = 0):(flip = 1); - mvalo[0] = -1; - } else if(ELEM(event, RIGHTARROWKEY, WHEELUPMOUSE)) { // Scroll through Control Edges - look = vertlist; - while(look) { - if(nearest == (EditVert*)look->link) { - if(look->next == NULL) { - nearest = (EditVert*)vertlist->link; - } else { - nearest = (EditVert*)look->next->link; - } - mvalo[0] = -1; - break; - } - look = look->next; - } - } else if(ELEM(event, LEFTARROWKEY, WHEELDOWNMOUSE)) { // Scroll through Control Edges - look = vertlist; - while(look) { - if(look->next) { - if(look->next->link == nearest) { - nearest = (EditVert*)look->link; - mvalo[0] = -1; - break; - } - } else { - if((EditVert*)vertlist->link == nearest) { - nearest = look->link; - mvalo[0] = -1; - break; - } - } - look = look->next; - } - } - -// XXX if (handleNumInput(&num, event)) - { - mvalo[0] = -1; /* NEED A BETTER WAY TO TRIGGER REDRAW */ - } - } - - } - } else { - draw = 0; - } -// DAG_id_tag_update(obedit->data, 0); - } - - - if(me->drawflag & ME_DRAWEXTRA_EDGELEN) { - look = vertlist; - while(look) { - tempsv = BLI_ghash_lookup(vertgh,(EditVert*)look->link); - if(tempsv != NULL) { - tempsv->up->f &= !SELECT; - tempsv->down->f &= !SELECT; - } - look = look->next; - } - } - -// force_draw(0); - - if(!immediate) - EM_automerge(0); -// DAG_id_tag_update(obedit->data, 0); -// scrarea_queue_winredraw(curarea); - - //BLI_ghash_free(edgesgh, freeGHash, NULL); - BLI_ghash_free(vertgh, NULL, (GHashValFreeFP)MEM_freeN); - BLI_linklist_free(vertlist,NULL); - BLI_linklist_free(edgelist,NULL); - - if (uvlay_tot) { // XXX && (scene->toolsettings->uvcalc_flag & UVCALC_TRANSFORM_CORRECT)) { - for (uvlay_idx=0; uvlay_idx<uvlay_tot; uvlay_idx++) { - BLI_ghash_free(uvarray[uvlay_idx], NULL, NULL); - } - MEM_freeN(uvarray); - MEM_freeN(slideuvs); - - suv = suv_last-1; - while (suv >= slideuvs) { - if (suv->fuv_list) { - BLI_linklist_free(suv->fuv_list,NULL); - } - suv--; - } - } - - if(cancel == 1) { - return -1; - } - - return 1; -} -#endif // END OF XXX - int EdgeLoopDelete(EditMesh *UNUSED(em), wmOperator *UNUSED(op)) { #if 0 //XXX won't work with new edgeslide diff --git a/source/blender/editors/mesh/mesh_data.c b/source/blender/editors/mesh/mesh_data.c index 7762203c371..e40c806fd17 100644 --- a/source/blender/editors/mesh/mesh_data.c +++ b/source/blender/editors/mesh/mesh_data.c @@ -359,7 +359,7 @@ static int drop_named_image_invoke(bContext *C, wmOperator *op, wmEvent *event) Mesh *me; Object *obedit; int exitmode= 0; - char name[32]; + char name[MAX_ID_NAME-2]; /* Check context */ if(base==NULL || base->object->type!=OB_MESH) { @@ -368,7 +368,7 @@ static int drop_named_image_invoke(bContext *C, wmOperator *op, wmEvent *event) } /* check input variables */ - if(RNA_property_is_set(op->ptr, "filepath")) { + if(RNA_struct_property_is_set(op->ptr, "filepath")) { char path[FILE_MAX]; RNA_string_get(op->ptr, "filepath", path); @@ -429,7 +429,7 @@ void MESH_OT_drop_named_image(wmOperatorType *ot) ot->flag= OPTYPE_UNDO; /* properties */ - RNA_def_string(ot->srna, "name", "Image", 24, "Name", "Image name to assign"); + RNA_def_string(ot->srna, "name", "Image", MAX_ID_NAME-2, "Name", "Image name to assign"); RNA_def_string(ot->srna, "filepath", "Path", FILE_MAX, "Filepath", "Path to image file"); } diff --git a/source/blender/editors/mesh/mesh_intern.h b/source/blender/editors/mesh/mesh_intern.h index 352d3f304ea..4139e32bf0e 100644 --- a/source/blender/editors/mesh/mesh_intern.h +++ b/source/blender/editors/mesh/mesh_intern.h @@ -144,7 +144,6 @@ void MESH_OT_loop_select(struct wmOperatorType *ot); void MESH_OT_select_all(struct wmOperatorType *ot); void MESH_OT_select_more(struct wmOperatorType *ot); void MESH_OT_select_less(struct wmOperatorType *ot); -void MESH_OT_select_inverse(struct wmOperatorType *ot); void MESH_OT_select_non_manifold(struct wmOperatorType *ot); void MESH_OT_select_linked(struct wmOperatorType *ot); void MESH_OT_select_linked_pick(struct wmOperatorType *ot); diff --git a/source/blender/editors/mesh/mesh_ops.c b/source/blender/editors/mesh/mesh_ops.c index ba68f79f238..21f44ff89bc 100644 --- a/source/blender/editors/mesh/mesh_ops.c +++ b/source/blender/editors/mesh/mesh_ops.c @@ -62,7 +62,6 @@ void ED_operatortypes_mesh(void) WM_operatortype_append(MESH_OT_select_all); WM_operatortype_append(MESH_OT_select_more); WM_operatortype_append(MESH_OT_select_less); - WM_operatortype_append(MESH_OT_select_inverse); WM_operatortype_append(MESH_OT_select_non_manifold); WM_operatortype_append(MESH_OT_select_linked); WM_operatortype_append(MESH_OT_select_linked_pick); @@ -247,25 +246,32 @@ void ED_keymap_mesh(wmKeyConfig *keyconf) /* selecting */ /* standard mouse selection goes via space_view3d */ - WM_keymap_add_item(keymap, "MESH_OT_loop_select", SELECTMOUSE, KM_PRESS, KM_ALT, 0); - kmi= WM_keymap_add_item(keymap, "MESH_OT_loop_select", SELECTMOUSE, KM_PRESS, KM_SHIFT|KM_ALT, 0); - RNA_boolean_set(kmi->ptr, "extend", 1); + kmi = WM_keymap_add_item(keymap, "MESH_OT_loop_select", SELECTMOUSE, KM_PRESS, KM_ALT, 0); + RNA_boolean_set(kmi->ptr, "extend", FALSE); + kmi = WM_keymap_add_item(keymap, "MESH_OT_loop_select", SELECTMOUSE, KM_PRESS, KM_SHIFT|KM_ALT, 0); + RNA_boolean_set(kmi->ptr, "extend", TRUE); - WM_keymap_add_item(keymap, "MESH_OT_edgering_select", SELECTMOUSE, KM_PRESS, KM_ALT|KM_CTRL, 0); - kmi= WM_keymap_add_item(keymap, "MESH_OT_edgering_select", SELECTMOUSE, KM_PRESS, KM_SHIFT|KM_ALT|KM_CTRL, 0); - RNA_boolean_set(kmi->ptr, "extend", 1); + kmi = WM_keymap_add_item(keymap, "MESH_OT_edgering_select", SELECTMOUSE, KM_PRESS, KM_ALT|KM_CTRL, 0); + RNA_boolean_set(kmi->ptr, "extend", FALSE); + kmi = WM_keymap_add_item(keymap, "MESH_OT_edgering_select", SELECTMOUSE, KM_PRESS, KM_SHIFT|KM_ALT|KM_CTRL, 0); + RNA_boolean_set(kmi->ptr, "extend", TRUE); WM_keymap_add_item(keymap, "MESH_OT_select_shortest_path", SELECTMOUSE, KM_PRESS, KM_CTRL, 0); - WM_keymap_add_item(keymap, "MESH_OT_select_all", AKEY, KM_PRESS, 0, 0); + kmi = WM_keymap_add_item(keymap, "MESH_OT_select_all", AKEY, KM_PRESS, 0, 0); + RNA_enum_set(kmi->ptr, "action", SEL_TOGGLE); + kmi = WM_keymap_add_item(keymap, "MESH_OT_select_all", IKEY, KM_PRESS, KM_CTRL, 0); + RNA_enum_set(kmi->ptr, "action", SEL_INVERT); + WM_keymap_add_item(keymap, "MESH_OT_select_more", PADPLUSKEY, KM_PRESS, KM_CTRL, 0); WM_keymap_add_item(keymap, "MESH_OT_select_less", PADMINUS, KM_PRESS, KM_CTRL, 0); - WM_keymap_add_item(keymap, "MESH_OT_select_inverse", IKEY, KM_PRESS, KM_CTRL, 0); WM_keymap_add_item(keymap, "MESH_OT_select_non_manifold", MKEY, KM_PRESS, (KM_CTRL|KM_SHIFT|KM_ALT), 0); WM_keymap_add_item(keymap, "MESH_OT_select_linked", LKEY, KM_PRESS, KM_CTRL, 0); - WM_keymap_add_item(keymap, "MESH_OT_select_linked_pick", LKEY, KM_PRESS, 0, 0); - RNA_boolean_set(WM_keymap_add_item(keymap, "MESH_OT_select_linked_pick", LKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "deselect", 1); + kmi = WM_keymap_add_item(keymap, "MESH_OT_select_linked_pick", LKEY, KM_PRESS, 0, 0); + RNA_boolean_set(kmi->ptr, "deselect", FALSE); + kmi = WM_keymap_add_item(keymap, "MESH_OT_select_linked_pick", LKEY, KM_PRESS, KM_SHIFT, 0); + RNA_boolean_set(kmi->ptr, "deselect", TRUE); WM_keymap_add_item(keymap, "MESH_OT_faces_select_linked_flat", FKEY, KM_PRESS, (KM_CTRL|KM_SHIFT|KM_ALT), 0); @@ -275,13 +281,17 @@ void ED_keymap_mesh(wmKeyConfig *keyconf) WM_keymap_add_menu(keymap, "VIEW3D_MT_edit_mesh_select_mode", TABKEY, KM_PRESS, KM_CTRL, 0); /* hide */ - WM_keymap_add_item(keymap, "MESH_OT_hide", HKEY, KM_PRESS, 0, 0); - RNA_boolean_set(WM_keymap_add_item(keymap, "MESH_OT_hide", HKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "unselected", 1); + kmi = WM_keymap_add_item(keymap, "MESH_OT_hide", HKEY, KM_PRESS, 0, 0); + RNA_boolean_set(kmi->ptr, "unselected", FALSE); + kmi = WM_keymap_add_item(keymap, "MESH_OT_hide", HKEY, KM_PRESS, KM_SHIFT, 0); + RNA_boolean_set(kmi->ptr, "unselected", TRUE); WM_keymap_add_item(keymap, "MESH_OT_reveal", HKEY, KM_PRESS, KM_ALT, 0); /* tools */ - WM_keymap_add_item(keymap, "MESH_OT_normals_make_consistent", NKEY, KM_PRESS, KM_CTRL, 0); - RNA_boolean_set(WM_keymap_add_item(keymap, "MESH_OT_normals_make_consistent", NKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0)->ptr, "inside", 1); + kmi = WM_keymap_add_item(keymap, "MESH_OT_normals_make_consistent", NKEY, KM_PRESS, KM_CTRL, 0); + RNA_boolean_set(kmi->ptr, "inside", FALSE); + kmi = WM_keymap_add_item(keymap, "MESH_OT_normals_make_consistent", NKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0); + RNA_boolean_set(kmi->ptr, "inside", TRUE); WM_keymap_add_item(keymap, "VIEW3D_OT_edit_mesh_extrude_move_normal", EKEY, KM_PRESS, 0, 0); /* python operator */ WM_keymap_add_menu(keymap, "VIEW3D_MT_edit_mesh_extrude", EKEY, KM_PRESS, KM_ALT, 0); @@ -312,8 +322,10 @@ void ED_keymap_mesh(wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "MESH_OT_split", YKEY, KM_PRESS, 0, 0); /* use KM_CLICK because same key is used for tweaks */ - WM_keymap_add_item(keymap, "MESH_OT_dupli_extrude_cursor", ACTIONMOUSE, KM_CLICK, KM_CTRL, 0); - RNA_boolean_set(WM_keymap_add_item(keymap, "MESH_OT_dupli_extrude_cursor", ACTIONMOUSE, KM_CLICK, KM_SHIFT|KM_CTRL, 0)->ptr, "rotate_source", 0); + kmi = WM_keymap_add_item(keymap, "MESH_OT_dupli_extrude_cursor", ACTIONMOUSE, KM_CLICK, KM_CTRL, 0); + RNA_boolean_set(kmi->ptr, "rotate_source", TRUE); + kmi = WM_keymap_add_item(keymap, "MESH_OT_dupli_extrude_cursor", ACTIONMOUSE, KM_CLICK, KM_SHIFT|KM_CTRL, 0); + RNA_boolean_set(kmi->ptr, "rotate_source", FALSE); WM_keymap_add_item(keymap, "MESH_OT_delete", XKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "MESH_OT_delete", DELKEY, KM_PRESS, 0, 0); diff --git a/source/blender/editors/metaball/mball_edit.c b/source/blender/editors/metaball/mball_edit.c index 414d3344511..c8adfbda708 100644 --- a/source/blender/editors/metaball/mball_edit.c +++ b/source/blender/editors/metaball/mball_edit.c @@ -181,45 +181,6 @@ void MBALL_OT_select_all(wmOperatorType *ot) WM_operator_properties_select_all(ot); } -/***************************** Select inverse operator *****************************/ - -/* Invert metaball selection */ -static int select_inverse_metaelems_exec(bContext *C, wmOperator *UNUSED(op)) -{ - Object *obedit= CTX_data_edit_object(C); - MetaBall *mb = (MetaBall*)obedit->data; - MetaElem *ml; - - ml= mb->editelems->first; - if(ml) { - while(ml) { - if(ml->flag & SELECT) - ml->flag &= ~SELECT; - else - ml->flag |= SELECT; - ml= ml->next; - } - WM_event_add_notifier(C, NC_GEOM|ND_SELECT, mb); - } - - return OPERATOR_FINISHED; -} - -void MBALL_OT_select_inverse_metaelems(wmOperatorType *ot) -{ - /* identifiers */ - ot->name= "Inverse"; - ot->description= "Select inverse of (un)selected metaelements"; - ot->idname= "MBALL_OT_select_inverse_metaelems"; - - /* callback functions */ - ot->exec= select_inverse_metaelems_exec; - ot->poll= ED_operator_editmball; - - /* flags */ - ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; -} - /***************************** Select random operator *****************************/ /* Random metaball selection */ diff --git a/source/blender/editors/metaball/mball_intern.h b/source/blender/editors/metaball/mball_intern.h index 792fa80e0c5..1cb4c19fc72 100644 --- a/source/blender/editors/metaball/mball_intern.h +++ b/source/blender/editors/metaball/mball_intern.h @@ -43,7 +43,6 @@ void MBALL_OT_delete_metaelems(struct wmOperatorType *ot); void MBALL_OT_duplicate_metaelems(struct wmOperatorType *ot); void MBALL_OT_select_all(struct wmOperatorType *ot); -void MBALL_OT_select_inverse_metaelems(struct wmOperatorType *ot); void MBALL_OT_select_random_metaelems(struct wmOperatorType *ot); #endif diff --git a/source/blender/editors/metaball/mball_ops.c b/source/blender/editors/metaball/mball_ops.c index 4d04fc3e80e..4c69bb3e559 100644 --- a/source/blender/editors/metaball/mball_ops.c +++ b/source/blender/editors/metaball/mball_ops.c @@ -48,13 +48,13 @@ void ED_operatortypes_metaball(void) WM_operatortype_append(MBALL_OT_reveal_metaelems); WM_operatortype_append(MBALL_OT_select_all); - WM_operatortype_append(MBALL_OT_select_inverse_metaelems); WM_operatortype_append(MBALL_OT_select_random_metaelems); } void ED_keymap_metaball(wmKeyConfig *keyconf) { wmKeyMap *keymap; + wmKeyMapItem *kmi; keymap= WM_keymap_find(keyconf, "Metaball", 0, 0); keymap->poll= ED_operator_editmball; @@ -69,7 +69,9 @@ void ED_keymap_metaball(wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "MBALL_OT_delete_metaelems", DELKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "MBALL_OT_duplicate_metaelems", DKEY, KM_PRESS, KM_SHIFT, 0); - WM_keymap_add_item(keymap, "MBALL_OT_select_all", AKEY, KM_PRESS, 0, 0); - WM_keymap_add_item(keymap, "MBALL_OT_select_inverse_metaelems", IKEY, KM_PRESS, KM_CTRL, 0); + kmi = WM_keymap_add_item(keymap, "MBALL_OT_select_all", AKEY, KM_PRESS, 0, 0); + RNA_enum_set(kmi->ptr, "action", SEL_TOGGLE); + kmi = WM_keymap_add_item(keymap, "MBALL_OT_select_all", IKEY, KM_PRESS, KM_CTRL, 0); + RNA_enum_set(kmi->ptr, "action", SEL_INVERT); } diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 1547c5daf54..c53549728f6 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -189,52 +189,55 @@ void ED_object_add_generic_props(wmOperatorType *ot, int do_editmode) PropertyRNA *prop; /* note: this property gets hidden for add-camera operator */ - prop= RNA_def_boolean(ot->srna, "view_align", 0, "Align to View", "Align the new object to the view"); + prop = RNA_def_boolean(ot->srna, "view_align", 0, "Align to View", "Align the new object to the view"); RNA_def_property_update_runtime(prop, view_align_update); if(do_editmode) { - prop= RNA_def_boolean(ot->srna, "enter_editmode", 0, "Enter Editmode", "Enter editmode when adding this object"); - RNA_def_property_flag(prop, PROP_HIDDEN); + prop = RNA_def_boolean(ot->srna, "enter_editmode", 0, "Enter Editmode", + "Enter editmode when adding this object"); + RNA_def_property_flag(prop, PROP_HIDDEN|PROP_SKIP_SAVE); } - RNA_def_float_vector_xyz(ot->srna, "location", 3, NULL, -FLT_MAX, FLT_MAX, "Location", "Location for the newly added object", -FLT_MAX, FLT_MAX); - RNA_def_float_rotation(ot->srna, "rotation", 3, NULL, -FLT_MAX, FLT_MAX, "Rotation", "Rotation for the newly added object", (float)-M_PI * 2.0f, (float)M_PI * 2.0f); + prop = RNA_def_float_vector_xyz(ot->srna, "location", 3, NULL, -FLT_MAX, FLT_MAX, "Location", + "Location for the newly added object", -FLT_MAX, FLT_MAX); + RNA_def_property_flag(prop, PROP_SKIP_SAVE); + prop = RNA_def_float_rotation(ot->srna, "rotation", 3, NULL, -FLT_MAX, FLT_MAX, "Rotation", + "Rotation for the newly added object", (float)-M_PI * 2.0f, (float)M_PI * 2.0f); + RNA_def_property_flag(prop, PROP_SKIP_SAVE); prop = RNA_def_boolean_layer_member(ot->srna, "layers", 20, NULL, "Layer", ""); - RNA_def_property_flag(prop, PROP_HIDDEN); + RNA_def_property_flag(prop, PROP_HIDDEN|PROP_SKIP_SAVE); } static void object_add_generic_invoke_options(bContext *C, wmOperator *op) { if(RNA_struct_find_property(op->ptr, "enter_editmode")) /* optional */ - if (!RNA_property_is_set(op->ptr, "enter_editmode")) + if (!RNA_struct_property_is_set(op->ptr, "enter_editmode")) RNA_boolean_set(op->ptr, "enter_editmode", U.flag & USER_ADD_EDITMODE); - if(!RNA_property_is_set(op->ptr, "location")) { + if(!RNA_struct_property_is_set(op->ptr, "location")) { float loc[3]; ED_object_location_from_view(C, loc); RNA_float_set_array(op->ptr, "location", loc); } - if(!RNA_property_is_set(op->ptr, "layers")) { + if(!RNA_struct_property_is_set(op->ptr, "layers")) { View3D *v3d = CTX_wm_view3d(C); Scene *scene = CTX_data_scene(C); int a, values[20], layer; - + if(v3d) { layer = (v3d->scenelock && !v3d->localvd)? scene->layact: v3d->layact; - - for(a=0; a<20; a++) - values[a]= (layer & (1<<a)); } else { layer = scene->layact; + } - for(a=0; a<20; a++) - values[a]= (layer & (1<<a)); + for (a=0; a<20; a++) { + values[a]= (layer & (1<<a)); } - + RNA_boolean_set_array(op->ptr, "layers", values); } } @@ -257,7 +260,7 @@ int ED_object_add_generic_get_opts(bContext *C, wmOperator *op, float *loc, *enter_editmode = TRUE; } - if(RNA_property_is_set(op->ptr, "layers")) { + if(RNA_struct_property_is_set(op->ptr, "layers")) { RNA_boolean_get_array(op->ptr, "layers", layer_values); *layer= 0; for(a=0; a<20; a++) { @@ -278,9 +281,9 @@ int ED_object_add_generic_get_opts(bContext *C, wmOperator *op, float *loc, if(v3d && v3d->localvd) *layer |= v3d->lay; - if(RNA_property_is_set(op->ptr, "rotation")) + if(RNA_struct_property_is_set(op->ptr, "rotation")) view_align = FALSE; - else if (RNA_property_is_set(op->ptr, "view_align")) + else if (RNA_struct_property_is_set(op->ptr, "view_align")) view_align = RNA_boolean_get(op->ptr, "view_align"); else { view_align = U.flag & USER_ADD_VIEWALIGNED; @@ -1916,7 +1919,7 @@ static int add_named_exec(bContext *C, wmOperator *op) Object *ob; int linked= RNA_boolean_get(op->ptr, "linked"); int dupflag= (linked)? 0: U.dupflag; - char name[32]; + char name[MAX_ID_NAME-2]; /* find object, create fake base */ RNA_string_get(op->ptr, "name", name); @@ -1971,7 +1974,7 @@ void OBJECT_OT_add_named(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; RNA_def_boolean(ot->srna, "linked", 0, "Linked", "Duplicate object but not object data, linking to the original data"); - RNA_def_string(ot->srna, "name", "Cube", 24, "Name", "Object name to add"); + RNA_def_string(ot->srna, "name", "Cube", MAX_ID_NAME-2, "Name", "Object name to add"); } diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c index 8266f3501c5..a90edb29c29 100644 --- a/source/blender/editors/object/object_constraint.c +++ b/source/blender/editors/object/object_constraint.c @@ -542,7 +542,7 @@ static int edit_constraint_poll(bContext *C) static void edit_constraint_properties(wmOperatorType *ot) { - RNA_def_string(ot->srna, "constraint", "", 32, "Constraint", "Name of the constraint to edit"); + RNA_def_string(ot->srna, "constraint", "", MAX_NAME, "Constraint", "Name of the constraint to edit"); RNA_def_enum(ot->srna, "owner", constraint_owner_items, 0, "Owner", "The owner of this constraint"); } @@ -553,7 +553,7 @@ static int edit_constraint_invoke_properties(bContext *C, wmOperator *op) bConstraint *con; ListBase *list; - if (RNA_property_is_set(op->ptr, "constraint") && RNA_property_is_set(op->ptr, "owner")) + if (RNA_struct_property_is_set(op->ptr, "constraint") && RNA_struct_property_is_set(op->ptr, "owner")) return 1; if (ptr.data) { @@ -575,7 +575,7 @@ static int edit_constraint_invoke_properties(bContext *C, wmOperator *op) static bConstraint *edit_constraint_property_get(wmOperator *op, Object *ob, int type) { - char constraint_name[32]; + char constraint_name[MAX_NAME]; int owner = RNA_enum_get(op->ptr, "owner"); bConstraint *con; ListBase *list=NULL; diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 6a68a264a28..61ba54e7d36 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -321,9 +321,6 @@ void ED_object_exit_editmode(bContext *C, int flag) // if(EM_texFaceCheck()) -// if(retopo_mesh_paint_check()) -// retopo_end_okee(); - if(me->edit_mesh->totvert>MESH_MAX_VERTS) { error("Too many vertices"); return; @@ -595,132 +592,6 @@ void OBJECT_OT_posemode_toggle(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } -/* *********************** */ - -#if 0 -// XXX should be in view3d? - -/* context: ob = lamp */ -/* code should be replaced with proper (custom) transform handles for lamp properties */ -static void spot_interactive(Object *ob, int mode) -{ - Lamp *la= ob->data; - float transfac, dx, dy, ratio, origval; - int keep_running= 1, center2d[2]; - int mval[2], mvalo[2]; - -// getmouseco_areawin(mval); -// getmouseco_areawin(mvalo); - - project_int(ob->obmat[3], center2d); - if( center2d[0] > 100000 ) { /* behind camera */ -// center2d[0]= curarea->winx/2; -// center2d[1]= curarea->winy/2; - } - -// helpline(mval, center2d); - - /* ratio is like scaling */ - dx = (float)(center2d[0] - mval[0]); - dy = (float)(center2d[1] - mval[1]); - transfac = (float)sqrt( dx*dx + dy*dy); - if(transfac==0.0f) transfac= 1.0f; - - if(mode==1) - origval= la->spotsize; - else if(mode==2) - origval= la->dist; - else if(mode==3) - origval= la->clipsta; - else - origval= la->clipend; - - while (keep_running>0) { - -// getmouseco_areawin(mval); - - /* essential for idling subloop */ - if(mval[0]==mvalo[0] && mval[1]==mvalo[1]) { - PIL_sleep_ms(2); - } - else { - char str[32]; - - dx = (float)(center2d[0] - mval[0]); - dy = (float)(center2d[1] - mval[1]); - ratio = (float)(sqrt( dx*dx + dy*dy))/transfac; - - /* do the trick */ - - if(mode==1) { /* spot */ - la->spotsize = ratio*origval; - CLAMP(la->spotsize, 1.0f, 180.0f); - sprintf(str, "Spot size %.2f\n", la->spotsize); - } - else if(mode==2) { /* dist */ - la->dist = ratio*origval; - CLAMP(la->dist, 0.01f, 5000.0f); - sprintf(str, "Distance %.2f\n", la->dist); - } - else if(mode==3) { /* sta */ - la->clipsta = ratio*origval; - CLAMP(la->clipsta, 0.001f, 5000.0f); - sprintf(str, "Distance %.2f\n", la->clipsta); - } - else if(mode==4) { /* end */ - la->clipend = ratio*origval; - CLAMP(la->clipend, 0.1f, 5000.0f); - sprintf(str, "Clip End %.2f\n", la->clipend); - } - - /* cleanup */ - mvalo[0]= mval[0]; - mvalo[1]= mval[1]; - - /* handle shaded mode */ -// XXX shade_buttons_change_3d(); - - /* DRAW */ - headerprint(str); - force_draw_plus(SPACE_BUTS, 0); - -// helpline(mval, center2d); - } - - while( qtest() ) { - short val; - unsigned short event= extern_qread(&val); - - switch (event){ - case ESCKEY: - case RIGHTMOUSE: - keep_running= 0; - break; - case LEFTMOUSE: - case SPACEKEY: - case PADENTER: - case RETKEY: - if(val) - keep_running= -1; - break; - } - } - } - - if(keep_running==0) { - if(mode==1) - la->spotsize= origval; - else if(mode==2) - la->dist= origval; - else if(mode==3) - la->clipsta= origval; - else - la->clipend= origval; - } - -} -#endif - static void copymenu_properties(Scene *scene, View3D *v3d, Object *ob) { //XXX no longer used - to be removed - replaced by game_properties_copy_exec @@ -1609,7 +1480,7 @@ static int game_property_new(bContext *C, wmOperator *op) { Object *ob= CTX_data_active_object(C); bProperty *prop; - char name[32]; + char name[MAX_NAME]; int type= RNA_enum_get(op->ptr, "type"); prop= new_property(type); @@ -1642,7 +1513,7 @@ void OBJECT_OT_game_property_new(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; RNA_def_enum(ot->srna, "type", gameproperty_type_items, 2, "Type", "Type of game property to add"); - RNA_def_string(ot->srna, "name", "", 32, "Name", "Name of the game property to add"); + RNA_def_string(ot->srna, "name", "", MAX_NAME, "Name", "Name of the game property to add"); } static int game_property_remove(bContext *C, wmOperator *op) diff --git a/source/blender/editors/object/object_group.c b/source/blender/editors/object/object_group.c index 74cf174d7b4..1b8c0fd0840 100644 --- a/source/blender/editors/object/object_group.c +++ b/source/blender/editors/object/object_group.c @@ -192,7 +192,7 @@ static int group_create_exec(bContext *C, wmOperator *op) Main *bmain= CTX_data_main(C); Scene *scene= CTX_data_scene(C); Group *group= NULL; - char name[32]; /* id name */ + char name[MAX_ID_NAME-2]; /* id name */ RNA_string_get(op->ptr, "name", name); @@ -223,7 +223,7 @@ void GROUP_OT_create(wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - RNA_def_string(ot->srna, "name", "Group", 32, "Name", "Name of the new group"); + RNA_def_string(ot->srna, "name", "Group", MAX_ID_NAME-2, "Name", "Name of the new group"); } /****************** properties window operators *********************/ diff --git a/source/blender/editors/object/object_hook.c b/source/blender/editors/object/object_hook.c index 7bb91c1fc4b..de991f28e4a 100644 --- a/source/blender/editors/object/object_hook.c +++ b/source/blender/editors/object/object_hook.c @@ -428,7 +428,7 @@ static void add_hook_object(Main *bmain, Scene *scene, Object *obedit, Object *o HookModifierData *hmd = NULL; float cent[3]; int tot, ok, *indexar; - char name[32]; + char name[MAX_NAME]; ok = object_hook_index_array(scene, obedit, &tot, &indexar, name, cent); @@ -747,7 +747,7 @@ static int object_hook_assign_exec(bContext *C, wmOperator *op) Object *ob=NULL; HookModifierData *hmd=NULL; float cent[3]; - char name[32]; + char name[MAX_NAME]; int *indexar, tot; if (ptr.data) { /* if modifier context is available, use that */ diff --git a/source/blender/editors/object/object_intern.h b/source/blender/editors/object/object_intern.h index 8973fb88c85..7f416feb0d5 100644 --- a/source/blender/editors/object/object_intern.h +++ b/source/blender/editors/object/object_intern.h @@ -96,14 +96,12 @@ void OBJECT_OT_game_physics_copy(struct wmOperatorType *ot); /* object_select.c */ void OBJECT_OT_select_all(struct wmOperatorType *ot); -void OBJECT_OT_select_inverse(struct wmOperatorType *ot); void OBJECT_OT_select_random(struct wmOperatorType *ot); 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_select_name(struct wmOperatorType *ot); void OBJECT_OT_select_same_group(struct wmOperatorType *ot); /* object_add.c */ diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index 9a592bc9324..93f4a31f1ff 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -728,7 +728,7 @@ static int edit_modifier_poll(bContext *C) static void edit_modifier_properties(wmOperatorType *ot) { - RNA_def_string(ot->srna, "modifier", "", 32, "Modifier", "Name of the modifier to edit"); + RNA_def_string(ot->srna, "modifier", "", MAX_NAME, "Modifier", "Name of the modifier to edit"); } static int edit_modifier_invoke_properties(bContext *C, wmOperator *op) @@ -736,7 +736,7 @@ static int edit_modifier_invoke_properties(bContext *C, wmOperator *op) PointerRNA ptr= CTX_data_pointer_get_type(C, "modifier", &RNA_Modifier); ModifierData *md; - if (RNA_property_is_set(op->ptr, "modifier")) + if (RNA_struct_property_is_set(op->ptr, "modifier")) return 1; if (ptr.data) { @@ -750,7 +750,7 @@ static int edit_modifier_invoke_properties(bContext *C, wmOperator *op) static ModifierData *edit_modifier_property_get(wmOperator *op, Object *ob, int type) { - char modifier_name[32]; + char modifier_name[MAX_NAME]; ModifierData *md; RNA_string_get(op->ptr, "modifier", modifier_name); @@ -1209,7 +1209,7 @@ static int multires_external_save_invoke(bContext *C, wmOperator *op, wmEvent *U if(CustomData_external_test(&me->fdata, CD_MDISPS)) return OPERATOR_CANCELLED; - if(RNA_property_is_set(op->ptr, "filepath")) + if(RNA_struct_property_is_set(op->ptr, "filepath")) return multires_external_save_exec(C, op); op->customdata= me; diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c index acc318723d8..99eeaf334a8 100644 --- a/source/blender/editors/object/object_ops.c +++ b/source/blender/editors/object/object_ops.c @@ -94,7 +94,6 @@ void ED_operatortypes_object(void) WM_operatortype_append(OBJECT_OT_make_links_data); WM_operatortype_append(OBJECT_OT_move_to_layer); - WM_operatortype_append(OBJECT_OT_select_inverse); WM_operatortype_append(OBJECT_OT_select_random); WM_operatortype_append(OBJECT_OT_select_all); WM_operatortype_append(OBJECT_OT_select_same_group); @@ -103,7 +102,6 @@ void ED_operatortypes_object(void) 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_select_name); /* XXX - weak, not compat with linked objects */ WM_operatortype_append(GROUP_OT_create); WM_operatortype_append(GROUP_OT_objects_remove); @@ -246,7 +244,7 @@ void ED_operatormacros_object(void) ot= WM_operatortype_append_macro("OBJECT_OT_add_named_cursor", "Add named object at cursor", OPTYPE_UNDO|OPTYPE_REGISTER); if(ot) { ot->description = "Add named object at cursor"; - RNA_def_string(ot->srna, "name", "Cube", 24, "Name", "Object name to add"); + RNA_def_string(ot->srna, "name", "Cube", MAX_ID_NAME-2, "Name", "Object name to add"); WM_operatortype_macro_define(ot, "VIEW3D_OT_cursor3d"); WM_operatortype_macro_define(ot, "OBJECT_OT_add_named"); @@ -297,23 +295,28 @@ void ED_keymap_object(wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "VIEW3D_OT_game_start", PKEY, KM_PRESS, 0, 0); - WM_keymap_add_item(keymap, "OBJECT_OT_select_all", AKEY, KM_PRESS, 0, 0); - WM_keymap_add_item(keymap, "OBJECT_OT_select_inverse", IKEY, KM_PRESS, KM_CTRL, 0); + kmi = WM_keymap_add_item(keymap, "OBJECT_OT_select_all", AKEY, KM_PRESS, 0, 0); + RNA_enum_set(kmi->ptr, "action", SEL_TOGGLE); + kmi = WM_keymap_add_item(keymap, "OBJECT_OT_select_all", IKEY, KM_PRESS, KM_CTRL, 0); + RNA_enum_set(kmi->ptr, "action", SEL_INVERT); + 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); kmi= WM_keymap_add_item(keymap, "OBJECT_OT_select_hierarchy", LEFTBRACKETKEY, KM_PRESS, 0, 0); RNA_enum_set_identifier(kmi->ptr, "direction", "PARENT"); + RNA_boolean_set(kmi->ptr, "extend", FALSE); kmi= WM_keymap_add_item(keymap, "OBJECT_OT_select_hierarchy", LEFTBRACKETKEY, KM_PRESS, KM_SHIFT, 0); RNA_enum_set_identifier(kmi->ptr, "direction", "PARENT"); - RNA_boolean_set(kmi->ptr, "extend", 1); + RNA_boolean_set(kmi->ptr, "extend", TRUE); kmi= WM_keymap_add_item(keymap, "OBJECT_OT_select_hierarchy", RIGHTBRACKETKEY, KM_PRESS, 0, 0); RNA_enum_set_identifier(kmi->ptr, "direction", "CHILD"); + RNA_boolean_set(kmi->ptr, "extend", FALSE); kmi= WM_keymap_add_item(keymap, "OBJECT_OT_select_hierarchy", RIGHTBRACKETKEY, KM_PRESS, KM_SHIFT, 0); RNA_enum_set_identifier(kmi->ptr, "direction", "CHILD"); - RNA_boolean_set(kmi->ptr, "extend", 1); + RNA_boolean_set(kmi->ptr, "extend", TRUE); WM_keymap_verify_item(keymap, "OBJECT_OT_parent_set", PKEY, KM_PRESS, KM_CTRL, 0); WM_keymap_verify_item(keymap, "OBJECT_OT_parent_no_inverse_set", PKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0); diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 1ba0157e8d3..a0bddda0413 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -335,7 +335,7 @@ static int make_proxy_exec (bContext *C, wmOperator *op) if (ob) { Object *newob; Base *newbase, *oldbase= BASACT; - char name[32]; + char name[MAX_ID_NAME+4]; /* Add new object for the proxy */ newob= add_object(scene, OB_EMPTY); @@ -1056,7 +1056,7 @@ static unsigned int move_to_layer_init(bContext *C, wmOperator *op) int values[20], a; unsigned int lay= 0; - if(!RNA_property_is_set(op->ptr, "layers")) { + if(!RNA_struct_property_is_set(op->ptr, "layers")) { /* note: layers are set in bases, library objects work for this */ CTX_DATA_BEGIN(C, Base*, base, selected_bases) { lay |= base->lay; @@ -1890,7 +1890,7 @@ static int drop_named_material_invoke(bContext *C, wmOperator *op, wmEvent *even Main *bmain= CTX_data_main(C); Base *base= ED_view3d_give_base_under_cursor(C, event->mval); Material *ma; - char name[32]; + char name[MAX_ID_NAME-2]; RNA_string_get(op->ptr, "name", name); ma= (Material *)find_id("MA", name); @@ -1923,5 +1923,5 @@ void OBJECT_OT_drop_named_material(wmOperatorType *ot) ot->flag= OPTYPE_UNDO; /* properties */ - RNA_def_string(ot->srna, "name", "Material", 24, "Name", "Material name to assign"); + RNA_def_string(ot->srna, "name", "Material", MAX_ID_NAME-2, "Name", "Material name to assign"); } diff --git a/source/blender/editors/object/object_select.c b/source/blender/editors/object/object_select.c index c4d33b74574..69372ac1a90 100644 --- a/source/blender/editors/object/object_select.c +++ b/source/blender/editors/object/object_select.c @@ -739,41 +739,6 @@ void OBJECT_OT_select_by_layer(wmOperatorType *ot) RNA_def_int(ot->srna, "layers", 1, 1, 20, "Layer", "", 1, 20); } -/************************** Select Inverse *************************/ - -static int object_select_inverse_exec(bContext *C, wmOperator *UNUSED(op)) -{ - CTX_DATA_BEGIN(C, Base*, base, visible_bases) { - if (base->flag & SELECT) - ED_base_object_select(base, BA_DESELECT); - else - ED_base_object_select(base, BA_SELECT); - } - 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_inverse(wmOperatorType *ot) -{ - - /* identifiers */ - ot->name= "Select Inverse"; - ot->description = "Invert selection of all visible objects"; - ot->idname= "OBJECT_OT_select_inverse"; - - /* api callbacks */ - ot->exec= object_select_inverse_exec; - ot->poll= objects_selectable_poll; - - /* flags */ - ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - -} - /**************************** (De)select All ****************************/ static int object_select_all_exec(bContext *C, wmOperator *op) @@ -841,7 +806,7 @@ void OBJECT_OT_select_all(wmOperatorType *ot) static int object_select_same_group_exec(bContext *C, wmOperator *op) { Group *group; - char group_name[32]; + char group_name[MAX_ID_NAME]; /* passthrough if no objects are visible */ if (CTX_DATA_COUNT(C, visible_bases) == 0) return OPERATOR_PASS_THROUGH; @@ -882,7 +847,7 @@ void OBJECT_OT_select_same_group(wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - RNA_def_string(ot->srna, "group", "", 32, "Group", "Name of the group to select"); + RNA_def_string(ot->srna, "group", "", MAX_ID_NAME, "Group", "Name of the group to select"); } /**************************** Select Mirror ****************************/ @@ -939,63 +904,6 @@ void OBJECT_OT_select_mirror(wmOperatorType *ot) } -static int object_select_name_exec(bContext *C, wmOperator *op) -{ - char *name= RNA_string_get_alloc(op->ptr, "name", NULL, 0); - short extend= RNA_boolean_get(op->ptr, "extend"); - short changed = 0; - - if(!extend) { - CTX_DATA_BEGIN(C, Base*, base, selectable_bases) { - if(base->flag & SELECT) { - ED_base_object_select(base, BA_DESELECT); - changed= 1; - } - } - CTX_DATA_END; - } - - CTX_DATA_BEGIN(C, Base*, base, selectable_bases) { - /* this is a bit dodjy, there should only be ONE object with this name, but library objects can mess this up */ - if(strcmp(name, base->object->id.name+2)==0) { - ED_base_object_activate(C, base); - ED_base_object_select(base, BA_SELECT); - changed= 1; - } - } - CTX_DATA_END; - - MEM_freeN(name); - - /* undo? */ - if(changed) { - WM_event_add_notifier(C, NC_SCENE|ND_OB_SELECT, CTX_data_scene(C)); - return OPERATOR_FINISHED; - } - else { - return OPERATOR_CANCELLED; - } -} - -void OBJECT_OT_select_name(wmOperatorType *ot) -{ - - /* identifiers */ - ot->name= "Select Name"; - ot->description = "Select an object with this name"; - ot->idname= "OBJECT_OT_select_name"; - - /* api callbacks */ - ot->exec= object_select_name_exec; - ot->poll= objects_selectable_poll; - - /* flags */ - ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - - RNA_def_string(ot->srna, "name", "", 0, "Name", "Object name to select"); - RNA_def_boolean(ot->srna, "extend", 0, "Extend", "Extend selection instead of deselecting everything first"); -} - /**************************** Select Random ****************************/ static int object_select_random_exec(bContext *C, wmOperator *op) diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c index a83896e7280..e57574af839 100644 --- a/source/blender/editors/object/object_transform.c +++ b/source/blender/editors/object/object_transform.c @@ -645,7 +645,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op) /* get the view settings if 'around' isnt set and the view is available */ View3D *v3d= CTX_wm_view3d(C); copy_v3_v3(cursor, give_cursor(scene, v3d)); - if(v3d && !RNA_property_is_set(op->ptr, "center")) + if(v3d && !RNA_struct_property_is_set(op->ptr, "center")) around= v3d->around; } diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c index dfe0b94605d..f91740f4b47 100644 --- a/source/blender/editors/object/object_vgroup.c +++ b/source/blender/editors/object/object_vgroup.c @@ -2058,7 +2058,7 @@ static int vertex_group_poll(bContext *C) return (ob && !ob->id.lib && OB_TYPE_SUPPORT_VGROUP(ob->type) && data && !data->lib); } -static int vertex_group_poll_edit(bContext *C) +static int UNUSED_FUNCTION(vertex_group_poll_edit)(bContext *C) { Object *ob= ED_object_context(C); ID *data= (ob)? ob->data: NULL; diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c index 52e6d4f6ab8..dbf03e34c32 100644 --- a/source/blender/editors/physics/particle_edit.c +++ b/source/blender/editors/physics/particle_edit.c @@ -254,13 +254,21 @@ static PTCacheEdit *pe_get_current(Scene *scene, Object *ob, int create) } else if(pset->edittype == PE_TYPE_SOFTBODY && pid->type == PTCACHE_TYPE_SOFTBODY) { if(create && pid->cache->flag & PTCACHE_BAKED && !pid->cache->edit) + { + pset->flag |= PE_FADE_TIME; + // NICE TO HAVE but doesn't work: pset->brushtype = PE_BRUSH_COMB; PE_create_particle_edit(scene, ob, pid->cache, NULL); + } edit = pid->cache->edit; break; } else if(pset->edittype == PE_TYPE_CLOTH && pid->type == PTCACHE_TYPE_CLOTH) { if(create && pid->cache->flag & PTCACHE_BAKED && !pid->cache->edit) + { + pset->flag |= PE_FADE_TIME; + // NICE TO HAVE but doesn't work: pset->brushtype = PE_BRUSH_COMB; PE_create_particle_edit(scene, ob, pid->cache, NULL); + } edit = pid->cache->edit; break; } @@ -1872,43 +1880,6 @@ void PARTICLE_OT_select_more(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } -static int select_inverse_exec(bContext *C, wmOperator *UNUSED(op)) -{ - PEData data; - PTCacheEdit *edit; - POINT_P; KEY_K; - - PE_set_data(C, &data); - - edit= PE_get_current(data.scene, data.ob); - - LOOP_VISIBLE_POINTS { - LOOP_KEYS { - key->flag ^= PEK_SELECT; - point->flag |= PEP_EDIT_RECALC; /* redraw selection only */ - } - } - - PE_update_selection(data.scene, data.ob, 1); - WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE|NA_SELECTED, data.ob); - - return OPERATOR_FINISHED; -} - -void PARTICLE_OT_select_inverse(wmOperatorType *ot) -{ - /* identifiers */ - ot->name= "Select Inverse"; - ot->idname= "PARTICLE_OT_select_inverse"; - - /* api callbacks */ - ot->exec= select_inverse_exec; - ot->poll= PE_poll; - - /* flags */ - ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; -} - /************************ rekey operator ************************/ static void rekey_particle(PEData *data, int pa_index) @@ -3659,8 +3630,14 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr) PE_update_object(scene, ob, 1); } - WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE|NA_EDITED, ob); - + if(edit->psys) + WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE|NA_EDITED, ob); + else + { + DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob); + } + bedit->lastmouse[0]= mouse[0]; bedit->lastmouse[1]= mouse[1]; bedit->first= 0; diff --git a/source/blender/editors/physics/physics_fluid.c b/source/blender/editors/physics/physics_fluid.c index 5294e29d3d5..d652d2c0e5c 100644 --- a/source/blender/editors/physics/physics_fluid.c +++ b/source/blender/editors/physics/physics_fluid.c @@ -884,7 +884,7 @@ static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain, shor if(getenv(strEnvName)) { int dlevel = atoi(getenv(strEnvName)); elbeemSetDebugLevel(dlevel); - BLI_snprintf(debugStrBuffer,256,"fluidsimBake::msg: Debug messages activated due to envvar '%s'\n",strEnvName); + BLI_snprintf(debugStrBuffer, sizeof(debugStrBuffer),"fluidsimBake::msg: Debug messages activated due to envvar '%s'\n",strEnvName); elbeemDebugOut(debugStrBuffer); } @@ -921,7 +921,7 @@ static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain, shor /* rough check of settings... */ if(domainSettings->previewresxyz > domainSettings->resolutionxyz) { - BLI_snprintf(debugStrBuffer,256,"fluidsimBake::warning - Preview (%d) >= Resolution (%d)... setting equal.\n", domainSettings->previewresxyz , domainSettings->resolutionxyz); + BLI_snprintf(debugStrBuffer,sizeof(debugStrBuffer),"fluidsimBake::warning - Preview (%d) >= Resolution (%d)... setting equal.\n", domainSettings->previewresxyz , domainSettings->resolutionxyz); elbeemDebugOut(debugStrBuffer); domainSettings->previewresxyz = domainSettings->resolutionxyz; } @@ -941,7 +941,7 @@ static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain, shor } else { gridlevels = domainSettings->maxRefine; } - BLI_snprintf(debugStrBuffer,256,"fluidsimBake::msg: Baking %s, refine: %d\n", fsDomain->id.name , gridlevels ); + BLI_snprintf(debugStrBuffer,sizeof(debugStrBuffer),"fluidsimBake::msg: Baking %s, refine: %d\n", fsDomain->id.name , gridlevels ); elbeemDebugOut(debugStrBuffer); @@ -993,7 +993,7 @@ static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain, shor /* ******** init domain object's matrix ******** */ copy_m4_m4(domainMat, fsDomain->obmat); if(!invert_m4_m4(invDomMat, domainMat)) { - BLI_snprintf(debugStrBuffer,256,"fluidsimBake::error - Invalid obj matrix?\n"); + BLI_snprintf(debugStrBuffer,sizeof(debugStrBuffer),"fluidsimBake::error - Invalid obj matrix?\n"); elbeemDebugOut(debugStrBuffer); BKE_report(reports, RPT_ERROR, "Invalid object matrix"); @@ -1042,7 +1042,7 @@ static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain, shor fsset->surfaceSmoothing = domainSettings->surfaceSmoothing; fsset->surfaceSubdivs = domainSettings->surfaceSubdivs; fsset->farFieldSize = domainSettings->farFieldSize; - BLI_strncpy(fsset->outputPath, targetFile, 240); + BLI_strncpy(fsset->outputPath, targetFile, sizeof(fsset->outputPath)); // domain channels fsset->channelSizeFrameTime = diff --git a/source/blender/editors/physics/physics_intern.h b/source/blender/editors/physics/physics_intern.h index 0dae8b362cd..db6d63f6396 100644 --- a/source/blender/editors/physics/physics_intern.h +++ b/source/blender/editors/physics/physics_intern.h @@ -42,7 +42,6 @@ void PARTICLE_OT_select_tips(struct wmOperatorType *ot); void PARTICLE_OT_select_linked(struct wmOperatorType *ot); void PARTICLE_OT_select_less(struct wmOperatorType *ot); void PARTICLE_OT_select_more(struct wmOperatorType *ot); -void PARTICLE_OT_select_inverse(struct wmOperatorType *ot); void PARTICLE_OT_hide(struct wmOperatorType *ot); void PARTICLE_OT_reveal(struct wmOperatorType *ot); diff --git a/source/blender/editors/physics/physics_ops.c b/source/blender/editors/physics/physics_ops.c index e39b4b97d72..09f99a58dd7 100644 --- a/source/blender/editors/physics/physics_ops.c +++ b/source/blender/editors/physics/physics_ops.c @@ -51,7 +51,6 @@ static void operatortypes_particle(void) WM_operatortype_append(PARTICLE_OT_select_linked); WM_operatortype_append(PARTICLE_OT_select_less); WM_operatortype_append(PARTICLE_OT_select_more); - WM_operatortype_append(PARTICLE_OT_select_inverse); WM_operatortype_append(PARTICLE_OT_hide); WM_operatortype_append(PARTICLE_OT_reveal); @@ -95,11 +94,12 @@ static void keymap_particle(wmKeyConfig *keyconf) keymap->poll= PE_poll; WM_keymap_add_item(keymap, "PARTICLE_OT_select_all", AKEY, KM_PRESS, 0, 0); + RNA_enum_set(WM_keymap_add_item(keymap, "PARTICLE_OT_select_all", IKEY, KM_PRESS, KM_CTRL, 0)->ptr, "action", SEL_INVERT); + WM_keymap_add_item(keymap, "PARTICLE_OT_select_more", PADPLUSKEY, KM_PRESS, KM_CTRL, 0); WM_keymap_add_item(keymap, "PARTICLE_OT_select_less", PADMINUS, KM_PRESS, KM_CTRL, 0); WM_keymap_add_item(keymap, "PARTICLE_OT_select_linked", LKEY, KM_PRESS, 0, 0); RNA_boolean_set(WM_keymap_add_item(keymap, "PARTICLE_OT_select_linked", LKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "deselect", 1); - WM_keymap_add_item(keymap, "PARTICLE_OT_select_inverse", IKEY, KM_PRESS, KM_CTRL, 0); WM_keymap_add_item(keymap, "PARTICLE_OT_delete", XKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "PARTICLE_OT_delete", DELKEY, KM_PRESS, 0, 0); @@ -116,11 +116,11 @@ static void keymap_particle(wmKeyConfig *keyconf) /* size radial control */ kmi = WM_keymap_add_item(keymap, "WM_OT_radial_control", FKEY, KM_PRESS, 0, 0); - RNA_string_set(kmi->ptr, "data_path", "tool_settings.particle_edit.brush.size"); + RNA_string_set(kmi->ptr, "data_path_primary", "tool_settings.particle_edit.brush.size"); /* size radial control */ kmi = WM_keymap_add_item(keymap, "WM_OT_radial_control", FKEY, KM_PRESS, KM_SHIFT, 0); - RNA_string_set(kmi->ptr, "data_path", "tool_settings.particle_edit.brush.strength"); + RNA_string_set(kmi->ptr, "data_path_primary", "tool_settings.particle_edit.brush.strength"); WM_keymap_add_menu(keymap, "VIEW3D_MT_particle_specials", WKEY, KM_PRESS, 0, 0); diff --git a/source/blender/editors/render/render_internal.c b/source/blender/editors/render/render_internal.c index e4597d6afc3..e35df217761 100644 --- a/source/blender/editors/render/render_internal.c +++ b/source/blender/editors/render/render_internal.c @@ -160,7 +160,7 @@ void image_buffer_rect_update(Scene *scene, RenderResult *rr, ImBuf *ibuf, volat static void screen_render_scene_layer_set(wmOperator *op, Main *mainp, Scene **scene, SceneRenderLayer **srl) { /* single layer re-render */ - if(RNA_property_is_set(op->ptr, "scene")) { + if(RNA_struct_property_is_set(op->ptr, "scene")) { Scene *scn; char scene_name[MAX_ID_NAME-2]; @@ -176,7 +176,7 @@ static void screen_render_scene_layer_set(wmOperator *op, Main *mainp, Scene **s } } - if(RNA_property_is_set(op->ptr, "layer")) { + if(RNA_struct_property_is_set(op->ptr, "layer")) { SceneRenderLayer *rl; char rl_name[RE_MAXNAME]; @@ -537,7 +537,7 @@ static int screen_render_invoke(bContext *C, wmOperator *op, wmEvent *event) /* custom scene and single layer re-render */ screen_render_scene_layer_set(op, mainp, &scene, &srl); - if(RNA_property_is_set(op->ptr, "layer")) + if(RNA_struct_property_is_set(op->ptr, "layer")) jobflag |= WM_JOB_SUSPEND; /* job custom data */ diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c index be4d54ae2e8..06e15f4a5f6 100644 --- a/source/blender/editors/render/render_opengl.c +++ b/source/blender/editors/render/render_opengl.c @@ -40,11 +40,13 @@ #include "BLI_editVert.h" #include "BLI_dlrbTree.h" #include "BLI_utildefines.h" +#include "BLI_jitter.h" #include "DNA_scene_types.h" #include "DNA_object_types.h" #include "BKE_context.h" +#include "BKE_global.h" #include "BKE_image.h" #include "BKE_main.h" #include "BKE_report.h" @@ -81,6 +83,11 @@ typedef struct OGLRender { RegionView3D *rv3d; ARegion *ar; + ScrArea *prevsa; + ARegion *prevar; + + short obcenter_dia_back; /* temp overwrite */ + Image *ima; ImageUser iuser; @@ -148,28 +155,31 @@ static void screen_opengl_render_apply(OGLRender *oglrender) } else { /* simple accumulation, less hassle then FSAA FBO's */ -# define SAMPLES 5 /* fixed, easy to have more but for now this is ok */ - const float jit_ofs[SAMPLES][2] = {{0, 0}, {0.5f, 0.5f}, {-0.5f,-0.5f}, {-0.5f, 0.5f}, {0.5f, -0.5f}}; + static float jit_ofs[32][2]; float winmat_jitter[4][4]; float *accum_buffer= MEM_mallocN(sizex * sizey * sizeof(float) * 4, "accum1"); float *accum_tmp= MEM_mallocN(sizex * sizey * sizeof(float) * 4, "accum2"); int j; + BLI_initjit(jit_ofs[0], scene->r.osa); + /* first sample buffer, also initializes 'rv3d->persmat' */ ED_view3d_draw_offscreen(scene, v3d, ar, sizex, sizey, NULL, winmat); GPU_offscreen_read_pixels(oglrender->ofs, GL_FLOAT, accum_buffer); /* skip the first sample */ - for(j=1; j < SAMPLES; j++) { + for(j=1; j < scene->r.osa; j++) { copy_m4_m4(winmat_jitter, winmat); - window_translate_m4(winmat_jitter, rv3d->persmat, jit_ofs[j][0] / sizex, jit_ofs[j][1] / sizey); + window_translate_m4(winmat_jitter, rv3d->persmat, + (jit_ofs[j][0] * 2.0f) / sizex, + (jit_ofs[j][1] * 2.0f) / sizey); ED_view3d_draw_offscreen(scene, v3d, ar, sizex, sizey, NULL, winmat_jitter); GPU_offscreen_read_pixels(oglrender->ofs, GL_FLOAT, accum_tmp); add_vn_vn(accum_buffer, accum_tmp, sizex*sizey*sizeof(float)); } - mul_vn_vn_fl(rr->rectf, accum_buffer, sizex*sizey*sizeof(float), 1.0/SAMPLES); + mul_vn_vn_fl(rr->rectf, accum_buffer, sizex*sizey*sizeof(float), 1.0f / scene->r.osa); MEM_freeN(accum_buffer); MEM_freeN(accum_tmp); @@ -243,6 +253,8 @@ static int screen_opengl_render_init(bContext *C, wmOperator *op) { /* new render clears all callbacks */ Scene *scene= CTX_data_scene(C); + ScrArea *prevsa= CTX_wm_area(C); + ARegion *prevar= CTX_wm_region(C); RenderResult *rr; GPUOffScreen *ofs; OGLRender *oglrender; @@ -252,6 +264,11 @@ static int screen_opengl_render_init(bContext *C, wmOperator *op) const short is_write_still= RNA_boolean_get(op->ptr, "write_still"); char err_out[256]= "unknown"; + if(G.background) { + BKE_report(op->reports, RPT_ERROR, "Can't use OpenGL render in background mode (no opengl context)"); + return 0; + } + /* ensure we have a 3d view */ if(!ED_view3d_context_activate(C)) { @@ -303,13 +320,24 @@ static int screen_opengl_render_init(bContext *C, wmOperator *op) oglrender->write_still= is_write_still && !is_animation; + oglrender->obcenter_dia_back = U.obcenter_dia; + U.obcenter_dia = 0; + + oglrender->prevsa= prevsa; + oglrender->prevar= prevar; + if(is_view_context) { - oglrender->v3d= CTX_wm_view3d(C); - oglrender->ar= CTX_wm_region(C); - oglrender->rv3d= CTX_wm_region_view3d(C); + ED_view3d_context_user_region(C, &oglrender->v3d, &oglrender->ar); /* so quad view renders camera */ + oglrender->rv3d= oglrender->ar->regiondata; /* MUST be cleared on exit */ - oglrender->scene->customdata_mask_modal= ED_view3d_datamask(oglrender->scene, oglrender->v3d); + oglrender->scene->customdata_mask_modal = (ED_view3d_datamask(oglrender->scene, oglrender->v3d) | + ED_view3d_object_datamask(oglrender->scene) ); + + /* apply immediately incase we're rendeing from a script, + * running notifiers again will overwrite */ + oglrender->scene->customdata_mask |= oglrender->scene->customdata_mask_modal; + } /* create render */ @@ -354,10 +382,15 @@ static void screen_opengl_render_end(bContext *C, OGLRender *oglrender) WM_cursor_wait(0); WM_event_add_notifier(C, NC_SCENE|ND_RENDER_RESULT, oglrender->scene); + U.obcenter_dia = oglrender->obcenter_dia_back; + GPU_offscreen_free(oglrender->ofs); oglrender->scene->customdata_mask_modal= 0; + CTX_wm_area_set(C, oglrender->prevsa); + CTX_wm_region_set(C, oglrender->prevar); + MEM_freeN(oglrender); } @@ -465,7 +498,8 @@ static int screen_opengl_render_anim_step(bContext *C, wmOperator *op) } if(BKE_imtype_is_movie(scene->r.im_format.imtype)) { - ok= oglrender->mh->append_movie(&scene->r, CFRA, (int*)ibuf->rect, oglrender->sizex, oglrender->sizey, oglrender->reports); + ok= oglrender->mh->append_movie(&scene->r, SFRA, CFRA, (int*)ibuf->rect, + oglrender->sizex, oglrender->sizey, oglrender->reports); if(ok) { printf("Append frame %d", scene->r.cfra); BKE_reportf(op->reports, RPT_INFO, "Appended frame: %d", scene->r.cfra); diff --git a/source/blender/editors/render/render_preview.c b/source/blender/editors/render/render_preview.c index 86328ca2a64..3e34a55a3d9 100644 --- a/source/blender/editors/render/render_preview.c +++ b/source/blender/editors/render/render_preview.c @@ -104,7 +104,7 @@ ImBuf* get_brush_icon(Brush *brush) { static const int flags = IB_rect|IB_multilayer|IB_metadata; - char path[240]; + char path[FILE_MAX]; char *folder; if (!(brush->icon_imbuf)) { diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c index 937f43dfadb..ad3e20ddb2d 100644 --- a/source/blender/editors/render/render_shading.c +++ b/source/blender/editors/render/render_shading.c @@ -1269,7 +1269,7 @@ static int envmap_save_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event { //Scene *scene= CTX_data_scene(C); - if(RNA_property_is_set(op->ptr, "filepath")) + if(RNA_struct_property_is_set(op->ptr, "filepath")) return envmap_save_exec(C, op); //RNA_enum_set(op->ptr, "file_type", scene->r.im_format.imtype); diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index 7aacd9f7b86..e4088fe10c4 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -478,7 +478,7 @@ void ED_region_do_draw(bContext *C, ARegion *ar) glClear(GL_COLOR_BUFFER_BIT); UI_ThemeColor(TH_TEXT); - BLF_draw_default(20, 8, 0.0f, ar->headerstr, 65535); /* XXX, use real length */ + BLF_draw_default(20, 8, 0.0f, ar->headerstr, BLF_DRAW_STR_DUMMY_MAX); } else if(at->draw) { at->draw(C, ar); @@ -1809,5 +1809,5 @@ void ED_region_info_draw(ARegion *ar, const char *text, int block, float alpha) /* text */ UI_ThemeColor(TH_TEXT_HI); BLF_position(fontid, 12, rect.ymin + 5, 0.0f); - BLF_draw(fontid, text, strlen(text)); + BLF_draw(fontid, text, BLF_DRAW_STR_DUMMY_MAX); } diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c index 3a0202ad546..25b8b8415d9 100644 --- a/source/blender/editors/screen/screen_edit.c +++ b/source/blender/editors/screen/screen_edit.c @@ -1689,8 +1689,6 @@ ScrArea *ED_screen_full_toggle(bContext *C, wmWindow *win, ScrArea *sa) /* XXX bad code: setscreen() ends with first area active. fullscreen render assumes this too */ CTX_wm_area_set(C, sc->areabase.first); - /* XXX retopo_force_update(); */ - return sc->areabase.first; } diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 98f85009140..2632c239625 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -1348,12 +1348,12 @@ static int area_split_invoke(bContext *C, wmOperator *op, wmEvent *event) int x, y; /* retrieve initial mouse coord, so we can find the active edge */ - if(RNA_property_is_set(op->ptr, "mouse_x")) + if(RNA_struct_property_is_set(op->ptr, "mouse_x")) x= RNA_int_get(op->ptr, "mouse_x"); else x= event->x; - if(RNA_property_is_set(op->ptr, "mouse_y")) + if(RNA_struct_property_is_set(op->ptr, "mouse_y")) y= RNA_int_get(op->ptr, "mouse_y"); else y= event->x; @@ -3062,7 +3062,7 @@ static int screen_animation_play_exec(bContext *C, wmOperator *op) int mode= (RNA_boolean_get(op->ptr, "reverse")) ? -1 : 1; int sync= -1; - if (RNA_property_is_set(op->ptr, "sync")) + if (RNA_struct_property_is_set(op->ptr, "sync")) sync= (RNA_boolean_get(op->ptr, "sync")); return ED_screen_animation_play(C, sync, mode); diff --git a/source/blender/editors/screen/screendump.c b/source/blender/editors/screen/screendump.c index fe2dc1fb913..e32277e3789 100644 --- a/source/blender/editors/screen/screendump.c +++ b/source/blender/editors/screen/screendump.c @@ -198,7 +198,7 @@ static int screenshot_exec(bContext *C, wmOperator *op) static int screenshot_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { if(screenshot_data_create(C, op)) { - if(RNA_property_is_set(op->ptr, "filepath")) + if(RNA_struct_property_is_set(op->ptr, "filepath")) return screenshot_exec(C, op); RNA_string_set(op->ptr, "filepath", G.ima); @@ -302,7 +302,9 @@ static void screenshot_startjob(void *sjv, short *stop, short *do_update, float if(sj->dumprect) { if(mh) { - if(mh->append_movie(&rd, rd.cfra, (int *)sj->dumprect, sj->dumpsx, sj->dumpsy, &sj->reports)) { + if(mh->append_movie(&rd, rd.sfra, rd.cfra, (int *)sj->dumprect, + sj->dumpsx, sj->dumpsy, &sj->reports)) + { BKE_reportf(&sj->reports, RPT_INFO, "Appended frame: %d", rd.cfra); printf("Appended frame %d\n", rd.cfra); } else diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index 8a4cb8aa78b..8eeca2e4e15 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -1784,16 +1784,7 @@ static void scale_tri(float insetCos[4][3], float *origCos[4], const float inset } #endif //PROJ_DEBUG_NOSEAMBLEED -static float Vec2Lenf_nosqrt(const float *v1, const float *v2) -{ - float x, y; - - x = v1[0]-v2[0]; - y = v1[1]-v2[1]; - return x*x+y*y; -} - -static float Vec2Lenf_nosqrt_other(const float *v1, const float v2_1, const float v2_2) +static float len_squared_v2v2_alt(const float *v1, const float v2_1, const float v2_2) { float x, y; @@ -1802,7 +1793,7 @@ static float Vec2Lenf_nosqrt_other(const float *v1, const float v2_1, const floa return x*x+y*y; } -/* note, use a squared value so we can use Vec2Lenf_nosqrt +/* note, use a squared value so we can use len_squared_v2v2 * be sure that you have done a bounds check first or this may fail */ /* only give bucket_bounds as an arg because we need it elsewhere */ static int project_bucket_isect_circle(const float cent[2], const float radius_squared, rctf *bucket_bounds) @@ -1826,21 +1817,21 @@ static int project_bucket_isect_circle(const float cent[2], const float radius_s if (cent[0] < bucket_bounds->xmin) { /* lower left out of radius test */ if (cent[1] < bucket_bounds->ymin) { - return (Vec2Lenf_nosqrt_other(cent, bucket_bounds->xmin, bucket_bounds->ymin) < radius_squared) ? 1 : 0; + return (len_squared_v2v2_alt(cent, bucket_bounds->xmin, bucket_bounds->ymin) < radius_squared) ? 1 : 0; } /* top left test */ else if (cent[1] > bucket_bounds->ymax) { - return (Vec2Lenf_nosqrt_other(cent, bucket_bounds->xmin, bucket_bounds->ymax) < radius_squared) ? 1 : 0; + return (len_squared_v2v2_alt(cent, bucket_bounds->xmin, bucket_bounds->ymax) < radius_squared) ? 1 : 0; } } else if (cent[0] > bucket_bounds->xmax) { /* lower right out of radius test */ if (cent[1] < bucket_bounds->ymin) { - return (Vec2Lenf_nosqrt_other(cent, bucket_bounds->xmax, bucket_bounds->ymin) < radius_squared) ? 1 : 0; + return (len_squared_v2v2_alt(cent, bucket_bounds->xmax, bucket_bounds->ymin) < radius_squared) ? 1 : 0; } /* top right test */ else if (cent[1] > bucket_bounds->ymax) { - return (Vec2Lenf_nosqrt_other(cent, bucket_bounds->xmax, bucket_bounds->ymax) < radius_squared) ? 1 : 0; + return (len_squared_v2v2_alt(cent, bucket_bounds->xmax, bucket_bounds->ymax) < radius_squared) ? 1 : 0; } } @@ -2946,7 +2937,7 @@ static void project_paint_begin(ProjPaintState *ps) MemArena *arena; /* at the moment this is just ps->arena_mt[0], but use this to show were not multithreading */ - const int diameter= 2*brush_size(ps->brush); + const int diameter= 2*brush_size(ps->scene, ps->brush); /* ---- end defines ---- */ @@ -3589,7 +3580,7 @@ static int project_bucket_iter_init(ProjPaintState *ps, const float mval_f[2]) { if(ps->source==PROJ_SRC_VIEW) { float min_brush[2], max_brush[2]; - const float radius = (float)brush_size(ps->brush); + const float radius = (float)brush_size(ps->scene, ps->brush); /* so we dont have a bucket bounds that is way too small to paint into */ // if (radius < 1.0f) radius = 1.0f; // this doesn't work yet :/ @@ -3627,7 +3618,7 @@ static int project_bucket_iter_init(ProjPaintState *ps, const float mval_f[2]) static int project_bucket_iter_next(ProjPaintState *ps, int *bucket_index, rctf *bucket_bounds, const float mval[2]) { - const int diameter= 2*brush_size(ps->brush); + const int diameter= 2*brush_size(ps->scene, ps->brush); if (ps->thread_tot > 1) BLI_lock_thread(LOCK_CUSTOM1); @@ -3853,7 +3844,7 @@ static void *do_projectpaint_thread(void *ph_v) float co[2]; float mask = 1.0f; /* airbrush wont use mask */ unsigned short mask_short; - const float radius= (float)brush_size(ps->brush); + const float radius= (float)brush_size(ps->scene, ps->brush); const float radius_squared= radius*radius; /* avoid a square root with every dist comparison */ short lock_alpha= ELEM(ps->brush->blend, IMB_BLEND_ERASE_ALPHA, IMB_BLEND_ADD_ALPHA) ? 0 : ps->brush->flag & BRUSH_LOCK_ALPHA; @@ -3901,8 +3892,7 @@ static void *do_projectpaint_thread(void *ph_v) projPixel = (ProjPixel *)node->link; - /*dist = len_v2v2(projPixel->projCoSS, pos);*/ /* correct but uses a sqrtf */ - dist_nosqrt = Vec2Lenf_nosqrt(projPixel->projCoSS, pos); + dist_nosqrt = len_squared_v2v2(projPixel->projCoSS, pos); /*if (dist < radius) {*/ /* correct but uses a sqrtf */ if (dist_nosqrt <= radius_squared) { @@ -3913,7 +3903,7 @@ static void *do_projectpaint_thread(void *ph_v) if (falloff > 0.0f) { if (ps->is_texbrush) { /* note, for clone and smear, we only use the alpha, could be a special function */ - brush_sample_tex(ps->brush, projPixel->projCoSS, rgba, thread_index); + brush_sample_tex(ps->scene, ps->brush, projPixel->projCoSS, rgba, thread_index); alpha = rgba[3]; } else { alpha = 1.0f; @@ -3921,7 +3911,7 @@ static void *do_projectpaint_thread(void *ph_v) if (ps->is_airbrush) { /* for an aurbrush there is no real mask, so just multiply the alpha by it */ - alpha *= falloff * brush_alpha(ps->brush); + alpha *= falloff * brush_alpha(ps->scene, ps->brush); mask = ((float)projPixel->mask)/65535.0f; } else { @@ -3929,7 +3919,7 @@ static void *do_projectpaint_thread(void *ph_v) falloff = 1.0f - falloff; falloff = 1.0f - (falloff * falloff); - mask_short = (unsigned short)(projPixel->mask * (brush_alpha(ps->brush) * falloff)); + mask_short = (unsigned short)(projPixel->mask * (brush_alpha(ps->scene, ps->brush) * falloff)); if (mask_short > projPixel->mask_max) { mask = ((float)mask_short)/65535.0f; projPixel->mask_max = mask_short; @@ -4811,7 +4801,7 @@ static int texture_paint_init(bContext *C, wmOperator *op) if(pop->mode == PAINT_MODE_3D && (pop->s.tool == PAINT_TOOL_CLONE)) pop->s.tool = PAINT_TOOL_DRAW; pop->s.blend = brush->blend; - pop->orig_brush_size= brush_size(brush); + pop->orig_brush_size= brush_size(scene, brush); if(pop->mode != PAINT_MODE_2D) { pop->s.ob = OBACT; @@ -4847,8 +4837,8 @@ static int texture_paint_init(bContext *C, wmOperator *op) return 0; /* Dont allow brush size below 2 */ - if (brush_size(brush) < 2) - brush_set_size(brush, 2); + if (brush_size(scene, brush) < 2) + brush_set_size(scene, brush, 2); /* allocate and initialize spacial data structures */ project_paint_begin(&pop->ps); @@ -4862,7 +4852,7 @@ static int texture_paint_init(bContext *C, wmOperator *op) image_undo_restore, image_undo_free); /* create painter */ - pop->painter= brush_painter_new(pop->s.brush); + pop->painter= brush_painter_new(scene, pop->s.brush); return 1; } @@ -4932,7 +4922,7 @@ static void paint_exit(bContext *C, wmOperator *op) brush_painter_free(pop->painter); if(pop->mode == PAINT_MODE_3D_PROJECT) { - brush_set_size(pop->ps.brush, pop->orig_brush_size); + brush_set_size(scene, pop->ps.brush, pop->orig_brush_size); paint_brush_exit_tex(pop->ps.brush); project_paint_end(&pop->ps); @@ -4968,6 +4958,7 @@ static int paint_exec(bContext *C, wmOperator *op) static void paint_apply_event(bContext *C, wmOperator *op, wmEvent *event) { + const Scene *scene = CTX_data_scene(C); PaintOperation *pop= op->customdata; wmTabletData *wmtab; PointerRNA itemptr; @@ -4999,13 +4990,13 @@ static void paint_apply_event(bContext *C, wmOperator *op, wmEvent *event) /* special exception here for too high pressure values on first touch in windows for some tablets, then we just skip first touch .. */ - if (tablet && (pressure >= 0.99f) && ((pop->s.brush->flag & BRUSH_SPACING_PRESSURE) || brush_use_alpha_pressure(pop->s.brush) || brush_use_size_pressure(pop->s.brush))) + if (tablet && (pressure >= 0.99f) && ((pop->s.brush->flag & BRUSH_SPACING_PRESSURE) || brush_use_alpha_pressure(scene, pop->s.brush) || brush_use_size_pressure(scene, pop->s.brush))) return; /* This can be removed once fixed properly in brush_painter_paint(BrushPainter *painter, BrushFunc func, float *pos, double time, float pressure, void *user) at zero pressure we should do nothing 1/2^12 is .0002 which is the sensitivity of the most sensitive pen tablet available*/ - if (tablet && (pressure < .0002f) && ((pop->s.brush->flag & BRUSH_SPACING_PRESSURE) || brush_use_alpha_pressure(pop->s.brush) || brush_use_size_pressure(pop->s.brush))) + if (tablet && (pressure < .0002f) && ((pop->s.brush->flag & BRUSH_SPACING_PRESSURE) || brush_use_alpha_pressure(scene, pop->s.brush) || brush_use_size_pressure(scene, pop->s.brush))) return; } @@ -5120,12 +5111,13 @@ static void brush_drawcursor(bContext *C, int x, int y, void *UNUSED(customdata) #define PX_SIZE_FADE_MAX 12.0f #define PX_SIZE_FADE_MIN 4.0f + Scene *scene= CTX_data_scene(C); Brush *brush= image_paint_brush(C); - Paint *paint= paint_get_active(CTX_data_scene(C)); + Paint *paint= paint_get_active(scene); if(paint && brush && paint->flags & PAINT_SHOW_BRUSH) { float zoomx, zoomy; - const float size= (float)brush_size(brush); + const float size= (float)brush_size(scene, brush); const short use_zoom= get_imapaint_zoom(C, &zoomx, &zoomy); const float pixel_size= MAX2(size * zoomx, size * zoomy); float alpha= 0.5f; @@ -5579,8 +5571,8 @@ static int texture_paint_camera_project_exec(bContext *C, wmOperator *op) /* override */ ps.is_texbrush= 0; ps.is_airbrush= 1; - orig_brush_size= brush_size(ps.brush); - brush_set_size(ps.brush, 32); /* cover the whole image */ + orig_brush_size= brush_size(scene, ps.brush); + brush_set_size(scene, ps.brush, 32); /* cover the whole image */ ps.tool= PAINT_TOOL_DRAW; /* so pixels are initialized with minimal info */ @@ -5593,7 +5585,7 @@ static int texture_paint_camera_project_exec(bContext *C, wmOperator *op) project_paint_begin(&ps); if(ps.dm==NULL) { - brush_set_size(ps.brush, orig_brush_size); + brush_set_size(scene, ps.brush, orig_brush_size); return OPERATOR_CANCELLED; } else { @@ -5617,7 +5609,7 @@ static int texture_paint_camera_project_exec(bContext *C, wmOperator *op) project_paint_end(&ps); scene->toolsettings->imapaint.flag &= ~IMAGEPAINT_DRAWING; - brush_set_size(ps.brush, orig_brush_size); + brush_set_size(scene, ps.brush, orig_brush_size); return OPERATOR_FINISHED; } diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c index eb20465a2ab..e81e1f6dc77 100644 --- a/source/blender/editors/sculpt_paint/paint_ops.c +++ b/source/blender/editors/sculpt_paint/paint_ops.c @@ -89,7 +89,8 @@ static void BRUSH_OT_add(wmOperatorType *ot) static int brush_scale_size_exec(bContext *C, wmOperator *op) { - Paint *paint= paint_get_active(CTX_data_scene(C)); + Scene *scene = CTX_data_scene(C); + Paint *paint= paint_get_active(scene); struct Brush *brush= paint_brush(paint); // Object *ob= CTX_data_active_object(C); float scalar= RNA_float_get(op->ptr, "scalar"); @@ -97,7 +98,7 @@ static int brush_scale_size_exec(bContext *C, wmOperator *op) if (brush) { // pixel radius { - const int old_size= brush_size(brush); + const int old_size= brush_size(scene, brush); int size= (int)(scalar*old_size); if (old_size == size) { @@ -110,17 +111,17 @@ static int brush_scale_size_exec(bContext *C, wmOperator *op) } CLAMP(size, 1, 2000); // XXX magic number - brush_set_size(brush, size); + brush_set_size(scene, brush, size); } // unprojected radius { - float unprojected_radius= scalar*brush_unprojected_radius(brush); + float unprojected_radius= scalar*brush_unprojected_radius(scene, brush); if (unprojected_radius < 0.001f) // XXX magic number unprojected_radius= 0.001f; - brush_set_unprojected_radius(brush, unprojected_radius); + brush_set_unprojected_radius(scene, brush, unprojected_radius); } } @@ -475,7 +476,7 @@ typedef enum { } RCFlags; static void set_brush_rc_path(PointerRNA *ptr, const char *brush_path, - const char *output_name, const char *input_name) + const char *output_name, const char *input_name) { char *path; @@ -485,21 +486,35 @@ static void set_brush_rc_path(PointerRNA *ptr, const char *brush_path, } static void set_brush_rc_props(PointerRNA *ptr, const char *paint, - const char *prop, RCFlags flags) + const char *prop, const char *secondary_prop, + RCFlags flags) { + const char *ups_path = "tool_settings.unified_paint_settings"; char *brush_path; brush_path = BLI_sprintfN("tool_settings.%s.brush", paint); - set_brush_rc_path(ptr, brush_path, "data_path", prop); + set_brush_rc_path(ptr, brush_path, "data_path_primary", prop); + if(secondary_prop) { + set_brush_rc_path(ptr, ups_path, "use_secondary", secondary_prop); + set_brush_rc_path(ptr, ups_path, "data_path_secondary", prop); + } + else { + RNA_string_set(ptr, "use_secondary", ""); + RNA_string_set(ptr, "data_path_secondary", ""); + } set_brush_rc_path(ptr, brush_path, "color_path", "cursor_color_add"); set_brush_rc_path(ptr, brush_path, "rotation_path", "texture_slot.angle"); RNA_string_set(ptr, "image_id", brush_path); if(flags & RC_COLOR) set_brush_rc_path(ptr, brush_path, "fill_color_path", "color"); + else + RNA_string_set(ptr, "fill_color_path", ""); if(flags & RC_ZOOM) RNA_string_set(ptr, "zoom_path", "space_data.zoom"); + else + RNA_string_set(ptr, "zoom_path", ""); MEM_freeN(brush_path); } @@ -510,14 +525,14 @@ static void ed_keymap_paint_brush_radial_control(wmKeyMap *keymap, const char *p wmKeyMapItem *kmi; kmi = WM_keymap_add_item(keymap, "WM_OT_radial_control", FKEY, KM_PRESS, 0, 0); - set_brush_rc_props(kmi->ptr, paint, "size", flags); + set_brush_rc_props(kmi->ptr, paint, "size", "use_unified_size", flags); kmi = WM_keymap_add_item(keymap, "WM_OT_radial_control", FKEY, KM_PRESS, KM_SHIFT, 0); - set_brush_rc_props(kmi->ptr, paint, "strength", flags); + set_brush_rc_props(kmi->ptr, paint, "strength", "use_unified_strength", flags); if(flags & RC_ROTATION) { kmi = WM_keymap_add_item(keymap, "WM_OT_radial_control", FKEY, KM_PRESS, KM_CTRL, 0); - set_brush_rc_props(kmi->ptr, paint, "texture_slot.angle", flags); + set_brush_rc_props(kmi->ptr, paint, "texture_slot.angle", NULL, flags); } } diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c index 7cff37e8814..c3e0c35f524 100644 --- a/source/blender/editors/sculpt_paint/paint_stroke.c +++ b/source/blender/editors/sculpt_paint/paint_stroke.c @@ -123,19 +123,19 @@ static int same_snap(Snapshot* snap, Brush* brush, ViewContext* vc) { MTex* mtex = &brush->mtex; - return ( (mtex->tex) && - equals_v3v3(mtex->ofs, snap->ofs) && - equals_v3v3(mtex->size, snap->size) && - mtex->rot == snap->rot - ) && - - /* make brush smaller shouldn't cause a resample */ - ( (mtex->brush_map_mode == MTEX_MAP_MODE_FIXED && (brush_size(brush) <= snap->brush_size)) || - (brush_size(brush) == snap->brush_size)) && - - (mtex->brush_map_mode == snap->brush_map_mode) && - (vc->ar->winx == snap->winx) && - (vc->ar->winy == snap->winy); + return (((mtex->tex) && + equals_v3v3(mtex->ofs, snap->ofs) && + equals_v3v3(mtex->size, snap->size) && + mtex->rot == snap->rot) && + + /* make brush smaller shouldn't cause a resample */ + ((mtex->brush_map_mode == MTEX_MAP_MODE_FIXED && + (brush_size(vc->scene, brush) <= snap->brush_size)) || + (brush_size(vc->scene, brush) == snap->brush_size)) && + + (mtex->brush_map_mode == snap->brush_map_mode) && + (vc->ar->winx == snap->winx) && + (vc->ar->winy == snap->winy)); } static void make_snap(Snapshot* snap, Brush* brush, ViewContext* vc) @@ -153,7 +153,7 @@ static void make_snap(Snapshot* snap, Brush* brush, ViewContext* vc) snap->rot = -1; } - snap->brush_size = brush_size(brush); + snap->brush_size = brush_size(vc->scene, brush); snap->winx = vc->ar->winx; snap->winy = vc->ar->winy; } @@ -198,7 +198,7 @@ static int load_tex(Sculpt *sd, Brush* br, ViewContext* vc) make_snap(&snap, br, vc); if (br->mtex.brush_map_mode == MTEX_MAP_MODE_FIXED) { - int s = brush_size(br); + int s = brush_size(vc->scene, br); int r = 1; for (s >>= 1; s > 0; s >>= 1) @@ -239,7 +239,7 @@ static int load_tex(Sculpt *sd, Brush* br, ViewContext* vc) // largely duplicated from tex_strength const float rotation = -br->mtex.rot; - float radius = brush_size(br); + float radius = brush_size(vc->scene, br); int index = j*size + i; float x; float avg; @@ -373,6 +373,7 @@ static int sculpt_get_brush_geometry(bContext* C, int x, int y, int* pixel_radiu float location[3]) { struct PaintStroke *stroke; + const Scene *scene = CTX_data_scene(C); float window[2]; int hit; @@ -384,11 +385,11 @@ static int sculpt_get_brush_geometry(bContext* C, int x, int y, int* pixel_radiu if(stroke->vc.obact->sculpt && stroke->vc.obact->sculpt->pbvh && sculpt_stroke_get_location(C, stroke, location, window)) { *pixel_radius = project_brush_radius(stroke->vc.rv3d, - brush_unprojected_radius(stroke->brush), + brush_unprojected_radius(scene, stroke->brush), location, &stroke->mats); if (*pixel_radius == 0) - *pixel_radius = brush_size(stroke->brush); + *pixel_radius = brush_size(scene, stroke->brush); mul_m4_v3(stroke->vc.obact->obmat, location); @@ -398,7 +399,7 @@ static int sculpt_get_brush_geometry(bContext* C, int x, int y, int* pixel_radiu Sculpt* sd = CTX_data_tool_settings(C)->sculpt; Brush* brush = paint_brush(&sd->paint); - *pixel_radius = brush_size(brush); + *pixel_radius = brush_size(scene, brush); hit = 0; } @@ -453,7 +454,7 @@ static void paint_draw_alpha_overlay(Sculpt *sd, Brush *brush, glTranslatef(-0.5f, -0.5f, 0); /* scale based on tablet pressure */ - if(sd->draw_pressure && brush_use_size_pressure(brush)) { + if(sd->draw_pressure && brush_use_size_pressure(vc->scene, brush)) { glTranslatef(0.5f, 0.5f, 0); glScalef(1.0f/sd->pressure_value, 1.0f/sd->pressure_value, 1); glTranslatef(-0.5f, -0.5f, 0); @@ -468,7 +469,7 @@ static void paint_draw_alpha_overlay(Sculpt *sd, Brush *brush, quad.ymax = aim[1]+sd->anchored_size - win->ymin; } else { - const int radius= brush_size(brush); + const int radius= brush_size(vc->scene, brush); quad.xmin = x - radius; quad.ymin = y - radius; quad.xmax = x + radius; @@ -515,7 +516,7 @@ static void paint_cursor_on_hit(Sculpt *sd, Brush *brush, ViewContext *vc, /* TODO: check whether this should really only be done when brush is over mesh? */ - if(sd->draw_pressure && brush_use_alpha_pressure(brush)) + if(sd->draw_pressure && brush_use_alpha_pressure(vc->scene, brush)) (*visual_strength) *= sd->pressure_value; if(sd->draw_anchored) @@ -524,21 +525,22 @@ static void paint_cursor_on_hit(Sculpt *sd, Brush *brush, ViewContext *vc, if(brush->flag & BRUSH_ANCHORED) projected_radius = 8; else - projected_radius = brush_size(brush); + projected_radius = brush_size(vc->scene, brush); } unprojected_radius = paint_calc_object_space_radius(vc, location, projected_radius); - if(sd->draw_pressure && brush_use_size_pressure(brush)) + if(sd->draw_pressure && brush_use_size_pressure(vc->scene, brush)) unprojected_radius *= sd->pressure_value; - if(!brush_use_locked_size(brush)) - brush_set_unprojected_radius(brush, unprojected_radius); + if(!brush_use_locked_size(vc->scene, brush)) + brush_set_unprojected_radius(vc->scene, brush, unprojected_radius); } static void paint_draw_cursor(bContext *C, int x, int y, void *UNUSED(unused)) { - Paint *paint = paint_get_active(CTX_data_scene(C)); + Scene *scene = CTX_data_scene(C); + Paint *paint = paint_get_active(scene); Brush *brush = paint_brush(paint); ViewContext vc; float final_radius; @@ -550,7 +552,7 @@ static void paint_draw_cursor(bContext *C, int x, int y, void *UNUSED(unused)) translation[1] = y; outline_alpha = 0.5; outline_col = brush->add_col; - final_radius = brush_size(brush); + final_radius = brush_size(scene, brush); /* check that brush drawing is enabled */ if(!(paint->flags & PAINT_SHOW_BRUSH)) @@ -566,7 +568,7 @@ static void paint_draw_cursor(bContext *C, int x, int y, void *UNUSED(unused)) Sculpt *sd = CTX_data_tool_settings(C)->sculpt; float location[3]; int pixel_radius, hit; - const float root_alpha = brush_alpha(brush); + const float root_alpha = brush_alpha(scene, brush); float visual_strength = root_alpha*root_alpha; const float min_alpha = 0.20f; const float max_alpha = 0.80f; @@ -597,8 +599,8 @@ static void paint_draw_cursor(bContext *C, int x, int y, void *UNUSED(unused)) /* draw overlay */ paint_draw_alpha_overlay(sd, brush, &vc, x, y); - if(brush_use_locked_size(brush)) - brush_set_size(brush, pixel_radius); + if(brush_use_locked_size(scene, brush)) + brush_set_size(scene, brush, pixel_radius); /* check if brush is subtracting, use different color then */ /* TODO: no way currently to know state of pen flip or @@ -668,7 +670,8 @@ static float event_tablet_data(wmEvent *event, int *pen_flip) /* 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_in[2]) { - Paint *paint = paint_get_active(CTX_data_scene(C)); + Scene *scene = CTX_data_scene(C); + Paint *paint = paint_get_active(scene); Brush *brush = paint_brush(paint); PaintStroke *stroke = op->customdata; float mouse[3]; @@ -685,7 +688,7 @@ static void paint_brush_stroke_add_step(bContext *C, wmOperator *op, wmEvent *ev if(stroke->vc.obact->sculpt) { float delta[2]; - brush_jitter_pos(brush, mouse_in, mouse); + brush_jitter_pos(scene, brush, mouse_in, mouse); /* XXX: meh, this is round about because brush_jitter_pos isn't written in the best way to @@ -764,16 +767,17 @@ static int paint_space_stroke(bContext *C, wmOperator *op, wmEvent *event, const length = len_v2(vec); if(length > FLT_EPSILON) { + const Scene *scene = CTX_data_scene(C); int steps; int i; float pressure= 1.0f; /* XXX mysterious :) what has 'use size' do with this here... if you don't check for it, pressure fails */ - if(brush_use_size_pressure(stroke->brush)) + if(brush_use_size_pressure(scene, stroke->brush)) pressure = event_tablet_data(event, NULL); if(pressure > FLT_EPSILON) { - scale = (brush_size(stroke->brush)*pressure*stroke->brush->spacing/50.0f) / length; + scale = (brush_size(scene, stroke->brush)*pressure*stroke->brush->spacing/50.0f) / length; if(scale > FLT_EPSILON) { mul_v2_fl(vec, scale); diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index 76185d7c5cf..c9a60236d07 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -85,15 +85,6 @@ #include "paint_intern.h" -/* brush->vertexpaint_tool */ -#define VP_MIX 0 -#define VP_ADD 1 -#define VP_SUB 2 -#define VP_MUL 3 -#define VP_BLUR 4 -#define VP_LIGHTEN 5 -#define VP_DARKEN 6 - /* polling - retrieve whether cursor should be set or operator should be done */ @@ -390,7 +381,7 @@ void wpaint_fill(VPaint *wp, Object *ob, float paintweight) { Mesh *me= ob->data; MFace *mf; - MDeformWeight *dw, *uw; + MDeformWeight *dw, *dw_prev; int vgroup_active, vgroup_mirror= -1; unsigned int index; @@ -425,8 +416,8 @@ void wpaint_fill(VPaint *wp, Object *ob, float paintweight) dw= defvert_verify_index(&me->dvert[vidx], vgroup_active); if(dw) { - uw= defvert_verify_index(wp->wpaint_prev+vidx, vgroup_active); - uw->weight= dw->weight; /* set the undo weight */ + dw_prev= defvert_verify_index(wp->wpaint_prev+vidx, vgroup_active); + dw_prev->weight= dw->weight; /* set the undo weight */ dw->weight= paintweight; if(me->editflag & ME_EDIT_MIRROR_X) { /* x mirror painting */ @@ -435,12 +426,12 @@ void wpaint_fill(VPaint *wp, Object *ob, float paintweight) /* copy, not paint again */ if(vgroup_mirror != -1) { dw= defvert_verify_index(me->dvert+j, vgroup_mirror); - uw= defvert_verify_index(wp->wpaint_prev+j, vgroup_mirror); + dw_prev= defvert_verify_index(wp->wpaint_prev+j, vgroup_mirror); } else { dw= defvert_verify_index(me->dvert+j, vgroup_active); - uw= defvert_verify_index(wp->wpaint_prev+j, vgroup_active); + dw_prev= defvert_verify_index(wp->wpaint_prev+j, vgroup_active); } - uw->weight= dw->weight; /* set the undo weight */ + dw_prev->weight= dw->weight; /* set the undo weight */ dw->weight= paintweight; } } @@ -654,34 +645,51 @@ static unsigned int mcol_darken(unsigned int col1, unsigned int col2, int fac) return col; } -static void vpaint_blend(VPaint *vp, unsigned int *col, unsigned int *colorig, unsigned int paintcol, int alpha) +/* wpaint has 'wpaint_blend_tool' */ +static unsigned int vpaint_blend_tool(const int tool, const unsigned int col, + const unsigned int paintcol, const int alpha_i) +{ + switch (tool) { + case PAINT_BLEND_MIX: + case PAINT_BLEND_BLUR: + return mcol_blend(col, paintcol, alpha_i); + case PAINT_BLEND_ADD: + return mcol_add(col, paintcol, alpha_i); + case PAINT_BLEND_SUB: + return mcol_sub(col, paintcol, alpha_i); + case PAINT_BLEND_MUL: + return mcol_mul(col, paintcol, alpha_i); + case PAINT_BLEND_LIGHTEN: + return mcol_lighten(col, paintcol, alpha_i); + case PAINT_BLEND_DARKEN: + return mcol_darken(col, paintcol, alpha_i); + default: + BLI_assert(0); + return 0; + } +} + +/* wpaint has 'wpaint_blend' */ +static unsigned int vpaint_blend(VPaint *vp, unsigned int col, unsigned int colorig, const + unsigned int paintcol, const int alpha_i, + /* pre scaled from [0-1] --> [0-255] */ + const int brush_alpha_value_i) { Brush *brush = paint_brush(&vp->paint); + const int tool = brush->vertexpaint_tool; + + col = vpaint_blend_tool(tool, col, paintcol, alpha_i); - if(brush->vertexpaint_tool==VP_MIX || brush->vertexpaint_tool==VP_BLUR) *col= mcol_blend( *col, paintcol, alpha); - else if(brush->vertexpaint_tool==VP_ADD) *col= mcol_add( *col, paintcol, alpha); - else if(brush->vertexpaint_tool==VP_SUB) *col= mcol_sub( *col, paintcol, alpha); - else if(brush->vertexpaint_tool==VP_MUL) *col= mcol_mul( *col, paintcol, alpha); - else if(brush->vertexpaint_tool==VP_LIGHTEN) *col= mcol_lighten( *col, paintcol, alpha); - else if(brush->vertexpaint_tool==VP_DARKEN) *col= mcol_darken( *col, paintcol, alpha); - /* if no spray, clip color adding with colorig & orig alpha */ if((vp->flag & VP_SPRAY)==0) { - unsigned int testcol=0, a; + unsigned int testcol, a; char *cp, *ct, *co; - alpha= (int)(255.0f*brush_alpha(brush)); - - if(brush->vertexpaint_tool==VP_MIX || brush->vertexpaint_tool==VP_BLUR) testcol= mcol_blend( *colorig, paintcol, alpha); - else if(brush->vertexpaint_tool==VP_ADD) testcol= mcol_add( *colorig, paintcol, alpha); - else if(brush->vertexpaint_tool==VP_SUB) testcol= mcol_sub( *colorig, paintcol, alpha); - else if(brush->vertexpaint_tool==VP_MUL) testcol= mcol_mul( *colorig, paintcol, alpha); - else if(brush->vertexpaint_tool==VP_LIGHTEN) testcol= mcol_lighten( *colorig, paintcol, alpha); - else if(brush->vertexpaint_tool==VP_DARKEN) testcol= mcol_darken( *colorig, paintcol, alpha); + testcol = vpaint_blend_tool(tool, colorig, paintcol, brush_alpha_value_i); - cp= (char *)col; + cp= (char *)&col; ct= (char *)&testcol; - co= (char *)colorig; + co= (char *)&colorig; for(a=0; a<4; a++) { if( ct[a]<co[a] ) { @@ -694,6 +702,8 @@ static void vpaint_blend(VPaint *vp, unsigned int *col, unsigned int *colorig, u } } } + + return col; } @@ -736,7 +746,7 @@ static int sample_backbuf_area(ViewContext *vc, int *indexar, int totface, int x /* whats _dl mean? */ static float calc_vp_strength_dl(VPaint *vp, ViewContext *vc, const float *vert_nor, - const float mval[2], const float brush_size_final) + const float mval[2], const float brush_size_pressure) { Brush *brush = paint_brush(&vp->paint); float dist_squared; @@ -745,24 +755,24 @@ static float calc_vp_strength_dl(VPaint *vp, ViewContext *vc, const float *vert_ project_float_noclip(vc->ar, vert_nor, vertco); sub_v2_v2v2(delta, mval, vertco); dist_squared= dot_v2v2(delta, delta); /* len squared */ - if (dist_squared > brush_size_final * brush_size_final) { + if (dist_squared > brush_size_pressure * brush_size_pressure) { return 0.0f; } else { const float dist = sqrtf(dist_squared); - return brush_curve_strength_clamp(brush, dist, brush_size_final); + return brush_curve_strength_clamp(brush, dist, brush_size_pressure); } } static float calc_vp_alpha_dl(VPaint *vp, ViewContext *vc, float vpimat[][3], const float *vert_nor, const float mval[2], - const float brush_size_final, const float brush_alpha_final) + const float brush_size_pressure, const float brush_alpha_pressure) { - float strength = calc_vp_strength_dl(vp, vc, vert_nor, mval, brush_size_final); + float strength = calc_vp_strength_dl(vp, vc, vert_nor, mval, brush_size_pressure); if (strength > 0.0f) { - float alpha= brush_alpha_final * strength; + float alpha= brush_alpha_pressure * strength; if(vp->flag & VP_NORMALS) { float dvec[3]; @@ -787,86 +797,83 @@ static float calc_vp_alpha_dl(VPaint *vp, ViewContext *vc, return 0.0f; } -static void wpaint_blend(VPaint *wp, MDeformWeight *dw, MDeformWeight *uw, float alpha, float paintval, int flip, int multipaint) +/* vpaint has 'vpaint_blend_tool' */ +/* result is not clamped from [0-1] */ +static float wpaint_blend_tool(const int tool, + /* dw->weight */ + const float weight, + const float paintval, const float alpha) +{ + switch (tool) { + case PAINT_BLEND_MIX: + case PAINT_BLEND_BLUR: + return (paintval * alpha) + (weight * (1.0f - alpha)); + case PAINT_BLEND_ADD: + return (paintval * alpha) + weight; + case PAINT_BLEND_SUB: + return (paintval * alpha) - weight; + case PAINT_BLEND_MUL: + /* first mul, then blend the fac */ + return ((1.0f - alpha) + alpha * paintval) * weight; + case PAINT_BLEND_LIGHTEN: + return (weight < paintval) ? (paintval * alpha) + (weight * (1.0f - alpha)) : weight; + case PAINT_BLEND_DARKEN: + return (weight > paintval) ? (paintval * alpha) + (weight * (1.0f - alpha)) : weight; + default: + BLI_assert(0); + return 0.0f; + } +} + +/* vpaint has 'vpaint_blend' */ +static float wpaint_blend(VPaint *wp, float weight, float weight_prev, + const float alpha, float paintval, + const float brush_alpha_value, + const short do_flip, const short do_multipaint_totsel) { Brush *brush = paint_brush(&wp->paint); int tool = brush->vertexpaint_tool; - if (flip) { + if (do_flip) { switch(tool) { - case VP_MIX: + case PAINT_BLEND_MIX: paintval = 1.f - paintval; break; - case VP_ADD: - tool= VP_SUB; break; - case VP_SUB: - tool= VP_ADD; break; - case VP_LIGHTEN: - tool= VP_DARKEN; break; - case VP_DARKEN: - tool= VP_LIGHTEN; break; + case PAINT_BLEND_ADD: + tool= PAINT_BLEND_SUB; break; + case PAINT_BLEND_SUB: + tool= PAINT_BLEND_ADD; break; + case PAINT_BLEND_LIGHTEN: + tool= PAINT_BLEND_DARKEN; break; + case PAINT_BLEND_DARKEN: + tool= PAINT_BLEND_LIGHTEN; break; } } - if(tool==VP_MIX || tool==VP_BLUR) - dw->weight = paintval*alpha + dw->weight*(1.0f-alpha); - else if(tool==VP_ADD) - dw->weight += paintval*alpha; - else if(tool==VP_SUB) - dw->weight -= paintval*alpha; - else if(tool==VP_MUL) - /* first mul, then blend the fac */ - dw->weight = ((1.0f-alpha) + alpha*paintval)*dw->weight; - else if(tool==VP_LIGHTEN) { - if (dw->weight < paintval) - dw->weight = paintval*alpha + dw->weight*(1.0f-alpha); - } else if(tool==VP_DARKEN) { - if (dw->weight > paintval) - dw->weight = paintval*alpha + dw->weight*(1.0f-alpha); - } - /* delay clamping until the end so multi-paint can function when the active group is at the limits */ - if(multipaint == FALSE) { - CLAMP(dw->weight, 0.0f, 1.0f); + weight = wpaint_blend_tool(tool, weight, paintval, alpha); + + /* delay clamping until the end so multi-paint can function when the active group is at the limits */ + if(do_multipaint_totsel == FALSE) { + CLAMP(weight, 0.0f, 1.0f); } /* if no spray, clip result with orig weight & orig alpha */ - if((wp->flag & VP_SPRAY)==0) { - float testw=0.0f; - - alpha= brush_alpha(brush); - if(tool==VP_MIX || tool==VP_BLUR) - testw = paintval*alpha + uw->weight*(1.0f-alpha); - else if(tool==VP_ADD) - testw = uw->weight + paintval*alpha; - else if(tool==VP_SUB) - testw = uw->weight - paintval*alpha; - else if(tool==VP_MUL) - /* first mul, then blend the fac */ - testw = ((1.0f-alpha) + alpha*paintval)*uw->weight; - else if(tool==VP_LIGHTEN) { - if (uw->weight < paintval) - testw = paintval*alpha + uw->weight*(1.0f-alpha); - else - testw = uw->weight; - } else if(tool==VP_DARKEN) { - if (uw->weight > paintval) - testw = paintval*alpha + uw->weight*(1.0f-alpha); - else - testw = uw->weight; - } + if ((wp->flag & VP_SPRAY) == 0) { + if(do_multipaint_totsel == FALSE) { + float testw = wpaint_blend_tool(tool, weight_prev, paintval, brush_alpha_value); - if(multipaint == FALSE) { CLAMP(testw, 0.0f, 1.0f); - if( testw<uw->weight ) { - if(dw->weight < testw) dw->weight= testw; - else if(dw->weight > uw->weight) dw->weight= uw->weight; + if (testw < weight_prev) { + if(weight < testw) weight = testw; + else if(weight > weight_prev) weight = weight_prev; } else { - if(dw->weight > testw) dw->weight= testw; - else if(dw->weight < uw->weight) dw->weight= uw->weight; + if (weight > testw) weight = testw; + else if (weight < weight_prev) weight = weight_prev; } } } - + + return weight; } /* ----------------------------------------------------- */ @@ -1062,75 +1069,99 @@ void PAINT_OT_weight_sample_group(wmOperatorType *ot) ot->prop= prop; } - -#if 0 /* UNUSED */ -static void do_weight_paint_auto_normalize(MDeformVert *dvert, - int paint_nr, char *map) +static void do_weight_paint_normalize_all(MDeformVert *dvert, const int defbase_tot, const char *vgroup_validmap) { -// MDeformWeight *dw = dvert->dw; - float sum=0.0f, fac=0.0f, paintw=0.0f; - int i, tot=0; + float sum= 0.0f, fac; + unsigned int i, tot=0; + MDeformWeight *dw; + + for (i= dvert->totweight, dw= dvert->dw; i != 0; i--, dw++) { + if (dw->def_nr < defbase_tot && vgroup_validmap[dw->def_nr]) { + tot++; + sum += dw->weight; + } + } - if (!map) + if ((tot == 0) || (sum == 1.0f)) { return; + } - for (i=0; i<dvert->totweight; i++) { - if (dvert->dw[i].def_nr == paint_nr) - paintw = dvert->dw[i].weight; + if (sum != 0.0f) { + fac= 1.0f / sum; - if (map[dvert->dw[i].def_nr]) { - tot += 1; - if (dvert->dw[i].def_nr != paint_nr) - sum += dvert->dw[i].weight; + for (i= dvert->totweight, dw= dvert->dw; i != 0; i--, dw++) { + if (dw->def_nr < defbase_tot && vgroup_validmap[dw->def_nr]) { + dw->weight *= fac; + } } } - - if (!tot || sum <= (1.0f - paintw)) - return; - - fac = sum / (1.0f - paintw); - fac = fac==0.0f ? 1.0f : 1.0f / fac; + else { + /* hrmf, not a factor in this case */ + fac = 1.0f / tot; - for (i=0; i<dvert->totweight; i++) { - if (map[dvert->dw[i].def_nr]) { - if (dvert->dw[i].def_nr != paint_nr) - dvert->dw[i].weight *= fac; + for (i= dvert->totweight, dw= dvert->dw; i != 0; i--, dw++) { + if (dw->def_nr < defbase_tot && vgroup_validmap[dw->def_nr]) { + dw->weight = fac; + } } } } -#endif -/* the active group should be involved in auto normalize */ -static void do_weight_paint_auto_normalize_all_groups(MDeformVert *dvert, const int defbase_tot, - const char *vgroup_validmap, char do_auto_normalize) +/* same as function above except it normalizes against the active vgroup which remains unchanged + * + * note that the active is just the group which is unchanged, it can be any, + * can also be -1 to normalize all but in that case call 'do_weight_paint_normalize_all' */ +static void do_weight_paint_normalize_all_active(MDeformVert *dvert, const int defbase_tot, const char *vgroup_validmap, + const int vgroup_active) { - if (do_auto_normalize == FALSE) { + float sum= 0.0f, fac; + unsigned int i, tot=0; + MDeformWeight *dw; + float act_weight = 0.0f; + + for (i= dvert->totweight, dw= dvert->dw; i != 0; i--, dw++) { + if (dw->def_nr < defbase_tot && vgroup_validmap[dw->def_nr]) { + if (dw->def_nr != vgroup_active) { + sum += dw->weight; + tot++; + } + else { + act_weight = dw->weight; + } + } + } + + if ((tot == 0) || (sum + act_weight == 1.0f)) { return; } - else { - float sum= 0.0f, fac; - unsigned int i, tot=0; - MDeformWeight *dw; + + if (sum != 0.0f) { + fac = (1.0f / sum) * (1.0f - act_weight); for (i= dvert->totweight, dw= dvert->dw; i != 0; i--, dw++) { - if (dw->def_nr < defbase_tot) { - if (vgroup_validmap[dw->def_nr]) { - tot++; - sum += dw->weight; + if (dw->def_nr < defbase_tot && vgroup_validmap[dw->def_nr]) { + if (dw->def_nr != vgroup_active) { + dw->weight *= fac; + + /* paranoid but possibly with float error */ + CLAMP(dw->weight, 0.0f, 1.0f); } } } + } + else { + /* corner case where we need to scale all weights evenly because they're all zero */ - if ((tot == 0) || (sum == 1.0f) || (sum == 0.0f)) { - return; - } + /* hrmf, not a factor in this case */ + fac = (1.0f - act_weight) / tot; - fac= 1.0f / sum; + /* paranoid but possibly with float error */ + CLAMP(fac, 0.0f, 1.0f); for (i= dvert->totweight, dw= dvert->dw; i != 0; i--, dw++) { - if (dw->def_nr < defbase_tot) { - if (vgroup_validmap[dw->def_nr]) { - dw->weight *= fac; + if (dw->def_nr < defbase_tot && vgroup_validmap[dw->def_nr]) { + if (dw->def_nr != vgroup_active) { + dw->weight = fac; } } } @@ -1487,6 +1518,8 @@ typedef struct WeightPaintInfo { char do_flip; char do_multipaint; char do_auto_normalize; + + float brush_alpha_value; /* result of brush_alpha() */ } WeightPaintInfo; /* fresh start to make multi-paint and locking modular */ @@ -1526,7 +1559,10 @@ static int apply_mp_locks_normalize(Mesh *me, const WeightPaintInfo *wpi, enforce_locks(&dv_test, dv, wpi->defbase_tot, wpi->defbase_sel, wpi->lock_flags, wpi->vgroup_validmap, wpi->do_auto_normalize, wpi->do_multipaint); - do_weight_paint_auto_normalize_all_groups(dv, wpi->defbase_tot, wpi->vgroup_validmap, wpi->do_auto_normalize); + if (wpi->do_auto_normalize) { + /* XXX - should we pass the active group? - currently '-1' */ + do_weight_paint_normalize_all(dv, wpi->defbase_tot, wpi->vgroup_validmap); + } if(oldChange && wpi->do_multipaint && wpi->defbase_tot_sel > 1) { if(tdw->weight != oldw) { @@ -1568,55 +1604,151 @@ static int get_first_selected_nonzero_weight(MDeformVert *dvert, const int defba static char *wpaint_make_validmap(Object *ob); -static void do_weight_paint_vertex( /* vars which remain the same for every vert */ +static void do_weight_paint_vertex(/* vars which remain the same for every vert */ VPaint *wp, Object *ob, const WeightPaintInfo *wpi, - /* vars which change on each stroke */ + /* vars which change on each stroke */ const unsigned int index, float alpha, float paintweight ) { Mesh *me= ob->data; MDeformVert *dv= &me->dvert[index]; - MDeformWeight *dw, *uw; + MDeformWeight *dw, *dw_prev; + + /* mirror vars */ + int index_mirr; + int vgroup_mirr; + + MDeformVert *dv_mirr; + MDeformWeight *dw_mirr; + + const short do_multipaint_totsel = (wpi->do_multipaint && wpi->defbase_tot_sel > 1); if(wp->flag & VP_ONLYVGROUP) { dw= defvert_find_index(dv, wpi->vgroup_active); - uw= defvert_find_index(wp->wpaint_prev+index, wpi->vgroup_active); + dw_prev= defvert_find_index(wp->wpaint_prev+index, wpi->vgroup_active); } else { dw= defvert_verify_index(dv, wpi->vgroup_active); - uw= defvert_verify_index(wp->wpaint_prev+index, wpi->vgroup_active); + dw_prev= defvert_verify_index(wp->wpaint_prev+index, wpi->vgroup_active); } - if(dw==NULL || uw==NULL) { + if(dw==NULL || dw_prev==NULL) { return; } + + /* from now on we can check if mirrors enabled if this var is -1 and not bother with the flag */ + if (me->editflag & ME_EDIT_MIRROR_X) { + index_mirr = mesh_get_x_mirror_vert(ob, index); + vgroup_mirr = (wpi->vgroup_mirror != -1) ? wpi->vgroup_mirror : wpi->vgroup_active; + + /* another possible error - mirror group _and_ active group are the same (which is fine), + * but we also are painting onto a center vertex - this would paint the same weight twice */ + if (index_mirr == index && vgroup_mirr == wpi->vgroup_active) { + index_mirr = vgroup_mirr = -1; + } + } + else { + index_mirr = vgroup_mirr = -1; + } + + + /* get the mirror def vars */ + if (index_mirr != -1) { + dv_mirr = &me->dvert[index_mirr]; + if (wp->flag & VP_ONLYVGROUP) { + dw_mirr = defvert_find_index(dv_mirr, vgroup_mirr); + + if (dw_mirr == NULL) { + index_mirr = vgroup_mirr = -1; + dv_mirr = NULL; + } + } + else { + if (index != index_mirr) { + dw_mirr = defvert_verify_index(dv_mirr, vgroup_mirr); + } + else { + /* dv and dv_mirr are the same */ + int totweight_prev = dv_mirr->totweight; + int dw_offset = (int)(dw - dv_mirr->dw); + dw_mirr = defvert_verify_index(dv_mirr, vgroup_mirr); + + /* if we added another, get our old one back */ + if (totweight_prev != dv_mirr->totweight) { + dw = &dv_mirr->dw[dw_offset]; + } + } + } + } + else { + dv_mirr = NULL; + dw_mirr = NULL; + } + + /* TODO: De-duplicate the simple weight paint - jason */ /* ... or not, since its <10 SLOC - campbell */ /* If there are no locks or multipaint, * then there is no need to run the more complicated checks */ - if ( (wpi->do_multipaint == FALSE || wpi->defbase_tot_sel <= 1) && + if ( (do_multipaint_totsel == FALSE) && (wpi->lock_flags == NULL || has_locked_group(dv, wpi->defbase_tot, wpi->vgroup_validmap, wpi->lock_flags) == FALSE)) { - wpaint_blend(wp, dw, uw, alpha, paintweight, wpi->do_flip, FALSE); - - if(me->editflag & ME_EDIT_MIRROR_X) { /* x mirror painting */ - int index_mirr= mesh_get_x_mirror_vert(ob, index); - if(index_mirr != -1) { - MDeformVert *dv_mirr= &me->dvert[index_mirr]; - /* copy, not paint again */ - uw= defvert_verify_index(dv_mirr, (wpi->vgroup_mirror != -1) ? wpi->vgroup_mirror : wpi->vgroup_active); - uw->weight= dw->weight; - } + dw->weight = wpaint_blend(wp, dw->weight, dw_prev->weight, alpha, paintweight, + wpi->brush_alpha_value, wpi->do_flip, FALSE); + + /* WATCH IT: take care of the ordering of applying mirror -> normalize, + * can give wrong results [#26193], least confusing if normalize is done last */ + + /* apply mirror */ + if(index_mirr != -1) { + /* copy, not paint again */ + dw_mirr->weight = dw->weight; } - /* important to normalize after mirror, otherwise mirror gets weight - * which has already been scaled down in relation to other weights, - * then scales a second time [#26193]. Tricky multi-paint code doesn't - * suffer from this problem - campbell */ - do_weight_paint_auto_normalize_all_groups(dv, wpi->defbase_tot, wpi->vgroup_validmap, wpi->do_auto_normalize); + /* apply normalize */ + if (wpi->do_auto_normalize) { + /* note on normalize - this used to be applied after painting and normalize all weights, + * in some ways this is good because there is feedback where the more weights involved would + * 'risist' so you couldn't instantly zero out other weights by painting 1.0 on the active. + * + * However this gave a problem since applying mirror, then normalize both verts + * the resulting weight wont match on both sides. + * + * If this 'resisting', slower normalize is nicer, we could call + * do_weight_paint_normalize_all() and only use... + * do_weight_paint_normalize_all_active() when normalizing the mirror vertex. + * - campbell + */ + do_weight_paint_normalize_all_active(dv, wpi->defbase_tot, wpi->vgroup_validmap, wpi->vgroup_active); + + if (index_mirr != -1) { + /* only normalize if this is not a center vertex, else we get a conflict, normalizing twice */ + if (index != index_mirr) { + do_weight_paint_normalize_all_active(dv_mirr, wpi->defbase_tot, wpi->vgroup_validmap, vgroup_mirr); + } + else { + /* this case accounts for... + * - painting onto a center vertex of a mesh + * - x mirror is enabled + * - auto normalize is enabled + * - the group you are painting onto has a L / R version + * + * We wan't L/R vgroups to have the same weight but this cant be if both are over 0.5, + * We _could_ have special check for that, but this would need its own normalize function which + * holds 2 groups from changing at once. + * + * So! just balance out the 2 weights, it keeps them equal and everything normalized. + * + * While it wont hit the desired weight immediatelty as the user waggles their mouse, + * constant painting and re-normalizing will get there. this is also just simpler logic. + * - campbell */ + dw_mirr->weight = dw->weight = (dw_mirr->weight + dw->weight) * 0.5f; + } + } + } } else { /* use locks and/or multipaint */ @@ -1626,38 +1758,37 @@ static void do_weight_paint_vertex( /* vars which remain the same for every vert float change = 0; float oldChange = 0; int i; - MDeformWeight *tdw = NULL, *tuw; + MDeformWeight *tdw = NULL, *tdw_prev; MDeformVert dv_copy= {NULL}; oldw = dw->weight; - wpaint_blend(wp, dw, uw, alpha, paintweight, wpi->do_flip, wpi->do_multipaint && wpi->defbase_tot_sel >1); - neww = dw->weight; - dw->weight = oldw; + neww = wpaint_blend(wp, dw->weight, dw_prev->weight, alpha, paintweight, + wpi->brush_alpha_value, wpi->do_flip, do_multipaint_totsel); /* setup multi-paint */ - if(wpi->defbase_tot_sel > 1 && wpi->do_multipaint) { + if (do_multipaint_totsel) { dv_copy.dw= MEM_dupallocN(dv->dw); dv_copy.flag = dv->flag; dv_copy.totweight = dv->totweight; tdw = dw; - tuw = uw; + tdw_prev = dw_prev; change = get_mp_change(&wp->wpaint_prev[index], wpi->defbase_tot, wpi->defbase_sel, neww - oldw); if(change) { if(!tdw->weight) { i = get_first_selected_nonzero_weight(dv, wpi->defbase_tot, wpi->defbase_sel); if(i>=0) { tdw = &(dv->dw[i]); - tuw = defvert_verify_index(&wp->wpaint_prev[index], tdw->def_nr); + tdw_prev = defvert_verify_index(&wp->wpaint_prev[index], tdw->def_nr); } else { change = 0; } } - if(change && tuw->weight && tuw->weight * change) { - if(tdw->weight != tuw->weight) { - oldChange = tdw->weight/tuw->weight; - testw = tuw->weight*change; - if( testw > tuw->weight ) { + if(change && tdw_prev->weight && tdw_prev->weight * change) { + if(tdw->weight != tdw_prev->weight) { + oldChange = tdw->weight/tdw_prev->weight; + testw = tdw_prev->weight*change; + if( testw > tdw_prev->weight ) { if(change > oldChange) { /* reset the weights and use the new change */ defvert_reset_to_prev(wp->wpaint_prev+index, dv); @@ -1701,15 +1832,12 @@ static void do_weight_paint_vertex( /* vars which remain the same for every vert (void)dw; /* quiet warnigns */ #endif - if(me->editflag & ME_EDIT_MIRROR_X) { /* x mirror painting */ - int index_mirr= mesh_get_x_mirror_vert(ob, index); - if(index_mirr != -1) { - MDeformVert *dv_mirr= &me->dvert[index_mirr]; - /* copy, not paint again */ - uw= defvert_verify_index(dv_mirr, (wpi->vgroup_mirror != -1) ? wpi->vgroup_mirror : wpi->vgroup_active); - //uw->weight= dw->weight; - apply_mp_locks_normalize(me, wpi, index_mirr, uw, tdw, change, oldChange, oldw, neww); - } + /* x mirror painting */ + if(index_mirr != -1) { + /* copy, not paint again */ + + /* dw_mirr->weight = dw->weight; */ /* TODO, explain the logic in not assigning weight! - campbell */ + apply_mp_locks_normalize(me, wpi, index_mirr, dw_mirr, tdw, change, oldChange, oldw, neww); } } } @@ -1974,6 +2102,7 @@ static int wpaint_stroke_test_start(bContext *C, wmOperator *op, wmEvent *UNUSED static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, PointerRNA *itemptr) { + Scene *scene= CTX_data_scene(C); ToolSettings *ts= CTX_data_tool_settings(C); VPaint *wp= ts->wpaint; Brush *brush = paint_brush(&wp->paint); @@ -1992,8 +2121,9 @@ static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P char *defbase_sel; const float pressure = RNA_float_get(itemptr, "pressure"); - const float brush_size_final = brush_size(brush) * (brush_use_size_pressure(brush) ? pressure : 1.0f); - const float brush_alpha_final = brush_alpha(brush) * (brush_use_alpha_pressure(brush) ? pressure : 1.0f); + const float brush_size_pressure = brush_size(scene, brush) * (brush_use_size_pressure(scene, brush) ? pressure : 1.0f); + const float brush_alpha_value = brush_alpha(scene, brush); + const float brush_alpha_pressure = brush_alpha_value * (brush_use_alpha_pressure(scene, brush) ? pressure : 1.0f); /* intentionally dont initialize as NULL, make sure we initialize all members below */ WeightPaintInfo wpi; @@ -2037,6 +2167,7 @@ static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P wpi.do_flip= RNA_boolean_get(itemptr, "pen_flip"); wpi.do_multipaint= (ts->multipaint != 0); wpi.do_auto_normalize= ((ts->auto_normalize != 0) && (wpi.vgroup_validmap != NULL)); + wpi.brush_alpha_value= brush_alpha_value; /* *** done setting up WeightPaintInfo *** */ @@ -2049,7 +2180,7 @@ static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P if(wp->flag & VP_AREA) { /* Ugly hack, to avoid drawing vertex index when getting the face index buffer - campbell */ me->editflag &= ~ME_EDIT_VERT_SEL; - totindex= sample_backbuf_area(vc, indexar, me->totface, mval[0], mval[1], brush_size_final); + totindex= sample_backbuf_area(vc, indexar, me->totface, mval[0], mval[1], brush_size_pressure); me->editflag |= use_vert_sel ? ME_EDIT_VERT_SEL : 0; } else { @@ -2085,7 +2216,7 @@ static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P /* make sure each vertex gets treated only once */ /* and calculate filter weight */ totw= 0.0f; - if(brush->vertexpaint_tool==VP_BLUR) + if (brush->vertexpaint_tool == PAINT_BLEND_BLUR) paintweight= 0.0f; else paintweight= ts->vgroup_weight; @@ -2107,7 +2238,7 @@ static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P if(mface->v4) me->dvert[mface->v4].flag= 1; } - if(brush->vertexpaint_tool==VP_BLUR) { + if (brush->vertexpaint_tool == PAINT_BLEND_BLUR) { MDeformWeight *dw, *(*dw_func)(MDeformVert *, const int); unsigned int fidx= mface->v4 ? 3:2; @@ -2118,7 +2249,7 @@ static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P do { unsigned int vidx= *(&mface->v1 + fidx); - const float fac = calc_vp_strength_dl(wp, vc, wpd->vertexcosnos+6*vidx, mval, brush_size_final); + const float fac = calc_vp_strength_dl(wp, vc, wpd->vertexcosnos+6*vidx, mval, brush_size_pressure); if (fac > 0.0f) { dw = dw_func(&me->dvert[vidx], wpi.vgroup_active); paintweight += dw ? (dw->weight * fac) : 0.0f; @@ -2131,7 +2262,7 @@ static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P } } - if (brush->vertexpaint_tool==VP_BLUR) { + if (brush->vertexpaint_tool == PAINT_BLEND_BLUR) { paintweight /= totw; } @@ -2145,7 +2276,7 @@ static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P if(me->dvert[vidx].flag) { alpha= calc_vp_alpha_dl(wp, vc, wpd->wpimat, wpd->vertexcosnos+6*vidx, - mval, brush_size_final, brush_alpha_final); + mval, brush_size_pressure, brush_alpha_pressure); if(alpha) { do_weight_paint_vertex(wp, ob, &wpi, vidx, alpha, paintweight); } @@ -2406,7 +2537,7 @@ static int vpaint_stroke_test_start(bContext *C, struct wmOperator *op, wmEvent static void vpaint_paint_face(VPaint *vp, VPaintData *vpd, Object *ob, const unsigned int index, const float mval[2], - const float brush_size_final, const float brush_alpha_final, + const float brush_size_pressure, const float brush_alpha_pressure, int UNUSED(flip)) { ViewContext *vc = &vpd->vc; @@ -2417,12 +2548,14 @@ static void vpaint_paint_face(VPaint *vp, VPaintData *vpd, Object *ob, unsigned int *mcolorig= ((unsigned int*)vp->vpaint_prev) + 4*index; float alpha; int i; + + int brush_alpha_pressure_i; if((vp->flag & VP_COLINDEX && mface->mat_nr!=ob->actcol-1) || ((me->editflag & ME_EDIT_PAINT_MASK) && !(mface->flag & ME_FACE_SEL))) return; - if(brush->vertexpaint_tool==VP_BLUR) { + if (brush->vertexpaint_tool == PAINT_BLEND_BLUR) { unsigned int fcol1= mcol_blend( mcol[0], mcol[1], 128); if(mface->v4) { unsigned int fcol2= mcol_blend( mcol[2], mcol[3], 128); @@ -2431,20 +2564,23 @@ static void vpaint_paint_face(VPaint *vp, VPaintData *vpd, Object *ob, else { vpd->paintcol= mcol_blend( mcol[2], fcol1, 170); } - } + brush_alpha_pressure_i = (int)(brush_alpha_pressure*255.0f); + 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, brush_size_final, brush_alpha_final); - if(alpha) { - vpaint_blend(vp, mcol+i, mcolorig+i, vpd->paintcol, (int)(alpha*255.0f)); + mval, brush_size_pressure, brush_alpha_pressure); + if (alpha) { + const int alpha_i = (int)(alpha*255.0f); + mcol[i] = vpaint_blend(vp, mcol[i], mcolorig[i], vpd->paintcol, alpha_i, brush_alpha_pressure_i); } } } static void vpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, PointerRNA *itemptr) { + Scene *scene= CTX_data_scene(C); ToolSettings *ts= CTX_data_tool_settings(C); struct VPaintData *vpd = paint_stroke_mode_data(stroke); VPaint *vp= ts->vpaint; @@ -2458,8 +2594,8 @@ static void vpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P float mval[2]; const float pressure = RNA_float_get(itemptr, "pressure"); - const float brush_size_final = brush_size(brush) * (brush_use_size_pressure(brush) ? pressure : 1.0f); - const float brush_alpha_final = brush_alpha(brush) * (brush_use_alpha_pressure(brush) ? pressure : 1.0f); + const float brush_size_pressure = brush_size(scene, brush) * (brush_use_size_pressure(scene, brush) ? pressure : 1.0f); + const float brush_alpha_pressure = brush_alpha(scene, brush) * (brush_use_alpha_pressure(scene, brush) ? pressure : 1.0f); RNA_float_get_array(itemptr, "mouse", mval); flip = RNA_boolean_get(itemptr, "pen_flip"); @@ -2475,7 +2611,7 @@ static void vpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P /* which faces are involved */ if(vp->flag & VP_AREA) { - totindex= sample_backbuf_area(vc, indexar, me->totface, mval[0], mval[1], brush_size_final); + totindex= sample_backbuf_area(vc, indexar, me->totface, mval[0], mval[1], brush_size_pressure); } else { indexar[0]= view3d_sample_backbuf(vc, mval[0], mval[1]); @@ -2487,14 +2623,14 @@ static void vpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P for(index=0; index<totindex; index++) { if (indexar[index] && indexar[index]<=me->totface) { - vpaint_paint_face(vp, vpd, ob, indexar[index]-1, mval, brush_size_final, brush_alpha_final, flip); + vpaint_paint_face(vp, vpd, ob, indexar[index]-1, mval, brush_size_pressure, brush_alpha_pressure, flip); } } swap_m4m4(vc->rv3d->persmat, mat); /* was disabled because it is slow, but necessary for blur */ - if(brush->vertexpaint_tool == VP_BLUR) + if (brush->vertexpaint_tool == PAINT_BLEND_BLUR) do_shared_vertexcol(me); ED_region_tag_redraw(vc->ar); diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 649a993ea69..27a0bc8f502 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -236,7 +236,7 @@ typedef struct StrokeCache { float vertex_rotation; - char saved_active_brush_name[24]; + char saved_active_brush_name[MAX_ID_NAME]; int alt_smooth; float plane_trim_squared; @@ -543,13 +543,14 @@ static float calc_symmetry_feather(Sculpt *sd, StrokeCache* cache) special multiplier found experimentally to scale the strength factor. */ static float brush_strength(Sculpt *sd, StrokeCache *cache, float feather) { + const Scene *scene = cache->vc->scene; Brush *brush = paint_brush(&sd->paint); /* Primary strength input; square it to make lower values more sensitive */ - const float root_alpha = brush_alpha(brush); + const float root_alpha = brush_alpha(scene, brush); float alpha = root_alpha*root_alpha; float dir = brush->flag & BRUSH_DIR_IN ? -1 : 1; - float pressure = brush_use_alpha_pressure(brush) ? cache->pressure : 1; + float pressure = brush_use_alpha_pressure(scene, brush) ? cache->pressure : 1; float pen_flip = cache->pen_flip ? -1 : 1; float invert = cache->invert ? -1 : 1; float accum = integrate_overlap(brush); @@ -679,7 +680,7 @@ static float tex_strength(SculptSession *ss, Brush *br, float point[3], else /* else (mtex->brush_map_mode == MTEX_MAP_MODE_TILED), leave the coordinates relative to the screen */ { - radius = brush_size(br); // use unadjusted size for tiled mode + radius = brush_size(ss->cache->vc->scene, br); // use unadjusted size for tiled mode x = point_2d[0]; y = point_2d[1]; @@ -1167,6 +1168,7 @@ static void do_draw_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode) static void do_crease_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode) { SculptSession *ss = ob->sculpt; + const Scene *scene = ss->cache->vc->scene; Brush *brush = paint_brush(&sd->paint); float offset[3], area_normal[3]; float bstrength= ss->cache->bstrength; @@ -1182,8 +1184,8 @@ static void do_crease_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnod /* we divide out the squared alpha and multiply by the squared crease to give us the pinch strength */ - if(brush_alpha(brush) > 0.0f) - crease_correction = brush->crease_pinch_factor*brush->crease_pinch_factor/(brush_alpha(brush)*brush_alpha(brush)); + if(brush_alpha(scene, brush) > 0.0f) + crease_correction = brush->crease_pinch_factor*brush->crease_pinch_factor/(brush_alpha(scene, brush)*brush_alpha(scene, brush)); else crease_correction = brush->crease_pinch_factor*brush->crease_pinch_factor; @@ -2658,10 +2660,10 @@ static void do_symmetrical_brush_actions(Sculpt *sd, Object *ob) cache->first_time= 0; } -static void sculpt_update_tex(Sculpt *sd, SculptSession *ss) +static void sculpt_update_tex(const Scene *scene, Sculpt *sd, SculptSession *ss) { Brush *brush = paint_brush(&sd->paint); - const int radius= brush_size(brush); + const int radius= brush_size(scene, brush); if(ss->texcache) { MEM_freeN(ss->texcache); @@ -3017,6 +3019,7 @@ static void sculpt_update_cache_variants(bContext *C, Sculpt *sd, Object *ob, struct PaintStroke *stroke, PointerRNA *ptr) { + Scene *scene = CTX_data_scene(C); SculptSession *ss = ob->sculpt; StrokeCache *cache = ss->cache; Brush *brush = paint_brush(&sd->paint); @@ -3051,19 +3054,19 @@ static void sculpt_update_cache_variants(bContext *C, Sculpt *sd, Object *ob, sd->pressure_value= cache->pressure; cache->previous_pixel_radius = cache->pixel_radius; - cache->pixel_radius = brush_size(brush); + cache->pixel_radius = brush_size(scene, brush); if(cache->first_time) { - if (!brush_use_locked_size(brush)) { - cache->initial_radius= paint_calc_object_space_radius(cache->vc, cache->true_location, brush_size(brush)); - brush_set_unprojected_radius(brush, cache->initial_radius); + if (!brush_use_locked_size(scene, brush)) { + cache->initial_radius= paint_calc_object_space_radius(cache->vc, cache->true_location, brush_size(scene, brush)); + brush_set_unprojected_radius(scene, brush, cache->initial_radius); } else { - cache->initial_radius= brush_unprojected_radius(brush); + cache->initial_radius= brush_unprojected_radius(scene, brush); } } - if(brush_use_size_pressure(brush)) { + if(brush_use_size_pressure(scene, brush)) { cache->pixel_radius *= cache->pressure; cache->radius= cache->initial_radius * cache->pressure; } @@ -3245,7 +3248,7 @@ int sculpt_stroke_get_location(bContext *C, struct PaintStroke *stroke, float ou return srd.hit; } -static void sculpt_brush_init_tex(Sculpt *sd, SculptSession *ss) +static void sculpt_brush_init_tex(const Scene *scene, Sculpt *sd, SculptSession *ss) { Brush *brush = paint_brush(&sd->paint); MTex *mtex= &brush->mtex; @@ -3257,7 +3260,7 @@ static void sculpt_brush_init_tex(Sculpt *sd, SculptSession *ss) /* TODO: Shouldn't really have to do this at the start of every stroke, but sculpt would need some sort of notification when changes are made to the texture. */ - sculpt_update_tex(sd, ss); + sculpt_update_tex(scene, sd, ss); } static int sculpt_brush_stroke_init(bContext *C, wmOperator *op) @@ -3271,7 +3274,7 @@ static int sculpt_brush_stroke_init(bContext *C, wmOperator *op) int is_smooth= 0; view3d_operator_needs_opengl(C); - sculpt_brush_init_tex(sd, ss); + sculpt_brush_init_tex(scene, sd, ss); is_smooth|= mode == BRUSH_STROKE_SMOOTH; is_smooth|= brush->sculpt_tool == SCULPT_TOOL_SMOOTH; @@ -3287,7 +3290,8 @@ static void sculpt_restore_mesh(Sculpt *sd, SculptSession *ss) /* Restore the mesh before continuing with anchored stroke */ if((brush->flag & BRUSH_ANCHORED) || - (brush->sculpt_tool == SCULPT_TOOL_GRAB && brush_use_size_pressure(brush)) || + (brush->sculpt_tool == SCULPT_TOOL_GRAB && + brush_use_size_pressure(ss->cache->vc->scene, brush)) || (brush->flag & BRUSH_RESTORE_MESH)) { StrokeCache *cache = ss->cache; diff --git a/source/blender/editors/sound/sound_ops.c b/source/blender/editors/sound/sound_ops.c index 8eb1f08b5b0..50c436d88f5 100644 --- a/source/blender/editors/sound/sound_ops.c +++ b/source/blender/editors/sound/sound_ops.c @@ -162,7 +162,7 @@ static int sound_open_exec(bContext *UNUSED(C), wmOperator *op) static int sound_open_invoke(bContext *C, wmOperator *op, wmEvent *event) { - if(RNA_property_is_set(op->ptr, "filepath")) + if(RNA_struct_property_is_set(op->ptr, "filepath")) return sound_open_exec(C, op); sound_open_init(C, op); @@ -359,12 +359,14 @@ static int sound_mixdown_exec(bContext *C, wmOperator *op) static int sound_mixdown_invoke(bContext *C, wmOperator *op, wmEvent *event) { - if(RNA_property_is_set(op->ptr, "filepath")) + if(RNA_struct_property_is_set(op->ptr, "filepath")) return sound_mixdown_exec(C, op); return WM_operator_filesel(C, op, event); } +#ifdef WITH_AUDASPACE + static int sound_mixdown_draw_check_prop(PointerRNA *UNUSED(ptr), PropertyRNA *prop) { const char *prop_id= RNA_property_identifier(prop); @@ -374,7 +376,6 @@ static int sound_mixdown_draw_check_prop(PointerRNA *UNUSED(ptr), PropertyRNA *p ); } -#ifdef WITH_AUDASPACE static void sound_mixdown_draw(bContext *C, wmOperator *op) { static EnumPropertyItem pcm_format_items[] = { @@ -652,7 +653,7 @@ static int sound_unpack_exec(bContext *C, wmOperator *op) bSound* sound= NULL; /* find the suppplied image by name */ - if (RNA_property_is_set(op->ptr, "id")) { + if (RNA_struct_property_is_set(op->ptr, "id")) { char sndname[MAX_ID_NAME-2]; RNA_string_get(op->ptr, "id", sndname); sound = BLI_findstring(&CTX_data_main(C)->sound, sndname, offsetof(ID, name) + 2); @@ -674,7 +675,7 @@ static int sound_unpack_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(even Editing* ed = CTX_data_scene(C)->ed; bSound* sound; - if(RNA_property_is_set(op->ptr, "id")) + if(RNA_struct_property_is_set(op->ptr, "id")) return sound_unpack_exec(C, op); if(!ed || !ed->act_seq || ed->act_seq->type != SEQ_SOUND) diff --git a/source/blender/editors/space_action/action_draw.c b/source/blender/editors/space_action/action_draw.c index 619e76e9e50..309b455e2a2 100644 --- a/source/blender/editors/space_action/action_draw.c +++ b/source/blender/editors/space_action/action_draw.c @@ -119,7 +119,7 @@ void draw_channel_names(bContext *C, bAnimContext *ac, ARegion *ar) } } { /* second pass: widgets */ - uiBlock *block= uiBeginBlock(C, ar, "dopesheet channel buttons", UI_EMBOSS); + uiBlock *block= uiBeginBlock(C, ar, __func__, UI_EMBOSS); size_t channel_index = 0; y= (float)ACHANNEL_FIRST; diff --git a/source/blender/editors/space_action/action_ops.c b/source/blender/editors/space_action/action_ops.c index c3af3521918..d4e44dee9c3 100644 --- a/source/blender/editors/space_action/action_ops.c +++ b/source/blender/editors/space_action/action_ops.c @@ -36,6 +36,7 @@ #include "DNA_space_types.h" #include "BLI_blenlib.h" +#include "BLI_utildefines.h" #include "ED_anim_api.h" #include "ED_markers.h" @@ -110,32 +111,45 @@ static void action_keymap_keyframes (wmKeyConfig *keyconf, wmKeyMap *keymap) /* action_select.c - selection tools */ /* click-select */ - WM_keymap_add_item(keymap, "ACTION_OT_clickselect", SELECTMOUSE, KM_PRESS, 0, 0); + kmi = WM_keymap_add_item(keymap, "ACTION_OT_clickselect", SELECTMOUSE, KM_PRESS, 0, 0); + RNA_boolean_set(kmi->ptr, "extend", FALSE); + RNA_boolean_set(kmi->ptr, "column", FALSE); kmi= WM_keymap_add_item(keymap, "ACTION_OT_clickselect", SELECTMOUSE, KM_PRESS, KM_ALT, 0); - RNA_boolean_set(kmi->ptr, "column", 1); + RNA_boolean_set(kmi->ptr, "extend", FALSE); + RNA_boolean_set(kmi->ptr, "column", TRUE); kmi= WM_keymap_add_item(keymap, "ACTION_OT_clickselect", SELECTMOUSE, KM_PRESS, KM_SHIFT, 0); - RNA_boolean_set(kmi->ptr, "extend", 1); + RNA_boolean_set(kmi->ptr, "extend", TRUE); + RNA_boolean_set(kmi->ptr, "column", FALSE); kmi= WM_keymap_add_item(keymap, "ACTION_OT_clickselect", SELECTMOUSE, KM_PRESS, KM_ALT|KM_SHIFT, 0); - RNA_boolean_set(kmi->ptr, "extend", 1); - RNA_boolean_set(kmi->ptr, "column", 1); + RNA_boolean_set(kmi->ptr, "extend", TRUE); + RNA_boolean_set(kmi->ptr, "column", TRUE); /* select left/right */ - WM_keymap_add_item(keymap, "ACTION_OT_select_leftright", SELECTMOUSE, KM_PRESS, KM_CTRL, 0); + kmi = WM_keymap_add_item(keymap, "ACTION_OT_select_leftright", SELECTMOUSE, KM_PRESS, KM_CTRL, 0); + RNA_boolean_set(kmi->ptr, "extend", FALSE); + RNA_enum_set(kmi->ptr, "mode", ACTKEYS_LRSEL_TEST); kmi= WM_keymap_add_item(keymap, "ACTION_OT_select_leftright", SELECTMOUSE, KM_PRESS, KM_CTRL|KM_SHIFT, 0); - RNA_boolean_set(kmi->ptr, "extend", 1); + RNA_boolean_set(kmi->ptr, "extend", TRUE); + RNA_enum_set(kmi->ptr, "mode", ACTKEYS_LRSEL_TEST); kmi= WM_keymap_add_item(keymap, "ACTION_OT_select_leftright", LEFTBRACKETKEY, KM_PRESS, 0, 0); + RNA_boolean_set(kmi->ptr, "extend", FALSE); RNA_enum_set(kmi->ptr, "mode", ACTKEYS_LRSEL_LEFT); kmi= WM_keymap_add_item(keymap, "ACTION_OT_select_leftright", RIGHTBRACKETKEY, KM_PRESS, 0, 0); + RNA_boolean_set(kmi->ptr, "extend", FALSE); RNA_enum_set(kmi->ptr, "mode", ACTKEYS_LRSEL_RIGHT); /* deselect all */ - WM_keymap_add_item(keymap, "ACTION_OT_select_all_toggle", AKEY, KM_PRESS, 0, 0); - RNA_boolean_set(WM_keymap_add_item(keymap, "ACTION_OT_select_all_toggle", IKEY, KM_PRESS, KM_CTRL, 0)->ptr, "invert", 1); + kmi = WM_keymap_add_item(keymap, "ACTION_OT_select_all_toggle", AKEY, KM_PRESS, 0, 0); + RNA_boolean_set(kmi->ptr, "invert", FALSE); + kmi = WM_keymap_add_item(keymap, "ACTION_OT_select_all_toggle", IKEY, KM_PRESS, KM_CTRL, 0); + RNA_boolean_set(kmi->ptr, "invert", TRUE); /* borderselect */ - WM_keymap_add_item(keymap, "ACTION_OT_select_border", BKEY, KM_PRESS, 0, 0); - RNA_boolean_set(WM_keymap_add_item(keymap, "ACTION_OT_select_border", BKEY, KM_PRESS, KM_ALT, 0)->ptr, "axis_range", 1); + kmi = WM_keymap_add_item(keymap, "ACTION_OT_select_border", BKEY, KM_PRESS, 0, 0); + RNA_boolean_set(kmi->ptr, "axis_range", FALSE); + kmi = WM_keymap_add_item(keymap, "ACTION_OT_select_border", BKEY, KM_PRESS, KM_ALT, 0); + RNA_boolean_set(kmi->ptr, "axis_range", TRUE); /* column select */ RNA_enum_set(WM_keymap_add_item(keymap, "ACTION_OT_select_column", KKEY, KM_PRESS, 0, 0)->ptr, "mode", ACTKEYS_COLUMNSEL_KEYS); diff --git a/source/blender/editors/space_buttons/buttons_header.c b/source/blender/editors/space_buttons/buttons_header.c index 1c352b1cb21..6777e2c2d85 100644 --- a/source/blender/editors/space_buttons/buttons_header.c +++ b/source/blender/editors/space_buttons/buttons_header.c @@ -108,7 +108,7 @@ void buttons_header_buttons(const bContext *C, ARegion *ar) buttons_context_compute(C, sbuts); - block= uiBeginBlock(C, ar, "header buttons", UI_EMBOSS); + block= uiBeginBlock(C, ar, __func__, UI_EMBOSS); uiBlockSetHandleFunc(block, do_buttons_buttons, NULL); xco= ED_area_header_switchbutton(C, block, yco); diff --git a/source/blender/editors/space_buttons/buttons_ops.c b/source/blender/editors/space_buttons/buttons_ops.c index 05fdcd50067..df05521fa8d 100644 --- a/source/blender/editors/space_buttons/buttons_ops.c +++ b/source/blender/editors/space_buttons/buttons_ops.c @@ -103,7 +103,7 @@ static int file_browse_exec(bContext *C, wmOperator *op) char *str, path[FILE_MAX]; const char *path_prop= RNA_struct_find_property(op->ptr, "directory") ? "directory" : "filepath"; - if (RNA_property_is_set(op->ptr, path_prop)==0 || fbo==NULL) + if (RNA_struct_property_is_set(op->ptr, path_prop)==0 || fbo==NULL) return OPERATOR_CANCELLED; str= RNA_string_get_alloc(op->ptr, path_prop, NULL, 0); @@ -200,7 +200,7 @@ static int file_browse_invoke(bContext *C, wmOperator *op, wmEvent *event) /* normally ED_fileselect_get_params would handle this but we need to because of stupid * user-prefs exception - campbell */ if(RNA_struct_find_property(op->ptr, "relative_path")) { - if(!RNA_property_is_set(op->ptr, "relative_path")) { + if(!RNA_struct_property_is_set(op->ptr, "relative_path")) { /* annoying exception!, if were dealign with the user prefs, default relative to be off */ RNA_boolean_set(op->ptr, "relative_path", U.flag & USER_RELPATHS && (ptr.data != &U)); } diff --git a/source/blender/editors/space_buttons/space_buttons.c b/source/blender/editors/space_buttons/space_buttons.c index 0c326af406f..e6928e31dc7 100644 --- a/source/blender/editors/space_buttons/space_buttons.c +++ b/source/blender/editors/space_buttons/space_buttons.c @@ -96,11 +96,6 @@ static SpaceLink *buttons_new(const bContext *UNUSED(C)) static void buttons_free(SpaceLink *sl) { SpaceButs *sbuts= (SpaceButs*) sl; - - if(sbuts->ri) { - if (sbuts->ri->rect) MEM_freeN(sbuts->ri->rect); - MEM_freeN(sbuts->ri); - } if(sbuts->path) MEM_freeN(sbuts->path); @@ -131,7 +126,6 @@ static SpaceLink *buttons_duplicate(SpaceLink *sl) SpaceButs *sbutsn= MEM_dupallocN(sl); /* clear or remove stuff from old */ - sbutsn->ri= NULL; sbutsn->path= NULL; sbutsn->texuser= NULL; diff --git a/source/blender/editors/space_clip/clip_draw.c b/source/blender/editors/space_clip/clip_draw.c index ca2646e9967..eb8f30b6739 100644 --- a/source/blender/editors/space_clip/clip_draw.c +++ b/source/blender/editors/space_clip/clip_draw.c @@ -75,20 +75,20 @@ void clip_draw_curfra_label(SpaceClip *sc, float x, float y) { uiStyle *style= UI_GetStyle(); int fontid= style->widget.uifont_id; - char str[32]; - float fontsize, fontwidth; + char numstr[32]; + float font_dims[2] = {0.0f, 0.0f}; /* frame number */ BLF_size(fontid, 11.0f, U.dpi); - BLI_snprintf(str, sizeof(str), "%d", sc->user.framenr); - fontsize= BLF_height(fontid, str); - fontwidth= BLF_width(fontid, str); + BLI_snprintf(numstr, sizeof(numstr), "%d", sc->user.framenr); - glRecti(x, y, x+fontwidth+6, y+fontsize+4); + BLF_width_and_height(fontid, numstr, &font_dims[0], &font_dims[1]); + + glRecti(x, y, x + font_dims[0] + 6.0f, y + font_dims[1] + 4.0f); UI_ThemeColor(TH_TEXT); BLF_position(fontid, x+2.0f, y+2.0f, 0.0f); - BLF_draw(fontid, str, strlen(str)); + BLF_draw(fontid, numstr, sizeof(numstr)); } static void draw_movieclip_cache(SpaceClip *sc, ARegion *ar, MovieClip *clip, Scene *scene) @@ -250,9 +250,9 @@ static void draw_movieclip_buffer(SpaceClip *sc, ARegion *ar, ImBuf *ibuf, glBegin(GL_LINE_LOOP); glVertex2f(0.0f, 0.0f); - glVertex2f(ibuf->x, 0.0f); - glVertex2f(ibuf->x, ibuf->y); - glVertex2f(0.0f, ibuf->y); + glVertex2f(width, 0.0f); + glVertex2f(width, height); + glVertex2f(0.0f, height); glEnd(); glPopMatrix(); @@ -805,13 +805,13 @@ static void draw_marker_texts(SpaceClip *sc, MovieTrackingTrack *track, MovieTra BLI_snprintf(str, sizeof(str), "%s", track->name); BLF_position(fontid, pos[0], pos[1], 0.0f); - BLF_draw(fontid, str, strlen(str)); + BLF_draw(fontid, str, sizeof(str)); pos[1]-= fontsize; if(track->flag&TRACK_HAS_BUNDLE) { BLI_snprintf(str, sizeof(str), "Average error: %.3f", track->error); BLF_position(fontid, pos[0], pos[1], 0.0f); - BLF_draw(fontid, str, strlen(str)); + BLF_draw(fontid, str, sizeof(str)); pos[1]-= fontsize; } @@ -1259,14 +1259,24 @@ void clip_draw_main(SpaceClip *sc, ARegion *ar, Scene *scene) float smat[4][4], ismat[4][4]; ibuf= ED_space_clip_get_stable_buffer(sc, sc->loc, &sc->scale, &sc->angle); - BKE_tracking_stabdata_to_mat4(width, height, sc->loc, sc->scale, sc->angle, sc->stabmat); - unit_m4(smat); - smat[0][0]= 1.0f/width; - smat[1][1]= 1.0f/height; - invert_m4_m4(ismat, smat); + if(ibuf) { + float loc[2]; + + if(width != ibuf->x) + mul_v2_v2fl(loc, sc->loc, (float)width / ibuf->x); + else + copy_v2_v2(loc, sc->loc); + + BKE_tracking_stabdata_to_mat4(width, height, loc, sc->scale, sc->angle, sc->stabmat); - mul_serie_m4(sc->unistabmat, smat, sc->stabmat, ismat, NULL, NULL, NULL, NULL, NULL); + unit_m4(smat); + smat[0][0]= 1.0f/width; + smat[1][1]= 1.0f/height; + invert_m4_m4(ismat, smat); + + mul_serie_m4(sc->unistabmat, smat, sc->stabmat, ismat, NULL, NULL, NULL, NULL, NULL); + } } else { ibuf= ED_space_clip_get_buffer(sc); diff --git a/source/blender/editors/space_clip/clip_editor.c b/source/blender/editors/space_clip/clip_editor.c index d75df0ab51e..35d870022a4 100644 --- a/source/blender/editors/space_clip/clip_editor.c +++ b/source/blender/editors/space_clip/clip_editor.c @@ -86,7 +86,7 @@ ImBuf *ED_space_clip_get_buffer(SpaceClip *sc) if(sc->clip) { ImBuf *ibuf; - ibuf= BKE_movieclip_get_ibuf(sc->clip, &sc->user); + ibuf= BKE_movieclip_get_postprocessed_ibuf(sc->clip, &sc->user, sc->postproc_flag); if(ibuf && (ibuf->rect || ibuf->rect_float)) return ibuf; @@ -103,7 +103,7 @@ ImBuf *ED_space_clip_get_stable_buffer(SpaceClip *sc, float loc[2], float *scale if(sc->clip) { ImBuf *ibuf; - ibuf= BKE_movieclip_get_stable_ibuf(sc->clip, &sc->user, loc, scale, angle); + ibuf= BKE_movieclip_get_stable_ibuf(sc->clip, &sc->user, loc, scale, angle, sc->postproc_flag); if(ibuf && (ibuf->rect || ibuf->rect_float)) return ibuf; diff --git a/source/blender/editors/space_clip/clip_intern.h b/source/blender/editors/space_clip/clip_intern.h index 64881499a31..3f7456e90dc 100644 --- a/source/blender/editors/space_clip/clip_intern.h +++ b/source/blender/editors/space_clip/clip_intern.h @@ -145,4 +145,7 @@ void CLIP_OT_clean_tracks(struct wmOperatorType *ot); void CLIP_OT_tracking_object_new(struct wmOperatorType *ot); void CLIP_OT_tracking_object_remove(struct wmOperatorType *ot); +void CLIP_OT_copy_tracks(struct wmOperatorType *ot); +void CLIP_OT_paste_tracks(struct wmOperatorType *ot); + #endif /* ED_CLIP_INTERN_H */ diff --git a/source/blender/editors/space_clip/clip_ops.c b/source/blender/editors/space_clip/clip_ops.c index fe0b58ddda9..45c7043c44c 100644 --- a/source/blender/editors/space_clip/clip_ops.c +++ b/source/blender/editors/space_clip/clip_ops.c @@ -184,10 +184,10 @@ static int open_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) if(clip) path= clip->name; - if(!RNA_property_is_set(op->ptr, "relative_path")) + if(!RNA_struct_property_is_set(op->ptr, "relative_path")) RNA_boolean_set(op->ptr, "relative_path", U.flag & USER_RELPATHS); - if(RNA_property_is_set(op->ptr, "filepath")) + if(RNA_struct_property_is_set(op->ptr, "filepath")) return open_exec(C, op); open_init(C, op); @@ -220,14 +220,11 @@ void CLIP_OT_open(wmOperatorType *ot) static int reload_exec(bContext *C, wmOperator *UNUSED(op)) { - SpaceClip *sc= CTX_wm_space_clip(C); MovieClip *clip= CTX_data_edit_movieclip(C); if(!clip) return OPERATOR_CANCELLED; - sc->scopes.ok= 0; - BKE_movieclip_reload(clip); WM_event_add_notifier(C, NC_MOVIECLIP|NA_EDITED, clip); diff --git a/source/blender/editors/space_clip/space_clip.c b/source/blender/editors/space_clip/space_clip.c index 5291121571c..82da9b3b956 100644 --- a/source/blender/editors/space_clip/space_clip.c +++ b/source/blender/editors/space_clip/space_clip.c @@ -377,6 +377,10 @@ static void clip_operatortypes(void) /* object tracking */ WM_operatortype_append(CLIP_OT_tracking_object_new); WM_operatortype_append(CLIP_OT_tracking_object_remove); + + /* clipboard */ + WM_operatortype_append(CLIP_OT_copy_tracks); + WM_operatortype_append(CLIP_OT_paste_tracks); } static void clip_keymap(struct wmKeyConfig *keyconf) diff --git a/source/blender/editors/space_clip/tracking_ops.c b/source/blender/editors/space_clip/tracking_ops.c index d6940d14dbf..b67fac69745 100644 --- a/source/blender/editors/space_clip/tracking_ops.c +++ b/source/blender/editors/space_clip/tracking_ops.c @@ -1220,21 +1220,39 @@ static int track_count_markers(SpaceClip *sc, MovieClip *clip) return tot; } +static void clear_invisible_track_selection(SpaceClip *sc, MovieClip *clip) +{ + ListBase *tracksbase= BKE_tracking_get_tracks(&clip->tracking); + int hidden = 0; + + if ((sc->flag&SC_SHOW_MARKER_PATTERN)==0) + hidden |= TRACK_AREA_PAT; + + if ((sc->flag&SC_SHOW_MARKER_SEARCH)==0) + hidden |= TRACK_AREA_SEARCH; + + if (hidden) { + MovieTrackingTrack *track = tracksbase->first; + + while(track) { + BKE_tracking_track_flag(track, hidden, SELECT, 1); + + track = track->next; + } + } +} + static void track_init_markers(SpaceClip *sc, MovieClip *clip, int *frames_limit_r) { ListBase *tracksbase= BKE_tracking_get_tracks(&clip->tracking); MovieTrackingTrack *track; - int framenr= sc->user.framenr, hidden= 0; + int framenr= sc->user.framenr; int frames_limit= 0; - if((sc->flag&SC_SHOW_MARKER_PATTERN)==0) hidden|= TRACK_AREA_PAT; - if((sc->flag&SC_SHOW_MARKER_SEARCH)==0) hidden|= TRACK_AREA_SEARCH; + clear_invisible_track_selection(sc, clip); track= tracksbase->first; while(track) { - if(hidden) - BKE_tracking_track_flag(track, hidden, SELECT, 1); - if(TRACK_SELECTED(track)) { if((track->flag&TRACK_HIDDEN)==0 && (track->flag&TRACK_LOCKED)==0) { BKE_tracking_ensure_marker(track, framenr); @@ -3504,3 +3522,74 @@ void CLIP_OT_tracking_object_remove(wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } + +/********************** copy tracks to clipboard operator *********************/ + +static int copy_tracks_exec(bContext *C, wmOperator *UNUSED(op)) +{ + SpaceClip *sc = CTX_wm_space_clip(C); + MovieClip *clip = ED_space_clip(sc); + MovieTracking *tracking = &clip->tracking; + MovieTrackingObject *object = BKE_tracking_active_object(tracking); + + clear_invisible_track_selection(sc, clip); + + BKE_tracking_clipboard_copy_tracks(tracking, object); + + return OPERATOR_FINISHED; +} + +void CLIP_OT_copy_tracks(wmOperatorType *ot) +{ + /* identifiers */ + ot->name = "Copy Tracks"; + ot->description = "Copy selected tracks to clipboard"; + ot->idname = "CLIP_OT_copy_tracks"; + + /* api callbacks */ + ot->exec = copy_tracks_exec; + ot->poll = ED_space_clip_poll; + + /* flags */ + ot->flag= OPTYPE_REGISTER; +} + +/********************** paste tracks from clipboard operator *********************/ + +static int paste_tracks_poll(bContext *C) +{ + if (ED_space_clip_poll(C)) { + return BKE_tracking_clipboard_has_tracks(); + } + + return 0; +} + +static int paste_tracks_exec(bContext *C, wmOperator *UNUSED(op)) +{ + SpaceClip *sc = CTX_wm_space_clip(C); + MovieClip *clip = ED_space_clip(sc); + MovieTracking *tracking = &clip->tracking; + MovieTrackingObject *object = BKE_tracking_active_object(tracking); + + BKE_tracking_clipboard_paste_tracks(tracking, object); + + WM_event_add_notifier(C, NC_MOVIECLIP|NA_EDITED, clip); + + return OPERATOR_FINISHED; +} + +void CLIP_OT_paste_tracks(wmOperatorType *ot) +{ + /* identifiers */ + ot->name = "Paste Tracks"; + ot->description = "Paste tracks from clipboard"; + ot->idname = "CLIP_OT_paste_tracks"; + + /* api callbacks */ + ot->exec = paste_tracks_exec; + ot->poll = paste_tracks_poll; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} diff --git a/source/blender/editors/space_console/console_ops.c b/source/blender/editors/space_console/console_ops.c index 23316616a57..9640701965c 100644 --- a/source/blender/editors/space_console/console_ops.c +++ b/source/blender/editors/space_console/console_ops.c @@ -410,7 +410,7 @@ static int console_insert_exec(bContext *C, wmOperator *op) static int console_insert_invoke(bContext *C, wmOperator *op, wmEvent *event) { - // if(!RNA_property_is_set(op->ptr, "text")) { /* always set from keymap XXX */ + // if(!RNA_struct_property_is_set(op->ptr, "text")) { /* always set from keymap XXX */ if(!RNA_string_length(op->ptr, "text")) { /* if alt/ctrl/super are pressed pass through */ if(event->ctrl || event->oskey) { @@ -655,7 +655,11 @@ static int console_history_append_exec(bContext *C, wmOperator *op) ED_area_tag_redraw(sa); - console_scroll_bottom(ar); + /* when calling render modally this can be NULL when calling: + * bpy.ops.render.render('INVOKE_DEFAULT') */ + if (ar) { + console_scroll_bottom(ar); + } return OPERATOR_FINISHED; } diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c index 41aae64445a..c84a9d10ab4 100644 --- a/source/blender/editors/space_file/file_draw.c +++ b/source/blender/editors/space_file/file_draw.c @@ -118,7 +118,7 @@ void file_draw_buttons(const bContext *C, ARegion *ar) const int separator = 4; /* Additional locals. */ - char name[32]; + char uiblockstr[32]; int loadbutton; int fnumbuttons; int min_x = 10; @@ -134,8 +134,8 @@ void file_draw_buttons(const bContext *C, ARegion *ar) ARegion* artmp; /* Initialize UI block. */ - sprintf(name, "win %p", (void *)ar); - block = uiBeginBlock(C, ar, name, UI_EMBOSS); + BLI_snprintf(uiblockstr, sizeof(uiblockstr), "win %p", (void *)ar); + block = uiBeginBlock(C, ar, uiblockstr, UI_EMBOSS); uiBlockSetHandleFunc(block, do_file_buttons, NULL); /* exception to make space for collapsed region icon */ @@ -450,7 +450,7 @@ void file_draw_list(const bContext *C, ARegion *ar) struct FileList* files = sfile->files; struct direntry *file; ImBuf *imb; - uiBlock *block = uiBeginBlock(C, ar, "FileNames", UI_EMBOSS); + uiBlock *block = uiBeginBlock(C, ar, __func__, UI_EMBOSS); int numfiles; int numfiles_layout; int sx, sy; diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index 4682ea3fb60..dee8db88d49 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -970,7 +970,7 @@ int filelist_islibrary(struct FileList* filelist, char* dir, char* group) return BLO_is_a_library(filelist->dir, dir, group); } -static int groupname_to_code(char *group) +static int groupname_to_code(const char *group) { char buf[32]; char *lslash; @@ -1200,10 +1200,10 @@ void filelist_from_main(struct FileList *filelist) if(idcode == ID_MA || idcode == ID_TE || idcode == ID_LA || idcode == ID_WO || idcode == ID_IM) { files->flags |= IMAGEFILE; } - if(id->lib && fake) sprintf(files->extra, "LF %d", id->us); - else if(id->lib) sprintf(files->extra, "L %d", id->us); - else if(fake) sprintf(files->extra, "F %d", id->us); - else sprintf(files->extra, " %d", id->us); + if(id->lib && fake) BLI_snprintf(files->extra, sizeof(files->extra), "LF %d", id->us); + else if(id->lib) BLI_snprintf(files->extra, sizeof(files->extra), "L %d", id->us); + else if(fake) BLI_snprintf(files->extra, sizeof(files->extra), "F %d", id->us); + else BLI_snprintf(files->extra, sizeof(files->extra), " %d", id->us); if(id->lib) { if(totlib==0) firstlib= files; diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c index 1d629ad6dea..bf31775a349 100644 --- a/source/blender/editors/space_file/filesel.c +++ b/source/blender/editors/space_file/filesel.c @@ -130,7 +130,7 @@ short ED_fileselect_set_params(SpaceFile *sfile) else params->type = FILE_SPECIAL; - if (is_filepath && RNA_property_is_set(op->ptr, "filepath")) { + if (is_filepath && RNA_struct_property_is_set(op->ptr, "filepath")) { char name[FILE_MAX]; RNA_string_get(op->ptr, "filepath", name); if (params->type == FILE_LOADLIB) { @@ -142,12 +142,12 @@ short ED_fileselect_set_params(SpaceFile *sfile) } } else { - if (is_directory && RNA_property_is_set(op->ptr, "directory")) { + if (is_directory && RNA_struct_property_is_set(op->ptr, "directory")) { RNA_string_get(op->ptr, "directory", params->dir); sfile->params->file[0]= '\0'; } - if (is_filename && RNA_property_is_set(op->ptr, "filename")) { + if (is_filename && RNA_struct_property_is_set(op->ptr, "filename")) { RNA_string_get(op->ptr, "filename", params->file); } } @@ -226,7 +226,7 @@ short ED_fileselect_set_params(SpaceFile *sfile) } if (is_relative_path) { - if (!RNA_property_is_set(op->ptr, "relative_path")) { + if (!RNA_struct_property_is_set(op->ptr, "relative_path")) { RNA_boolean_set(op->ptr, "relative_path", U.flag & USER_RELPATHS); } } diff --git a/source/blender/editors/space_graph/graph_buttons.c b/source/blender/editors/space_graph/graph_buttons.c index c1dfa97a508..9e1ff82c20d 100644 --- a/source/blender/editors/space_graph/graph_buttons.c +++ b/source/blender/editors/space_graph/graph_buttons.c @@ -647,7 +647,7 @@ static void graph_panel_drivers(const bContext *C, Panel *pa) uiItemL(row, "Driver Value:", ICON_NONE); - sprintf(valBuf, "%.3f", driver->curval); + BLI_snprintf(valBuf, sizeof(valBuf), "%.3f", driver->curval); uiItemL(row, valBuf, ICON_NONE); } @@ -702,18 +702,18 @@ static void graph_panel_drivers(const bContext *C, Panel *pa) graph_panel_driverVar__transChan(box, ale->id, dvar); break; } - - /* value of variable */ - if (driver->flag & DRIVER_FLAG_SHOWDEBUG) { - char valBuf[32]; - - box= uiLayoutBox(col); - row= uiLayoutRow(box, 1); + + /* value of variable */ + if (driver->flag & DRIVER_FLAG_SHOWDEBUG) { + char valBuf[32]; + + box= uiLayoutBox(col); + row= uiLayoutRow(box, 1); uiItemL(row, "Value:", ICON_NONE); - sprintf(valBuf, "%.3f", dvar->curval); + BLI_snprintf(valBuf, sizeof(valBuf), "%.3f", dvar->curval); uiItemL(row, valBuf, ICON_NONE); - } + } } /* cleanup */ diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c index 7091fe094c6..7bdb37d9651 100644 --- a/source/blender/editors/space_graph/graph_draw.c +++ b/source/blender/editors/space_graph/graph_draw.c @@ -1003,7 +1003,7 @@ void graph_draw_channel_names(bContext *C, bAnimContext *ac, ARegion *ar) } } { /* second pass: widgets */ - uiBlock *block= uiBeginBlock(C, ar, "graph channel buttons", UI_EMBOSS); + uiBlock *block= uiBeginBlock(C, ar, __func__, UI_EMBOSS); size_t channel_index = 0; y= (float)ACHANNEL_FIRST; diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c index 460e46fce30..24b2dc9e41c 100644 --- a/source/blender/editors/space_graph/graph_edit.c +++ b/source/blender/editors/space_graph/graph_edit.c @@ -1046,6 +1046,8 @@ void GRAPH_OT_bake (wmOperatorType *ot) // todo: add props for start/end frames } +#ifdef WITH_AUDASPACE + /* ******************** Sound Bake F-Curve Operator *********************** */ /* This operator bakes the given sound to the selected F-Curves */ @@ -1078,7 +1080,6 @@ static float fcurve_samplingcb_sound (FCurve *UNUSED(fcu), void *data, float eva /* ------------------- */ -#ifdef WITH_AUDASPACE static int graphkeys_sound_bake_exec(bContext *C, wmOperator *op) { bAnimContext ac; diff --git a/source/blender/editors/space_graph/graph_ops.c b/source/blender/editors/space_graph/graph_ops.c index 90e99519600..aa245585d11 100644 --- a/source/blender/editors/space_graph/graph_ops.c +++ b/source/blender/editors/space_graph/graph_ops.c @@ -182,43 +182,11 @@ static void GRAPH_OT_cursor_set(wmOperatorType *ot) RNA_def_float(ot->srna, "value", 0, FLT_MIN, FLT_MAX, "Value", "", -100.0f, 100.0f); } -/* Toggle Handles ----------------------------------------------------------------- */ - -static int view_toggle_handles_exec (bContext *C, wmOperator *UNUSED(op)) -{ - SpaceIpo *sipo= CTX_wm_space_graph(C); - ARegion *ar= CTX_wm_region(C); - - if (sipo == NULL) - return OPERATOR_CANCELLED; - - /* toggle flag to hide handles */ - sipo->flag ^= SIPO_NOHANDLES; - - /* request refresh of keys area */ - ED_region_tag_redraw(ar); - - return OPERATOR_FINISHED; -} - -static void GRAPH_OT_view_togglehandles (wmOperatorType *ot) -{ - /* identification */ - ot->name= "Show/Hide All Handles"; - ot->idname= "GRAPH_OT_handles_view_toggle"; - ot->description= "Toggle whether handles are drawn on all keyframes that need them"; - - /* callbacks */ - ot->exec= view_toggle_handles_exec; - ot->poll= ED_operator_graphedit_active; -} - /* ************************** registration - operator types **********************************/ void graphedit_operatortypes(void) { /* view */ - WM_operatortype_append(GRAPH_OT_view_togglehandles); WM_operatortype_append(GRAPH_OT_cursor_set); WM_operatortype_append(GRAPH_OT_previewrange_set); @@ -290,7 +258,9 @@ static void graphedit_keymap_keyframes (wmKeyConfig *keyconf, wmKeyMap *keymap) wmKeyMapItem *kmi; /* view */ - WM_keymap_add_item(keymap, "GRAPH_OT_handles_view_toggle", HKEY, KM_PRESS, KM_CTRL, 0); + kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", HKEY, KM_PRESS, KM_CTRL, 0); + RNA_string_set(kmi->ptr, "data_path", "space_data.show_handles"); + /* NOTE: 'ACTIONMOUSE' not 'LEFTMOUSE', as user may have swapped mouse-buttons * This keymap is supposed to override ANIM_OT_change_frame, which does the same except it doesn't do y-values */ @@ -299,44 +269,66 @@ static void graphedit_keymap_keyframes (wmKeyConfig *keyconf, wmKeyMap *keymap) /* graph_select.c - selection tools */ /* click-select */ - WM_keymap_add_item(keymap, "GRAPH_OT_clickselect", SELECTMOUSE, KM_PRESS, 0, 0); + kmi = WM_keymap_add_item(keymap, "GRAPH_OT_clickselect", SELECTMOUSE, KM_PRESS, 0, 0); + RNA_boolean_set(kmi->ptr, "extend", FALSE); + RNA_boolean_set(kmi->ptr, "curves", FALSE); + RNA_boolean_set(kmi->ptr, "column", FALSE); kmi= WM_keymap_add_item(keymap, "GRAPH_OT_clickselect", SELECTMOUSE, KM_PRESS, KM_ALT, 0); - RNA_boolean_set(kmi->ptr, "column", 1); + RNA_boolean_set(kmi->ptr, "extend", FALSE); + RNA_boolean_set(kmi->ptr, "curves", FALSE); + RNA_boolean_set(kmi->ptr, "column", TRUE); kmi= WM_keymap_add_item(keymap, "GRAPH_OT_clickselect", SELECTMOUSE, KM_PRESS, KM_SHIFT, 0); - RNA_boolean_set(kmi->ptr, "extend", 1); + RNA_boolean_set(kmi->ptr, "extend", TRUE); + RNA_boolean_set(kmi->ptr, "curves", FALSE); + RNA_boolean_set(kmi->ptr, "column", FALSE); kmi= WM_keymap_add_item(keymap, "GRAPH_OT_clickselect", SELECTMOUSE, KM_PRESS, KM_ALT|KM_SHIFT, 0); - RNA_boolean_set(kmi->ptr, "extend", 1); - RNA_boolean_set(kmi->ptr, "column", 1); + RNA_boolean_set(kmi->ptr, "extend", TRUE); + RNA_boolean_set(kmi->ptr, "curves", FALSE); + RNA_boolean_set(kmi->ptr, "column", TRUE); kmi= WM_keymap_add_item(keymap, "GRAPH_OT_clickselect", SELECTMOUSE, KM_PRESS, KM_CTRL|KM_ALT, 0); - RNA_boolean_set(kmi->ptr, "curves", 1); + RNA_boolean_set(kmi->ptr, "extend", FALSE); + RNA_boolean_set(kmi->ptr, "curves", TRUE); + RNA_boolean_set(kmi->ptr, "column", FALSE); kmi= WM_keymap_add_item(keymap, "GRAPH_OT_clickselect", SELECTMOUSE, KM_PRESS, KM_CTRL|KM_ALT|KM_SHIFT, 0); - RNA_boolean_set(kmi->ptr, "curves", 1); - RNA_boolean_set(kmi->ptr, "extend", 1); + RNA_boolean_set(kmi->ptr, "extend", TRUE); + RNA_boolean_set(kmi->ptr, "curves", TRUE); + RNA_boolean_set(kmi->ptr, "column", FALSE); /* select left/right */ - WM_keymap_add_item(keymap, "GRAPH_OT_select_leftright", SELECTMOUSE, KM_PRESS, KM_CTRL, 0); + kmi = WM_keymap_add_item(keymap, "GRAPH_OT_select_leftright", SELECTMOUSE, KM_PRESS, KM_CTRL, 0); + RNA_boolean_set(kmi->ptr, "extend", FALSE); + RNA_enum_set(kmi->ptr, "mode", GRAPHKEYS_LRSEL_TEST); kmi= WM_keymap_add_item(keymap, "GRAPH_OT_select_leftright", SELECTMOUSE, KM_PRESS, KM_CTRL|KM_SHIFT, 0); - RNA_boolean_set(kmi->ptr, "extend", 1); + RNA_boolean_set(kmi->ptr, "extend", TRUE); + RNA_enum_set(kmi->ptr, "mode", GRAPHKEYS_LRSEL_TEST); kmi= WM_keymap_add_item(keymap, "GRAPH_OT_select_leftright", LEFTBRACKETKEY, KM_PRESS, 0, 0); + RNA_boolean_set(kmi->ptr, "extend", FALSE); RNA_enum_set(kmi->ptr, "mode", GRAPHKEYS_LRSEL_LEFT); kmi= WM_keymap_add_item(keymap, "GRAPH_OT_select_leftright", RIGHTBRACKETKEY, KM_PRESS, 0, 0); + RNA_boolean_set(kmi->ptr, "extend", FALSE); RNA_enum_set(kmi->ptr, "mode", GRAPHKEYS_LRSEL_RIGHT); /* deselect all */ - WM_keymap_add_item(keymap, "GRAPH_OT_select_all_toggle", AKEY, KM_PRESS, 0, 0); - RNA_boolean_set(WM_keymap_add_item(keymap, "GRAPH_OT_select_all_toggle", IKEY, KM_PRESS, KM_CTRL, 0)->ptr, "invert", 1); + kmi = WM_keymap_add_item(keymap, "GRAPH_OT_select_all_toggle", AKEY, KM_PRESS, 0, 0); + RNA_boolean_set(kmi->ptr, "invert", FALSE); + kmi = WM_keymap_add_item(keymap, "GRAPH_OT_select_all_toggle", IKEY, KM_PRESS, KM_CTRL, 0); + RNA_boolean_set(kmi->ptr, "invert", TRUE); /* borderselect */ - WM_keymap_add_item(keymap, "GRAPH_OT_select_border", BKEY, KM_PRESS, 0, 0); + kmi = WM_keymap_add_item(keymap, "GRAPH_OT_select_border", BKEY, KM_PRESS, 0, 0); + RNA_boolean_set(kmi->ptr, "axis_range", FALSE); + RNA_boolean_set(kmi->ptr, "include_handles", FALSE); kmi = WM_keymap_add_item(keymap, "GRAPH_OT_select_border", BKEY, KM_PRESS, KM_ALT, 0); - RNA_boolean_set(kmi->ptr, "axis_range", 1); + RNA_boolean_set(kmi->ptr, "axis_range", TRUE); + RNA_boolean_set(kmi->ptr, "include_handles", FALSE); kmi = WM_keymap_add_item(keymap, "GRAPH_OT_select_border", BKEY, KM_PRESS, KM_CTRL, 0); - RNA_boolean_set(kmi->ptr, "include_handles", 1); + RNA_boolean_set(kmi->ptr, "axis_range", FALSE); + RNA_boolean_set(kmi->ptr, "include_handles", TRUE); kmi = WM_keymap_add_item(keymap, "GRAPH_OT_select_border", BKEY, KM_PRESS, KM_CTRL|KM_ALT, 0); - RNA_boolean_set(kmi->ptr, "axis_range", 1); - RNA_boolean_set(kmi->ptr, "include_handles", 1); + RNA_boolean_set(kmi->ptr, "axis_range", TRUE); + RNA_boolean_set(kmi->ptr, "include_handles", TRUE); /* column select */ RNA_enum_set(WM_keymap_add_item(keymap, "GRAPH_OT_select_column", KKEY, KM_PRESS, 0, 0)->ptr, "mode", GRAPHKEYS_COLUMNSEL_KEYS); diff --git a/source/blender/editors/space_graph/graph_select.c b/source/blender/editors/space_graph/graph_select.c index c1268ec61f0..617dd172c05 100644 --- a/source/blender/editors/space_graph/graph_select.c +++ b/source/blender/editors/space_graph/graph_select.c @@ -201,7 +201,7 @@ static void borderselect_graphkeys (bAnimContext *ac, rcti rect, short mode, sho { ListBase anim_data = {NULL, NULL}; bAnimListElem *ale; - int filter; + int filter, mapping_flag; SpaceIpo *sipo= (SpaceIpo *)ac->sl; KeyframeEditData ked; @@ -226,8 +226,12 @@ static void borderselect_graphkeys (bAnimContext *ac, rcti rect, short mode, sho ked.data= &rectf; /* treat handles separately? */ - if (incl_handles) + if (incl_handles) { ked.iterflags |= KEYFRAME_ITER_INCL_HANDLES; + mapping_flag= 0; + } + else + mapping_flag= ANIM_UNITCONV_ONLYKEYS; /* loop over data, doing border select */ for (ale= anim_data.first; ale; ale= ale->next) { @@ -235,7 +239,7 @@ static void borderselect_graphkeys (bAnimContext *ac, rcti rect, short mode, sho FCurve *fcu= (FCurve *)ale->key_data; /* apply unit corrections */ - ANIM_unit_mapping_apply_fcurve(ac->scene, ale->id, ale->key_data, ANIM_UNITCONV_ONLYKEYS); + ANIM_unit_mapping_apply_fcurve(ac->scene, ale->id, ale->key_data, mapping_flag); /* apply NLA mapping to all the keyframes, since it's easier than trying to * guess when a callback might use something different @@ -274,7 +278,7 @@ static void borderselect_graphkeys (bAnimContext *ac, rcti rect, short mode, sho ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 1, incl_handles==0); /* unapply unit corrections */ - ANIM_unit_mapping_apply_fcurve(ac->scene, ale->id, ale->key_data, ANIM_UNITCONV_RESTORE|ANIM_UNITCONV_ONLYKEYS); + ANIM_unit_mapping_apply_fcurve(ac->scene, ale->id, ale->key_data, ANIM_UNITCONV_RESTORE|mapping_flag); } /* cleanup */ diff --git a/source/blender/editors/space_image/image_buttons.c b/source/blender/editors/space_image/image_buttons.c index 8d8c79386c5..43bea1c311d 100644 --- a/source/blender/editors/space_image/image_buttons.c +++ b/source/blender/editors/space_image/image_buttons.c @@ -335,7 +335,7 @@ static void image_panel_preview(ScrArea *sa, short cntrl) // IMAGE_HANDLER_PREVI return; } - block= uiBeginBlock(C, ar, "image_panel_preview", UI_EMBOSS); + block= uiBeginBlock(C, ar, __func__, UI_EMBOSS); uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | UI_PNL_SCALE | cntrl); uiSetPanelHandler(IMAGE_HANDLER_PREVIEW); // for close and esc @@ -682,7 +682,7 @@ void uiTemplateImage(uiLayout *layout, bContext *C, PointerRNA *ptr, const char uiButSetFunc(but, image_freecache_cb, ima, NULL); if(iuser->frames) - sprintf(str, "(%d) Frames:", iuser->framenr); + BLI_snprintf(str, sizeof(str), "(%d) Frames:", iuser->framenr); else strcpy(str, "Frames:"); uiBlockBeginAlign(block); uiDefButI(block, NUM, imagechanged, str, 10, 90,150, 20, &iuser->frames, 0.0, MAXFRAMEF, 0, 0, "Number of images of a movie to use"); @@ -763,7 +763,7 @@ void uiTemplateImage(uiLayout *layout, bContext *C, PointerRNA *ptr, const char col= uiLayoutColumn(split, 0); - sprintf(str, "(%d) Frames", iuser->framenr); + BLI_snprintf(str, sizeof(str), "(%d) Frames", iuser->framenr); uiItemR(col, userptr, "frame_duration", 0, str, ICON_NONE); if(ima->anim) { block= uiLayoutGetBlock(col); diff --git a/source/blender/editors/space_image/image_draw.c b/source/blender/editors/space_image/image_draw.c index dc712e286a1..41fc861f8e4 100644 --- a/source/blender/editors/space_image/image_draw.c +++ b/source/blender/editors/space_image/image_draw.c @@ -110,7 +110,8 @@ static void draw_render_info(Scene *scene, Image *ima, ARegion *ar) BKE_image_release_renderresult(scene, ima); } -void draw_image_info(ARegion *ar, int color_manage, int channels, int x, int y, const char cp[4], const float fp[4], int *zp, float *zpf) +/* used by node view too */ +void ED_image_draw_info(ARegion *ar, int color_manage, int channels, int x, int y, const char cp[4], const float fp[4], int *zp, float *zpf) { char str[256]; float dx= 6; @@ -139,7 +140,7 @@ void draw_image_info(ARegion *ar, int color_manage, int channels, int x, int y, BLF_size(blf_mono_font, 11, 72); glColor3ub(255, 255, 255); - sprintf(str, "X:%-4d Y:%-4d |", x, y); + BLI_snprintf(str, sizeof(str), "X:%-4d Y:%-4d |", x, y); // UI_DrawString(6, 6, str); // works ok but fixed width is nicer. BLF_position(blf_mono_font, dx, 6, 0); BLF_draw_ascii(blf_mono_font, str, sizeof(str)); @@ -147,14 +148,14 @@ void draw_image_info(ARegion *ar, int color_manage, int channels, int x, int y, if(zp) { glColor3ub(255, 255, 255); - sprintf(str, " Z:%-.4f |", 0.5f+0.5f*(((float)*zp)/(float)0x7fffffff)); + BLI_snprintf(str, sizeof(str), " Z:%-.4f |", 0.5f+0.5f*(((float)*zp)/(float)0x7fffffff)); BLF_position(blf_mono_font, dx, 6, 0); BLF_draw_ascii(blf_mono_font, str, sizeof(str)); dx += BLF_width(blf_mono_font, str); } if(zpf) { glColor3ub(255, 255, 255); - sprintf(str, " Z:%-.3f |", *zpf); + BLI_snprintf(str, sizeof(str), " Z:%-.3f |", *zpf); BLF_position(blf_mono_font, dx, 6, 0); BLF_draw_ascii(blf_mono_font, str, sizeof(str)); dx += BLF_width(blf_mono_font, str); @@ -163,33 +164,33 @@ void draw_image_info(ARegion *ar, int color_manage, int channels, int x, int y, if(channels >= 3) { glColor3ubv(red); if (fp) - sprintf(str, " R:%-.4f", fp[0]); + BLI_snprintf(str, sizeof(str), " R:%-.4f", fp[0]); else if (cp) - sprintf(str, " R:%-3d", cp[0]); + BLI_snprintf(str, sizeof(str), " R:%-3d", cp[0]); else - sprintf(str, " R:-"); + BLI_snprintf(str, sizeof(str), " R:-"); BLF_position(blf_mono_font, dx, 6, 0); BLF_draw_ascii(blf_mono_font, str, sizeof(str)); dx += BLF_width(blf_mono_font, str); glColor3ubv(green); if (fp) - sprintf(str, " G:%-.4f", fp[1]); + BLI_snprintf(str, sizeof(str), " G:%-.4f", fp[1]); else if (cp) - sprintf(str, " G:%-3d", cp[1]); + BLI_snprintf(str, sizeof(str), " G:%-3d", cp[1]); else - sprintf(str, " G:-"); + BLI_snprintf(str, sizeof(str), " G:-"); BLF_position(blf_mono_font, dx, 6, 0); BLF_draw_ascii(blf_mono_font, str, sizeof(str)); dx += BLF_width(blf_mono_font, str); glColor3ubv(blue); if (fp) - sprintf(str, " B:%-.4f", fp[2]); + BLI_snprintf(str, sizeof(str), " B:%-.4f", fp[2]); else if (cp) - sprintf(str, " B:%-3d", cp[2]); + BLI_snprintf(str, sizeof(str), " B:%-3d", cp[2]); else - sprintf(str, " B:-"); + BLI_snprintf(str, sizeof(str), " B:-"); BLF_position(blf_mono_font, dx, 6, 0); BLF_draw_ascii(blf_mono_font, str, sizeof(str)); dx += BLF_width(blf_mono_font, str); @@ -197,11 +198,11 @@ void draw_image_info(ARegion *ar, int color_manage, int channels, int x, int y, if(channels == 4) { glColor3ub(255, 255, 255); if (fp) - sprintf(str, " A:%-.4f", fp[3]); + BLI_snprintf(str, sizeof(str), " A:%-.4f", fp[3]); else if (cp) - sprintf(str, " A:%-3d", cp[3]); + BLI_snprintf(str, sizeof(str), " A:%-3d", cp[3]); else - sprintf(str, "- "); + BLI_snprintf(str, sizeof(str), "- "); BLF_position(blf_mono_font, dx, 6, 0); BLF_draw_ascii(blf_mono_font, str, sizeof(str)); dx += BLF_width(blf_mono_font, str); @@ -269,12 +270,12 @@ void draw_image_info(ARegion *ar, int color_manage, int channels, int x, int y, rgb_to_yuv((float)cp[0]/255.0f, (float)cp[0]/255.0f, (float)cp[0]/255.0f, &lum, &u, &v); } - sprintf(str, "V:%-.4f", val); + BLI_snprintf(str, sizeof(str), "V:%-.4f", val); BLF_position(blf_mono_font, dx, 6, 0); BLF_draw_ascii(blf_mono_font, str, sizeof(str)); dx += BLF_width(blf_mono_font, str); - sprintf(str, " L:%-.4f", lum); + BLI_snprintf(str, sizeof(str), " L:%-.4f", lum); BLF_position(blf_mono_font, dx, 6, 0); BLF_draw_ascii(blf_mono_font, str, sizeof(str)); dx += BLF_width(blf_mono_font, str); @@ -289,22 +290,22 @@ void draw_image_info(ARegion *ar, int color_manage, int channels, int x, int y, rgb_to_yuv((float)cp[0]/255.0f, (float)cp[1]/255.0f, (float)cp[2]/255.0f, &lum, &u, &v); } - sprintf(str, "H:%-.4f", hue); + BLI_snprintf(str, sizeof(str), "H:%-.4f", hue); BLF_position(blf_mono_font, dx, 6, 0); BLF_draw_ascii(blf_mono_font, str, sizeof(str)); dx += BLF_width(blf_mono_font, str); - sprintf(str, " S:%-.4f", sat); + BLI_snprintf(str, sizeof(str), " S:%-.4f", sat); BLF_position(blf_mono_font, dx, 6, 0); BLF_draw_ascii(blf_mono_font, str, sizeof(str)); dx += BLF_width(blf_mono_font, str); - sprintf(str, " V:%-.4f", val); + BLI_snprintf(str, sizeof(str), " V:%-.4f", val); BLF_position(blf_mono_font, dx, 6, 0); BLF_draw_ascii(blf_mono_font, str, sizeof(str)); dx += BLF_width(blf_mono_font, str); - sprintf(str, " L:%-.4f", lum); + BLI_snprintf(str, sizeof(str), " L:%-.4f", lum); BLF_position(blf_mono_font, dx, 6, 0); BLF_draw_ascii(blf_mono_font, str, sizeof(str)); dx += BLF_width(blf_mono_font, str); @@ -378,14 +379,14 @@ static void sima_draw_alpha_backdrop(float x1, float y1, float xsize, float ysiz { GLubyte checker_stipple[32*32/8] = { - 255,255,0,0,255,255,0,0,255,255,0,0,255,255,0,0, \ - 255,255,0,0,255,255,0,0,255,255,0,0,255,255,0,0, \ - 255,255,0,0,255,255,0,0,255,255,0,0,255,255,0,0, \ - 255,255,0,0,255,255,0,0,255,255,0,0,255,255,0,0, \ - 0,0,255,255,0,0,255,255,0,0,255,255,0,0,255,255, \ - 0,0,255,255,0,0,255,255,0,0,255,255,0,0,255,255, \ - 0,0,255,255,0,0,255,255,0,0,255,255,0,0,255,255, \ - 0,0,255,255,0,0,255,255,0,0,255,255,0,0,255,255, \ + 255,255,0,0,255,255,0,0,255,255,0,0,255,255,0,0, + 255,255,0,0,255,255,0,0,255,255,0,0,255,255,0,0, + 255,255,0,0,255,255,0,0,255,255,0,0,255,255,0,0, + 255,255,0,0,255,255,0,0,255,255,0,0,255,255,0,0, + 0,0,255,255,0,0,255,255,0,0,255,255,0,0,255,255, + 0,0,255,255,0,0,255,255,0,0,255,255,0,0,255,255, + 0,0,255,255,0,0,255,255,0,0,255,255,0,0,255,255, + 0,0,255,255,0,0,255,255,0,0,255,255,0,0,255,255, }; glColor3ubv(col1); diff --git a/source/blender/editors/space_image/image_intern.h b/source/blender/editors/space_image/image_intern.h index 04156c80c0e..29673f74538 100644 --- a/source/blender/editors/space_image/image_intern.h +++ b/source/blender/editors/space_image/image_intern.h @@ -55,7 +55,6 @@ 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 color_manage, int channels, int x, int y, const char cp[4], const float fp[4], int *zp, float *zpf); void draw_image_grease_pencil(struct bContext *C, short onlyv2d); /* image_ops.c */ diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 0efc89e802a..06674513868 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -817,7 +817,7 @@ static int image_open_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event) if(ima) path= ima->name; - if(RNA_property_is_set(op->ptr, "filepath")) + if(RNA_struct_property_is_set(op->ptr, "filepath")) return image_open_exec(C, op); image_open_init(C, op); @@ -876,10 +876,10 @@ static int image_replace_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(eve if(!sima->image) return OPERATOR_CANCELLED; - if(RNA_property_is_set(op->ptr, "filepath")) + if(RNA_struct_property_is_set(op->ptr, "filepath")) return image_replace_exec(C, op); - if(!RNA_property_is_set(op->ptr, "relative_path")) + if(!RNA_struct_property_is_set(op->ptr, "relative_path")) RNA_boolean_set(op->ptr, "relative_path", (strncmp(sima->image->name, "//", 2))==0); image_filesel(C, op, sima->image->name); @@ -1011,7 +1011,7 @@ static void save_image_options_from_op(SaveImageOptions *simopts, wmOperator *op simopts->im_format= *(ImageFormatData *)op->customdata; } - if (RNA_property_is_set(op->ptr, "filepath")) { + if (RNA_struct_property_is_set(op->ptr, "filepath")) { RNA_string_get(op->ptr, "filepath", simopts->filepath); BLI_path_abs(simopts->filepath, G.main->name); } @@ -1176,7 +1176,7 @@ static int image_save_as_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(eve Scene *scene= CTX_data_scene(C); SaveImageOptions simopts; - if(RNA_property_is_set(op->ptr, "filepath")) + if(RNA_struct_property_is_set(op->ptr, "filepath")) return image_save_as_exec(C, op); if (save_image_options_init(&simopts, sima, scene, TRUE) == 0) @@ -1184,7 +1184,7 @@ static int image_save_as_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(eve save_image_options_to_op(&simopts, op); /* enable save_copy by default for render results */ - if(ELEM(ima->type, IMA_TYPE_R_RESULT, IMA_TYPE_COMPOSITE) && !RNA_property_is_set(op->ptr, "copy")) { + if(ELEM(ima->type, IMA_TYPE_R_RESULT, IMA_TYPE_COMPOSITE) && !RNA_struct_property_is_set(op->ptr, "copy")) { RNA_boolean_set(op->ptr, "copy", TRUE); } @@ -1676,7 +1676,7 @@ static int image_unpack_exec(bContext *C, wmOperator *op) int method= RNA_enum_get(op->ptr, "method"); /* find the suppplied image by name */ - if (RNA_property_is_set(op->ptr, "id")) { + if (RNA_struct_property_is_set(op->ptr, "id")) { char imaname[MAX_ID_NAME-2]; RNA_string_get(op->ptr, "id", imaname); ima = BLI_findstring(&CTX_data_main(C)->image, imaname, offsetof(ID, name) + 2); @@ -1708,7 +1708,7 @@ static int image_unpack_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(even { Image *ima= CTX_data_edit_image(C); - if(RNA_property_is_set(op->ptr, "id")) + if(RNA_struct_property_is_set(op->ptr, "id")) return image_unpack_exec(C, op); if(!ima || !ima->packedfile) @@ -1772,7 +1772,7 @@ static void image_sample_draw(const bContext *UNUSED(C), ARegion *ar, void *arg_ ImageSampleInfo *info= arg_info; if(info->draw) { /* no color management needed for images (color_manage=0) */ - draw_image_info(ar, 0, info->channels, info->x, info->y, info->colp, info->colfp, info->zp, info->zfp); + ED_image_draw_info(ar, 0, info->channels, info->x, info->y, info->colp, info->colfp, info->zp, info->zfp); } } @@ -2016,14 +2016,14 @@ static int image_sample_line_exec(bContext *C, wmOperator *op) hist->data_r[i] = rgb[0]; hist->data_g[i] = rgb[1]; hist->data_b[i] = rgb[2]; - hist->data_luma[i] = (0.299f*rgb[0] + 0.587f*rgb[1] + 0.114f*rgb[2]); + hist->data_luma[i] = rgb_to_luma(rgb); } else if (ibuf->rect) { cp= (unsigned char *)(ibuf->rect + y*ibuf->x + x); hist->data_r[i] = (float)cp[0]/255.0f; hist->data_g[i] = (float)cp[1]/255.0f; hist->data_b[i] = (float)cp[2]/255.0f; - hist->data_luma[i] = (0.299f*cp[0] + 0.587f*cp[1] + 0.114f*cp[2])/255; + hist->data_luma[i] = (float)rgb_to_luma_byte(cp)/255.0f; } } } diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c index 99c190cd2dd..4421ad8e4f9 100644 --- a/source/blender/editors/space_image/space_image.c +++ b/source/blender/editors/space_image/space_image.c @@ -594,8 +594,13 @@ static void image_refresh(const bContext *C, ScrArea *UNUSED(sa)) /* new shading system, get image from material */ EditFace *efa= EM_get_actFace(em, sloppy); - if(efa) - ED_object_get_active_image(obedit, efa->mat_nr, &sima->image, NULL, NULL); + if(efa) { + Image *node_ima; + ED_object_get_active_image(obedit, efa->mat_nr, &node_ima, NULL, NULL); + + if(node_ima) + sima->image= node_ima; + } } else { /* old shading system, we set texface */ diff --git a/source/blender/editors/space_info/info_ops.c b/source/blender/editors/space_info/info_ops.c index deff1c77912..2090b4eae0a 100644 --- a/source/blender/editors/space_info/info_ops.c +++ b/source/blender/editors/space_info/info_ops.c @@ -143,7 +143,7 @@ static int unpack_all_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event) Main *bmain= CTX_data_main(C); uiPopupMenu *pup; uiLayout *layout; - char title[128]; + char title[64]; int count = 0; count = countPackedFiles(bmain); @@ -155,9 +155,9 @@ static int unpack_all_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event) } if(count == 1) - sprintf(title, "Unpack 1 file"); + strcpy(title, "Unpack 1 file"); else - sprintf(title, "Unpack %d files", count); + BLI_snprintf(title, sizeof(title), "Unpack %d files", count); pup= uiPupMenuBegin(C, title, ICON_NONE); layout= uiPupMenuLayout(pup); diff --git a/source/blender/editors/space_logic/logic_ops.c b/source/blender/editors/space_logic/logic_ops.c index ce6b7d2e910..0dfcafcf549 100644 --- a/source/blender/editors/space_logic/logic_ops.c +++ b/source/blender/editors/space_logic/logic_ops.c @@ -88,15 +88,15 @@ static int edit_actuator_poll(bContext *C) static void edit_sensor_properties(wmOperatorType *ot) { - RNA_def_string(ot->srna, "sensor", "", 32, "Sensor", "Name of the sensor to edit"); - RNA_def_string(ot->srna, "object", "", 32, "Object", "Name of the object the sensor belongs to"); + RNA_def_string(ot->srna, "sensor", "", MAX_NAME, "Sensor", "Name of the sensor to edit"); + RNA_def_string(ot->srna, "object", "", MAX_NAME, "Object", "Name of the object the sensor belongs to"); } static int edit_sensor_invoke_properties(bContext *C, wmOperator *op) { PointerRNA ptr= CTX_data_pointer_get_type(C, "sensor", &RNA_Sensor); - if (RNA_property_is_set(op->ptr, "sensor") && RNA_property_is_set(op->ptr, "object") ) + if (RNA_struct_property_is_set(op->ptr, "sensor") && RNA_struct_property_is_set(op->ptr, "object") ) return 1; if (ptr.data) { @@ -113,14 +113,14 @@ static int edit_sensor_invoke_properties(bContext *C, wmOperator *op) static Object *edit_object_property_get(bContext *C, wmOperator *op) { - char ob_name[32]; + char ob_name[MAX_NAME]; Object *ob; RNA_string_get(op->ptr, "object", ob_name); /* if ob_name is valid try to find the object with this name otherwise gets the active object */ - if (BLI_strnlen(ob_name, 32) > 0) + if (BLI_strnlen(ob_name, MAX_NAME) > 0) ob = BLI_findstring(&(CTX_data_main(C)->object), ob_name, offsetof(ID, name) + 2); else ob= ED_object_active_context(C); @@ -130,7 +130,7 @@ static Object *edit_object_property_get(bContext *C, wmOperator *op) static bSensor *edit_sensor_property_get(bContext *C, wmOperator *op, Object **ob) { - char sensor_name[32]; + char sensor_name[MAX_NAME]; bSensor *sens; RNA_string_get(op->ptr, "sensor", sensor_name); @@ -144,15 +144,15 @@ static bSensor *edit_sensor_property_get(bContext *C, wmOperator *op, Object **o static void edit_controller_properties(wmOperatorType *ot) { - RNA_def_string(ot->srna, "controller", "", 32, "Controller", "Name of the controller to edit"); - RNA_def_string(ot->srna, "object", "", 32, "Object", "Name of the object the controller belongs to"); + RNA_def_string(ot->srna, "controller", "", MAX_NAME, "Controller", "Name of the controller to edit"); + RNA_def_string(ot->srna, "object", "", MAX_NAME, "Object", "Name of the object the controller belongs to"); } static int edit_controller_invoke_properties(bContext *C, wmOperator *op) { PointerRNA ptr= CTX_data_pointer_get_type(C, "controller", &RNA_Controller); - if (RNA_property_is_set(op->ptr, "controller") && RNA_property_is_set(op->ptr, "object") ) + if (RNA_struct_property_is_set(op->ptr, "controller") && RNA_struct_property_is_set(op->ptr, "object") ) return 1; if (ptr.data) { @@ -169,7 +169,7 @@ static int edit_controller_invoke_properties(bContext *C, wmOperator *op) static bController *edit_controller_property_get(bContext *C, wmOperator *op, Object **ob) { - char controller_name[32]; + char controller_name[MAX_NAME]; bController *cont; RNA_string_get(op->ptr, "controller", controller_name); @@ -183,15 +183,15 @@ static bController *edit_controller_property_get(bContext *C, wmOperator *op, Ob static void edit_actuator_properties(wmOperatorType *ot) { - RNA_def_string(ot->srna, "actuator", "", 32, "Actuator", "Name of the actuator to edit"); - RNA_def_string(ot->srna, "object", "", 32, "Object", "Name of the object the actuator belongs to"); + RNA_def_string(ot->srna, "actuator", "", MAX_NAME, "Actuator", "Name of the actuator to edit"); + RNA_def_string(ot->srna, "object", "", MAX_NAME, "Object", "Name of the object the actuator belongs to"); } static int edit_actuator_invoke_properties(bContext *C, wmOperator *op) { PointerRNA ptr= CTX_data_pointer_get_type(C, "actuator", &RNA_Actuator); - if (RNA_property_is_set(op->ptr, "actuator") && RNA_property_is_set(op->ptr, "object") ) + if (RNA_struct_property_is_set(op->ptr, "actuator") && RNA_struct_property_is_set(op->ptr, "object") ) return 1; if (ptr.data) { @@ -208,7 +208,7 @@ static int edit_actuator_invoke_properties(bContext *C, wmOperator *op) static bActuator *edit_actuator_property_get(bContext *C, wmOperator *op, Object **ob) { - char actuator_name[32]; + char actuator_name[MAX_NAME]; bActuator *act; RNA_string_get(op->ptr, "actuator", actuator_name); @@ -278,7 +278,7 @@ static int sensor_add_exec(bContext *C, wmOperator *op) PointerRNA sens_ptr; PropertyRNA *prop; const char *sens_name; - char name[32]; + char name[MAX_NAME]; int type= RNA_enum_get(op->ptr, "type"); ob= edit_object_property_get(C, op); @@ -293,7 +293,7 @@ static int sensor_add_exec(bContext *C, wmOperator *op) prop = RNA_struct_find_property(&sens_ptr, "type"); RNA_string_get(op->ptr, "name", name); - if(BLI_strnlen(name, 32) < 1){ + if(BLI_strnlen(name, MAX_NAME) < 1){ RNA_property_enum_name(C, &sens_ptr, prop, RNA_property_enum_get(&sens_ptr, prop), &sens_name); BLI_strncpy(sens->name, sens_name, sizeof(sens->name)); } @@ -328,8 +328,8 @@ static void LOGIC_OT_sensor_add(wmOperatorType *ot) /* properties */ ot->prop= prop= RNA_def_enum(ot->srna, "type", DummyRNA_NULL_items, SENS_ALWAYS, "Type", "Type of sensor to add"); RNA_def_enum_funcs(prop, rna_Sensor_type_itemf); - RNA_def_string(ot->srna, "name", "", 32, "Name", "Name of the Sensor to add"); - RNA_def_string(ot->srna, "object", "", 32, "Object", "Name of the Object to add the Sensor to"); + RNA_def_string(ot->srna, "name", "", MAX_NAME, "Name", "Name of the Sensor to add"); + RNA_def_string(ot->srna, "object", "", MAX_NAME, "Object", "Name of the Object to add the Sensor to"); } /* ************* Add/Remove Controller Operator ************* */ @@ -382,7 +382,7 @@ static int controller_add_exec(bContext *C, wmOperator *op) PropertyRNA *prop; const char *cont_name; int bit; - char name[32]; + char name[MAX_NAME]; int type= RNA_enum_get(op->ptr, "type"); ob= edit_object_property_get(C, op); @@ -397,7 +397,7 @@ static int controller_add_exec(bContext *C, wmOperator *op) prop = RNA_struct_find_property(&cont_ptr, "type"); RNA_string_get(op->ptr, "name", name); - if(BLI_strnlen(name, 32) < 1){ + if(BLI_strnlen(name, MAX_NAME) < 1){ RNA_property_enum_name(C, &cont_ptr, prop, RNA_property_enum_get(&cont_ptr, prop), &cont_name); BLI_strncpy(cont->name, cont_name, sizeof(cont->name)); } @@ -442,8 +442,8 @@ static void LOGIC_OT_controller_add(wmOperatorType *ot) /* properties */ ot->prop= RNA_def_enum(ot->srna, "type", controller_type_items, CONT_LOGIC_AND, "Type", "Type of controller to add"); - RNA_def_string(ot->srna, "name", "", 32, "Name", "Name of the Controller to add"); - RNA_def_string(ot->srna, "object", "", 32, "Object", "Name of the Object to add the Controller to"); + RNA_def_string(ot->srna, "name", "", MAX_NAME, "Name", "Name of the Controller to add"); + RNA_def_string(ot->srna, "object", "", MAX_NAME, "Object", "Name of the Object to add the Controller to"); } /* ************* Add/Remove Actuator Operator ************* */ @@ -495,7 +495,7 @@ static int actuator_add_exec(bContext *C, wmOperator *op) PointerRNA act_ptr; PropertyRNA *prop; const char *act_name; - char name[32]; + char name[MAX_NAME]; int type= RNA_enum_get(op->ptr, "type"); ob= edit_object_property_get(C, op); @@ -510,7 +510,7 @@ static int actuator_add_exec(bContext *C, wmOperator *op) prop = RNA_struct_find_property(&act_ptr, "type"); RNA_string_get(op->ptr, "name", name); - if (BLI_strnlen(name, 32) < 1){ + if (BLI_strnlen(name, MAX_NAME) < 1){ RNA_property_enum_name(C, &act_ptr, prop, RNA_property_enum_get(&act_ptr, prop), &act_name); BLI_strncpy(act->name, act_name, sizeof(act->name)); } @@ -545,8 +545,8 @@ static void LOGIC_OT_actuator_add(wmOperatorType *ot) /* properties */ ot->prop= prop= RNA_def_enum(ot->srna, "type", DummyRNA_NULL_items, CONT_LOGIC_AND, "Type", "Type of actuator to add"); RNA_def_enum_funcs(prop, rna_Actuator_type_itemf); - RNA_def_string(ot->srna, "name", "", 32, "Name", "Name of the Actuator to add"); - RNA_def_string(ot->srna, "object", "", 32, "Object", "Name of the Object to add the Actuator to"); + RNA_def_string(ot->srna, "name", "", MAX_NAME, "Name", "Name of the Actuator to add"); + RNA_def_string(ot->srna, "object", "", MAX_NAME, "Object", "Name of the Object to add the Actuator to"); } /* ************* Move Logic Bricks Operator ************* */ diff --git a/source/blender/editors/space_logic/logic_window.c b/source/blender/editors/space_logic/logic_window.c index e5255448ae9..2c1e7a0c546 100644 --- a/source/blender/editors/space_logic/logic_window.c +++ b/source/blender/editors/space_logic/logic_window.c @@ -1187,7 +1187,7 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short ts= sens->data; - /* uiDefBut(block, TEX, 1, "Property:", xco,yco-22,width, 19, &ts->name, 0, 31, 0, 0, "Only look for Objects with this property"); */ + /* uiDefBut(block, TEX, 1, "Property:", xco,yco-22,width, 19, &ts->name, 0, MAX_NAME, 0, 0, "Only look for Objects with this property"); */ uiDefIDPoinBut(block, test_matpoin_but, ID_MA, 1, "MA:",(short)(xco + 10),(short)(yco-44), (short)(width - 20), 19, &ts->ma, "Only look for floors with this Material"); ///* uiDefButF(block, NUM, 1, "Margin:", xco+width/2,yco-44,width/2, 19, &ts->dist, 0.0, 10.0, 100, 0, "Extra margin (distance) for larger sensitivity"); yco-= ysize; @@ -1216,11 +1216,11 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short if (cs->mode & SENS_COLLISION_MATERIAL) { uiDefBut(block, TEX, 1, "Material:", (short)(xco + 10 + 0.40 * (width-20)), - (short)(yco-44), (short)(0.6*(width-20)), 19, &cs->materialName, 0, 31, 0, 0, + (short)(yco-44), (short)(0.6*(width-20)), 19, &cs->materialName, 0, MAX_NAME, 0, 0, "Only look for Objects with this material"); } else { uiDefBut(block, TEX, 1, "Property:", (short)(xco + 10 + 0.40 * (width-20)), (short)(yco-44), - (short)(0.6*(width-20)), 19, &cs->name, 0, 31, 0, 0, + (short)(0.6*(width-20)), 19, &cs->name, 0, MAX_NAME, 0, 0, "Only look for Objects with this property"); } @@ -1240,7 +1240,7 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short ns= sens->data; uiDefBut(block, TEX, 1, "Property:",(short)(10+xco),(short)(yco-44), (short)(width-20), 19, - &ns->name, 0, 31, 0, 0, "Only look for Objects with this property"); + &ns->name, 0, MAX_NAME, 0, 0, "Only look for Objects with this property"); uiDefButF(block, NUM, 1, "Dist",(short)(10+xco),(short)(yco-68),(short)((width-22)/2), 19, &ns->dist, 0.0, 1000.0, 1000, 0, "Trigger distance"); uiDefButF(block, NUM, 1, "Reset",(short)(10+xco+(width-22)/2), (short)(yco-68), (short)((width-22)/2), 19, @@ -1261,7 +1261,7 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short uiDefBut(block, TEX, 1, "Prop:", (short)(10+xco),(short)(yco-44), (short)(0.7 * (width-20)), 19, - &rs->name, 0, 31, 0, 0, + &rs->name, 0, MAX_NAME, 0, 0, "Only look for Objects with this property"); str = "Type %t|+X axis %x0|+Y axis %x1|+Z axis %x2|-X axis %x3|-Y axis %x4|-Z axis %x5"; @@ -1316,14 +1316,14 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short /* line 4: toggle property for string logging mode */ uiDefBut(block, TEX, 1, "LogToggle: ", xco+10, yco-((ks->type&1) ? 68:92), (width-20), 19, - ks->toggleName, 0, 31, 0, 0, + ks->toggleName, 0, MAX_NAME, 0, 0, "Property that indicates whether to log " "keystrokes as a string"); /* line 5: target property for string logging mode */ uiDefBut(block, TEX, 1, "Target: ", xco+10, yco-((ks->type&1) ? 92:116), (width-20), 19, - ks->targetName, 0, 31, 0, 0, + ks->targetName, 0, MAX_NAME, 0, 0, "Property that receives the keystrokes in case " "a string is logged"); @@ -1349,21 +1349,21 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short if (ps->type != SENS_PROP_EXPRESSION) { uiDefBut(block, TEX, 1, "Prop: ", xco+30,yco-68,width-60, 19, - ps->name, 0, 31, 0, 0, "Property name"); + ps->name, 0, MAX_NAME, 0, 0, "Property name"); } if(ps->type == SENS_PROP_INTERVAL) { uiDefBut(block, TEX, 1, "Min: ", xco,yco-92,width/2, 19, - ps->value, 0, 31, 0, 0, "check for min value"); + ps->value, 0, MAX_NAME, 0, 0, "check for min value"); uiDefBut(block, TEX, 1, "Max: ", xco+width/2,yco-92,width/2, 19, - ps->maxvalue, 0, 31, 0, 0, "check for max value"); + ps->maxvalue, 0, MAX_NAME, 0, 0, "check for max value"); } else if(ps->type == SENS_PROP_CHANGED); else { uiDefBut(block, TEX, 1, "Value: ", xco+30,yco-92,width-60, 19, - ps->value, 0, 31, 0, 0, "check for value"); + ps->value, 0, MAX_NAME, 0, 0, "check for value"); } yco-= ysize; @@ -1384,12 +1384,12 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short uiBlockBeginAlign(block); but = uiDefBut(block, TEX, 1, "Bone: ", (xco+10), (yco-44), (width-20)/2, 19, - arm->posechannel, 0, 31, 0, 0, + arm->posechannel, 0, MAX_NAME, 0, 0, "Bone on which you want to check a constraint"); uiButSetFunc(but, check_armature_sensor, but, arm); but = uiDefBut(block, TEX, 1, "Cons: ", (xco+10)+(width-20)/2, (yco-44), (width-20)/2, 19, - arm->constraint, 0, 31, 0, 0, + arm->constraint, 0, MAX_NAME, 0, 0, "Name of the constraint you want to control"); uiButSetFunc(but, check_armature_sensor, but, arm); uiBlockEndAlign(block); @@ -1420,7 +1420,7 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short as= sens->data; uiDefBut(block, TEX, 1, "Act: ", xco+30,yco-44,width-60, 19, - as->name, 0, 31, 0, 0, "Actuator name, actuator active state modifications will be detected"); + as->name, 0, MAX_NAME, 0, 0, "Actuator name, actuator active state modifications will be detected"); yco-= ysize; break; } @@ -1513,13 +1513,13 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short if (raySens->mode & SENS_COLLISION_MATERIAL) { uiDefBut(block, TEX, 1, "Material:", xco + 10 + 0.20 * (width-20), yco-44, 0.8*(width-20), 19, - &raySens->matname, 0, 31, 0, 0, + &raySens->matname, 0, MAX_NAME, 0, 0, "Only look for Objects with this material"); } else { uiDefBut(block, TEX, 1, "Property:", xco + 10 + 0.20 * (width-20), yco-44, 0.8*(width-20), 19, - &raySens->propname, 0, 31, 0, 0, + &raySens->propname, 0, MAX_NAME, 0, 0, "Only look for Objects with this property"); } @@ -1557,7 +1557,7 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short /* line 2: Subject filter */ uiDefBut(block, TEX, 1, "Subject: ", (xco+10), (yco-44), (width-20), 19, - mes->subject, 0, 31, 0, 0, + mes->subject, 0, MAX_NAME, 0, 0, "Optional subject filter: only accept messages with this subject" ", or empty for all"); @@ -1683,7 +1683,7 @@ static short draw_controllerbuttons(bController *cont, uiBlock *block, short xco ec= cont->data; /* uiDefBut(block, BUT, 1, "Variables", xco,yco-24,80, 19, NULL, 0, 0, 0, 0, "Available variables for expression"); */ uiDefBut(block, TEX, 1, "Exp:", xco + 10 , yco-21, width-20, 19, - ec->str, 0, 127, 0, 0, + ec->str, 0, sizeof(ec->str), 0, 0, "Expression"); yco-= ysize; @@ -1704,7 +1704,7 @@ static short draw_controllerbuttons(bController *cont, uiBlock *block, short xco if(pc->mode==0) uiDefIDPoinBut(block, test_scriptpoin_but, ID_TXT, 1, "", xco+70,yco-23,width-74, 19, &pc->text, "Blender textblock to run as a script"); else { - uiDefBut(block, TEX, 1, "", xco+70,yco-23,(width-70)-25, 19, pc->module, 0, 63, 0, 0, "Module name and function to run e.g. \"someModule.main\". Internal texts and external python files can be used"); + uiDefBut(block, TEX, 1, "", xco+70,yco-23,(width-70)-25, 19, pc->module, 0, sizeof(pc->module), 0, 0, "Module name and function to run e.g. \"someModule.main\". Internal texts and external python files can be used"); uiDefButBitI(block, TOG, CONT_PY_DEBUG, B_REDR, "D", (xco+width)-25, yco-23, 19, 19, &pc->flag, 0, 0, 0, 0, "Continuously reload the module from disk for editing external modules without restarting"); } uiBlockEndAlign(block); @@ -2032,7 +2032,7 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo if(aa->type == ACT_ACTION_FROM_PROP) { - uiDefBut(block, TEX, 0, "Prop: ",xco+10, yco-44, width-20, 19, aa->name, 0.0, 31.0, 0, 0, "Use this property to define the Action position"); + uiDefBut(block, TEX, 0, "Prop: ",xco+10, yco-44, width-20, 19, aa->name, 0.0, MAX_NAME, 0, 0, "Use this property to define the Action position"); } else { @@ -2043,7 +2043,7 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo uiDefButS(block, NUM, 0, "Blendin: ", xco+10, yco-64, (width-20)/2, 19, &aa->blendin, 0.0, 32767, 0.0, 0.0, "Number of frames of motion blending"); uiDefButS(block, NUM, 0, "Priority: ", xco+10+(width-20)/2, yco-64, (width-20)/2, 19, &aa->priority, 0.0, 100.0, 0.0, 0.0, "Execution priority - lower numbers will override actions with higher numbers, With 2 or more actions at once, the overriding channels must be lower in the stack"); - uiDefBut(block, TEX, 0, "FrameProp: ",xco+10, yco-84, width-20, 19, aa->frameProp, 0.0, 31.0, 0, 0, "Assign the action's current frame number to this property"); + uiDefBut(block, TEX, 0, "FrameProp: ",xco+10, yco-84, width-20, 19, aa->frameProp, 0.0, MAX_NAME, 0, 0, "Assign the action's current frame number to this property"); #ifdef __NLA_ACTION_BY_MOTION_ACTUATOR @@ -2094,7 +2094,7 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo if(ia->type==ACT_IPO_FROM_PROP) { uiDefBut(block, TEX, 0, "Prop: ", xco+10, yco-44, width-80, 19, - ia->name, 0.0, 31.0, 0, 0, + ia->name, 0.0, MAX_NAME, 0, 0, "Use this property to define the Ipo position"); } else { @@ -2113,7 +2113,7 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo "Update IPO on all children Objects as well"); uiDefBut(block, TEX, 0, "FrameProp: ", xco+10, yco-64, width-20, 19, - ia->frameProp, 0.0, 31.0, 0, 0, + ia->frameProp, 0.0, MAX_NAME, 0, 0, "Assign the action's current frame number to this property"); yco-= ysize; @@ -2131,7 +2131,7 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo str= "Type%t|Assign%x0|Add %x1|Copy %x2|Toggle (bool/int/float/timer)%x3"; uiDefButI(block, MENU, B_REDR, str, xco+30,yco-24,width-60, 19, &pa->type, 0, 31, 0, 0, "Type"); - uiDefBut(block, TEX, 1, "Prop: ", xco+30,yco-44,width-60, 19, pa->name, 0, 31, 0, 0, "Property name"); + uiDefBut(block, TEX, 1, "Prop: ", xco+30,yco-44,width-60, 19, pa->name, 0, MAX_NAME, 0, 0, "Property name"); if(pa->type==ACT_PROP_TOGGLE) { @@ -2140,10 +2140,10 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo } else if(pa->type==ACT_PROP_COPY) { uiDefIDPoinBut(block, test_obpoin_but, ID_OB, 1, "OB:", xco+10, yco-64, (width-20)/2, 19, &(pa->ob), "Copy from this Object"); - uiDefBut(block, TEX, 1, "Prop: ", xco+10+(width-20)/2, yco-64, (width-20)/2, 19, pa->value, 0, 31, 0, 0, "Copy this property"); + uiDefBut(block, TEX, 1, "Prop: ", xco+10+(width-20)/2, yco-64, (width-20)/2, 19, pa->value, 0, MAX_NAME, 0, 0, "Copy this property"); } else { - uiDefBut(block, TEX, 1, "Value: ", xco+30,yco-64,width-60, 19, pa->value, 0, 31, 0, 0, "change with this value, use \"\" around strings"); + uiDefBut(block, TEX, 1, "Value: ", xco+30,yco-64,width-60, 19, pa->value, 0, MAX_NAME, 0, 0, "change with this value, use \"\" around strings"); } yco-= ysize; @@ -2175,7 +2175,7 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo 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,wval-20,19, - ((ID *)sa->sound)->name+2, 0.0, 21.0, 0, 0, ""); + ((ID *)sa->sound)->name+2, 0.0, MAX_ID_NAME-2, 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, @@ -2397,13 +2397,13 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo if (coa->flag & ACT_CONST_MATERIAL) { uiDefBut(block, TEX, 1, "Material:", xco + 50, yco-84, (width-60), 19, - coa->matprop, 0, 31, 0, 0, + coa->matprop, 0, MAX_NAME, 0, 0, "Ray detects only Objects with this material"); } else { uiDefBut(block, TEX, 1, "Property:", xco + 50, yco-84, (width-60), 19, - coa->matprop, 0, 31, 0, 0, + coa->matprop, 0, MAX_NAME, 0, 0, "Ray detect only Objects with this property"); } uiDefButBitS(block, TOG, ACT_CONST_PERMANENT, 0, "PER", xco+10, yco-103, 40, 19, @@ -2456,13 +2456,13 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo if (coa->flag & ACT_CONST_MATERIAL) { uiDefBut(block, TEX, 1, "Material:", xco + 50, yco-84, (width-60), 19, - coa->matprop, 0, 31, 0, 0, + coa->matprop, 0, MAX_NAME, 0, 0, "Ray detects only Objects with this material"); } else { uiDefBut(block, TEX, 1, "Property:", xco + 50, yco-84, (width-60), 19, - coa->matprop, 0, 31, 0, 0, + coa->matprop, 0, MAX_NAME, 0, 0, "Ray detect only Objects with this property"); } uiDefButBitS(block, TOG, ACT_CONST_PERMANENT, 0, "PER", xco+10, yco-103, 40, 19, @@ -2554,8 +2554,8 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo ysize = 48; glRects(xco, yco-ysize, xco+width, yco); uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); - uiDefBut(block, TEX, 1, "File: ", xco+10, yco-44,width-20,19, &(gma->filename), 0, 63, 0, 0, "Load this blend file, use the \"//\" prefix for a path relative to the current blend file"); -// uiDefBut(block, TEX, 1, "Anim: ", xco+10, yco-64,width-20,19, &(gma->loadaniname), 0, 63, 0, 0, "Use this loadinganimation"); + uiDefBut(block, TEX, 1, "File: ", xco+10, yco-44,width-20,19, &(gma->filename), 0, sizeof(gma->filename), 0, 0, "Load this blend file, use the \"//\" prefix for a path relative to the current blend file"); +// uiDefBut(block, TEX, 1, "Anim: ", xco+10, yco-64,width-20,19, &(gma->loadaniname), 0, sizeof(gma->loadaniname), 0, 0, "Use this loadinganimation"); } /* else if (gma->type == ACT_GAME_START) { @@ -2563,8 +2563,8 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo glRects(xco, yco-ysize, xco+width, yco); uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); - uiDefBut(block, TEX, 1, "File: ", xco+10, yco-44,width-20,19, &(gma->filename), 0, 63, 0, 0, "Load this file"); - uiDefBut(block, TEX, 1, "Anim: ", xco+10, yco-64,width-20,19, &(gma->loadaniname), 0, 63, 0, 0, "Use this loadinganimation"); + uiDefBut(block, TEX, 1, "File: ", xco+10, yco-44,width-20,19, &(gma->filename), 0, sizeof(gma->filename), 0, 0, "Load this file"); + uiDefBut(block, TEX, 1, "Anim: ", xco+10, yco-64,width-20,19, &(gma->loadaniname), 0, sizeof(gma->loadaniname), 0, 0, "Use this loadinganimation"); } */ else if (ELEM4(gma->type, ACT_GAME_RESTART, ACT_GAME_QUIT, ACT_GAME_SAVECFG, ACT_GAME_LOADCFG)) { @@ -2592,11 +2592,11 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo uiDefButS(block, MENU, 1, str, xco+20, yco-24, width-40, 19, &ga->type, 0, 0, 0, 0, ""); if(ga->type==ACT_GROUP_SET) { - uiDefBut(block, TEX, 0, "Key: ", xco+20, yco-44, (width-10)/2, 19, ga->name, 0.0, 31.0, 0, 0, "This name defines groupkey to be set"); + uiDefBut(block, TEX, 0, "Key: ", xco+20, yco-44, (width-10)/2, 19, ga->name, 0.0, MAX_NAME, 0, 0, "This name defines groupkey to be set"); uiDefButI(block, NUM, 0, "Frame:", xco+20+(width-10)/2, yco-44, (width-70)/2, 19, &ga->sta, 0.0, 2500.0, 0, 0, "Set this frame"); } else if(ga->type==ACT_GROUP_FROM_PROP) { - uiDefBut(block, TEX, 0, "Prop: ", xco+20, yco-44, width-40, 19, ga->name, 0.0, 31.0, 0, 0, "Use this property to define the Group position"); + uiDefBut(block, TEX, 0, "Prop: ", xco+20, yco-44, width-40, 19, ga->name, 0.0, MAX_NAME, 0, 0, "Use this property to define the Group position"); } else { uiDefButI(block, NUM, 0, "State", xco+20, yco-44, (width-40)/2, 19, &ga->sta, 0.0, 2500.0, 0, 0, "Start frame"); @@ -2698,7 +2698,7 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo /* 3. property */ uiDefBut(block, TEX, 1, "Property:", (xco+10), yco-44, (width-20), 19, - &randAct->propname, 0, 31, 0, 0, + &randAct->propname, 0, MAX_NAME, 0, 0, "Assign the random value to this property"); /*4. and 5. arguments for the distribution*/ @@ -2789,13 +2789,13 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo /* line 1: To */ uiDefBut(block, TEX, 1, "To: ", (xco+10), (yco-(myline++*24)), (width-20), 19, - &ma->toPropName, 0, 31, 0, 0, + &ma->toPropName, 0, MAX_NAME, 0, 0, "Optional send message to objects with this name only, or empty to broadcast"); /* line 2: Message Subject */ uiDefBut(block, TEX, 1, "Subject: ", (xco+10), (yco-(myline++*24)), (width-20), 19, - &ma->subject, 0, 31, 0, 0, + &ma->subject, 0, MAX_NAME, 0, 0, "Optional message subject. This is what can be filtered on"); /* line 3: Text/Property */ @@ -2809,14 +2809,14 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo /* line 3: Message Body */ uiDefBut(block, TEX, 1, "Body: ", (xco+10+(0.20*(width-20))),(yco-(myline++*24)),(0.8*(width-20)),19, - &ma->body, 0, 31, 0, 0, + &ma->body, 0, MAX_NAME, 0, 0, "Optional message body Text"); } else { /* line 3: Property body (set by property) */ uiDefBut(block, TEX, 1, "Propname: ", (xco+10+(0.20*(width-20))),(yco-(myline++*24)),(0.8*(width-20)),19, - &ma->body, 0, 31, 0, 0, + &ma->body, 0, MAX_NAME, 0, 0, "The message body will be set by the Property Value"); } @@ -2923,12 +2923,12 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo uiBlockBeginAlign(block); but = uiDefBut(block, TEX, 1, "Bone: ", (xco+5), (yco-44), (width-10)/2, 19, - armAct->posechannel, 0, 31, 0, 0, + armAct->posechannel, 0, MAX_NAME, 0, 0, "Bone on which the constraint is defined"); uiButSetFunc(but, check_armature_actuator, but, armAct); but = uiDefBut(block, TEX, 1, "Cons: ", (xco+5)+(width-10)/2, (yco-44), (width-10)/2, 19, - armAct->constraint, 0, 31, 0, 0, + armAct->constraint, 0, MAX_NAME, 0, 0, "Name of the constraint you want to control"); uiButSetFunc(but, check_armature_actuator, but, armAct); uiBlockEndAlign(block); @@ -2999,7 +2999,7 @@ static uiBlock *sensor_menu(bContext *C, ARegion *ar, void *UNUSED(arg)) uiBlock *block; int yco=0; - block= uiBeginBlock(C, ar, "filemenu", UI_EMBOSSP); + block= uiBeginBlock(C, ar, __func__, UI_EMBOSSP); uiBlockSetButmFunc(block, do_sensor_menu, NULL); uiDefBut(block, BUTM, 1, "Show Objects", 0, (short)(yco-=20), 160, 19, NULL, 0.0, 0.0, 1, 0, ""); @@ -3048,7 +3048,7 @@ static uiBlock *controller_menu(bContext *C, ARegion *ar, void *UNUSED(arg)) uiBlock *block; int yco=0; - block= uiBeginBlock(C, ar, "filemenu", UI_EMBOSSP); + block= uiBeginBlock(C, ar, __func__, UI_EMBOSSP); uiBlockSetButmFunc(block, do_controller_menu, NULL); uiDefBut(block, BUTM, 1, "Show Objects", 0, (short)(yco-=20), 160, 19, NULL, 0.0, 0.0, 1, 0, ""); @@ -3097,7 +3097,7 @@ static uiBlock *actuator_menu(bContext *C, ARegion *ar, void *UNUSED(arg)) uiBlock *block; int xco=0; - block= uiBeginBlock(C, ar, "filemenu", UI_EMBOSSP); + block= uiBeginBlock(C, ar, __func__, UI_EMBOSSP); uiBlockSetButmFunc(block, do_actuator_menu, NULL); uiDefBut(block, BUTM, 1, "Show Objects", 0, (short)(xco-=20), 160, 19, NULL, 0.0, 0.0, 1, 0, ""); @@ -3143,7 +3143,7 @@ static uiBlock *controller_state_mask_menu(bContext *C, ARegion *ar, void *arg_c short yco = 12, xco = 0, stbit, offset; - block= uiBeginBlock(C, ar, "Controller state mask", UI_EMBOSS); + block= uiBeginBlock(C, ar, __func__, UI_EMBOSS); /* use this for a fake extra empy space around the buttons */ uiDefBut(block, LABEL, 0, "", -5, -5, 200, 34, NULL, 0, 0, 0, 0, ""); @@ -3191,7 +3191,7 @@ static uiBlock *object_state_mask_menu(bContext *C, ARegion *ar, void *arg_obj) uiBlock *block; short xco = 0; - block= uiBeginBlock(C, ar, "obstatemenu", UI_EMBOSSP); + block= uiBeginBlock(C, ar, __func__, UI_EMBOSSP); uiBlockSetButmFunc(block, do_object_state_menu, arg_obj); uiDefBut(block, BUTM, 1, "Set all bits", 0, (short)(xco-=20), 160, 19, NULL, 0.0, 0.0, 1, 0, ""); @@ -3580,7 +3580,7 @@ static void draw_controller_header(uiLayout *layout, PointerRNA *ptr, int xco, i bController *cont= (bController *)ptr->data; char state[3]; - sprintf(state, "%d", RNA_int_get(ptr, "states")); + BLI_snprintf(state, sizeof(state), "%d", RNA_int_get(ptr, "states")); box= uiLayoutBox(layout); row= uiLayoutRow(box, 0); @@ -4488,7 +4488,7 @@ static void logic_buttons_new(bContext *C, ARegion *ar) uiLayout *layout, *row, *box; uiBlock *block; uiBut *but; - char name[32]; + char uiblockstr[32]; short a, count; int xco, yco, width; @@ -4497,8 +4497,8 @@ static void logic_buttons_new(bContext *C, ARegion *ar) RNA_pointer_create(NULL, &RNA_SpaceLogicEditor, slogic, &logic_ptr); idar= get_selected_and_linked_obs(C, &count, slogic->scaflag); - sprintf(name, "buttonswin %p", (void *)ar); - block= uiBeginBlock(C, ar, name, UI_EMBOSS); + BLI_snprintf(uiblockstr, sizeof(uiblockstr), "buttonswin %p", (void *)ar); + block= uiBeginBlock(C, ar, uiblockstr, UI_EMBOSS); uiBlockSetHandleFunc(block, do_logic_buts, NULL); /* loop over all objects and set visible/linked flags for the logic bricks */ @@ -4802,7 +4802,7 @@ void logic_buttons(bContext *C, ARegion *ar) int a, iact, stbit, offset; int xco, yco, width, ycoo; short count; - char name[32]; + char numstr[32]; /* pin is a bool used for actuator and sensor drawing with states * pin so changing states dosnt hide the logic brick */ char pin; @@ -4815,8 +4815,8 @@ void logic_buttons(bContext *C, ARegion *ar) if(ob==NULL) return; // uiSetButLock(object_is_libdata(ob), ERROR_LIBDATA_MESSAGE); - sprintf(name, "buttonswin %p", (void *)ar); - block= uiBeginBlock(C, ar, name, UI_EMBOSS); + BLI_snprintf(numstr, sizeof(numstr), "buttonswin %p", (void *)ar); + block= uiBeginBlock(C, ar, numstr, UI_EMBOSS); uiBlockSetHandleFunc(block, do_logic_buts, NULL); RNA_pointer_create(NULL, &RNA_SpaceLogicEditor, slogic, &logic_ptr); @@ -4932,13 +4932,13 @@ void logic_buttons(bContext *C, ARegion *ar) uiDefIconButBitS(block, ICONTOG, CONT_SHOW, B_REDR, ICON_RIGHTARROW, (short)(xco+width-22), yco, 22, UI_UNIT_Y, &cont->flag, 0, 0, 0, 0, "Controller settings"); uiDefIconButBitS(block, TOG, CONT_PRIO, B_REDR, ICON_BOOKMARKS, (short)(xco+width-66), yco, 22, UI_UNIT_Y, &cont->flag, 0, 0, 0, 0, "Mark controller for execution before all non-marked controllers (good for startup scripts)"); - sprintf(name, "%d", first_bit(cont->state_mask)+1); - uiDefBlockBut(block, controller_state_mask_menu, cont, name, (short)(xco+width-44), yco, 22, UI_UNIT_Y, "Set controller state index (from 1 to 30)"); + sprintf(numstr, "%d", first_bit(cont->state_mask)+1); + uiDefBlockBut(block, controller_state_mask_menu, cont, numstr, (short)(xco+width-44), yco, 22, UI_UNIT_Y, "Set controller state index (from 1 to 30)"); if(cont->flag & CONT_SHOW) { cont->otype= cont->type; uiDefButS(block, MENU, B_CHANGE_CONT, controller_pup(),(short)(xco+22), yco, 70, UI_UNIT_Y, &cont->type, 0, 0, 0, 0, "Controller type"); - but= uiDefBut(block, TEX, 1, "", (short)(xco+92), yco, (short)(width-158), UI_UNIT_Y, cont->name, 0, 31, 0, 0, "Controller name"); + but= uiDefBut(block, TEX, 1, "", (short)(xco+92), yco, (short)(width-158), UI_UNIT_Y, cont->name, 0, MAX_NAME, 0, 0, "Controller name"); uiButSetFunc(but, make_unique_prop_names_cb, cont->name, (void*) 0); ycoo= yco; @@ -5030,7 +5030,7 @@ void logic_buttons(bContext *C, ARegion *ar) if(sens->flag & SENS_SHOW) { uiDefButS(block, MENU, B_CHANGE_SENS, sensor_pup(), (short)(xco+22), yco, 80, UI_UNIT_Y, &sens->type, 0, 0, 0, 0, "Sensor type"); - but= uiDefBut(block, TEX, 1, "", (short)(xco+102), yco, (short)(width-(pin?146:124)), UI_UNIT_Y, sens->name, 0, 31, 0, 0, "Sensor name"); + but= uiDefBut(block, TEX, 1, "", (short)(xco+102), yco, (short)(width-(pin?146:124)), UI_UNIT_Y, sens->name, 0, MAX_NAME, 0, 0, "Sensor name"); uiButSetFunc(but, make_unique_prop_names_cb, sens->name, (void*) 0); sens->otype= sens->type; @@ -5042,7 +5042,7 @@ void logic_buttons(bContext *C, ARegion *ar) 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, old_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, ""); + but= uiDefBut(block, LABEL, 0, sens->name, (short)(xco+102), yco, (short)(width-(pin?146:124)), UI_UNIT_Y, sens, 0, MAX_NAME, 0, 0, ""); //uiButSetFunc(but, old_sca_move_sensor, sens, NULL); uiBlockBeginAlign(block); @@ -5108,7 +5108,7 @@ void logic_buttons(bContext *C, ARegion *ar) if(act->flag & ACT_SHOW) { act->otype= act->type; uiDefButS(block, MENU, B_CHANGE_ACT, actuator_pup(ob), (short)(xco+22), yco, 90, UI_UNIT_Y, &act->type, 0, 0, 0, 0, "Actuator type"); - but= uiDefBut(block, TEX, 1, "", (short)(xco+112), yco, (short)(width-(pin?156:134)), UI_UNIT_Y, act->name, 0, 31, 0, 0, "Actuator name"); + but= uiDefBut(block, TEX, 1, "", (short)(xco+112), yco, (short)(width-(pin?156:134)), UI_UNIT_Y, act->name, 0, MAX_NAME, 0, 0, "Actuator name"); uiButSetFunc(but, make_unique_prop_names_cb, act->name, (void*) 0); ycoo= yco; diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index 6af43e7618d..d7a1053f3c1 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -514,7 +514,7 @@ static void nla_draw_strip_frames_text(NlaTrack *UNUSED(nlt), NlaStrip *strip, V { const float ytol = 1.0f; /* small offset to vertical positioning of text, for legibility */ const char col[4] = {220, 220, 220, 255}; /* light grey */ - char str[32] = ""; + char numstr[32] = ""; /* Always draw times above the strip, whereas sequencer drew below + above. @@ -524,12 +524,12 @@ static void nla_draw_strip_frames_text(NlaTrack *UNUSED(nlt), NlaStrip *strip, V * while also preserving some accuracy, since we do use floats */ /* start frame */ - BLI_snprintf(str, sizeof(str), "%.1f", strip->start); - UI_view2d_text_cache_add(v2d, strip->start-1.0f, ymaxc+ytol, str, col); + BLI_snprintf(numstr, sizeof(numstr), "%.1f", strip->start); + UI_view2d_text_cache_add(v2d, strip->start-1.0f, ymaxc+ytol, numstr, col); /* end frame */ - BLI_snprintf(str, sizeof(str), "%.1f", strip->end); - UI_view2d_text_cache_add(v2d, strip->end, ymaxc+ytol, str, col); + BLI_snprintf(numstr, sizeof(numstr), "%.1f", strip->end); + UI_view2d_text_cache_add(v2d, strip->end, ymaxc+ytol, numstr, col); } /* ---------------------- */ @@ -715,7 +715,7 @@ static void draw_nla_channel_list_gl (bAnimContext *ac, ListBase *anim_data, Vie } sel = SEL_NLT(nlt); - strcpy(name, nlt->name); + BLI_strncpy(name, nlt->name, sizeof(name)); // draw manually still doDraw= 1; @@ -958,7 +958,7 @@ void draw_nla_channel_list (bContext *C, bAnimContext *ac, ARegion *ar) draw_nla_channel_list_gl(ac, &anim_data, v2d, y); } { /* second pass: UI widgets */ - uiBlock *block= uiBeginBlock(C, ar, "NLA channel buttons", UI_EMBOSS); + uiBlock *block= uiBeginBlock(C, ar, __func__, UI_EMBOSS); size_t channel_index = 0; y= (float)(-NLACHANNEL_HEIGHT(snla)); diff --git a/source/blender/editors/space_nla/nla_ops.c b/source/blender/editors/space_nla/nla_ops.c index 821e302c13d..f173a3d3835 100644 --- a/source/blender/editors/space_nla/nla_ops.c +++ b/source/blender/editors/space_nla/nla_ops.c @@ -192,28 +192,39 @@ static void nla_keymap_main (wmKeyConfig *keyconf, wmKeyMap *keymap) /* selection */ /* click select */ - WM_keymap_add_item(keymap, "NLA_OT_click_select", SELECTMOUSE, KM_PRESS, 0, 0); + kmi = WM_keymap_add_item(keymap, "NLA_OT_click_select", SELECTMOUSE, KM_PRESS, 0, 0); + RNA_boolean_set(kmi->ptr, "extend", FALSE); kmi= WM_keymap_add_item(keymap, "NLA_OT_click_select", SELECTMOUSE, KM_PRESS, KM_SHIFT, 0); - RNA_boolean_set(kmi->ptr, "extend", 1); + RNA_boolean_set(kmi->ptr, "extend", TRUE); /* select left/right */ - WM_keymap_add_item(keymap, "NLA_OT_select_leftright", SELECTMOUSE, KM_PRESS, KM_CTRL, 0); + kmi = WM_keymap_add_item(keymap, "NLA_OT_select_leftright", SELECTMOUSE, KM_PRESS, KM_CTRL, 0); + RNA_boolean_set(kmi->ptr, "extend", FALSE); + RNA_enum_set(kmi->ptr, "mode", NLAEDIT_LRSEL_TEST); kmi= WM_keymap_add_item(keymap, "NLA_OT_select_leftright", SELECTMOUSE, KM_PRESS, KM_CTRL|KM_SHIFT, 0); - RNA_boolean_set(kmi->ptr, "extend", 1); + RNA_boolean_set(kmi->ptr, "extend", TRUE); + RNA_enum_set(kmi->ptr, "mode", NLAEDIT_LRSEL_TEST); kmi= WM_keymap_add_item(keymap, "NLA_OT_select_leftright", LEFTBRACKETKEY, KM_PRESS, 0, 0); + RNA_boolean_set(kmi->ptr, "extend", FALSE); RNA_enum_set(kmi->ptr, "mode", NLAEDIT_LRSEL_LEFT); kmi= WM_keymap_add_item(keymap, "NLA_OT_select_leftright", RIGHTBRACKETKEY, KM_PRESS, 0, 0); + RNA_boolean_set(kmi->ptr, "extend", FALSE); RNA_enum_set(kmi->ptr, "mode", NLAEDIT_LRSEL_RIGHT); /* deselect all */ - WM_keymap_add_item(keymap, "NLA_OT_select_all_toggle", AKEY, KM_PRESS, 0, 0); - RNA_boolean_set(WM_keymap_add_item(keymap, "NLA_OT_select_all_toggle", IKEY, KM_PRESS, KM_CTRL, 0)->ptr, "invert", 1); + /* TODO: uniformize with other select_all ops? */ + kmi = WM_keymap_add_item(keymap, "NLA_OT_select_all_toggle", AKEY, KM_PRESS, 0, 0); + RNA_boolean_set(kmi->ptr, "invert", FALSE); + kmi = WM_keymap_add_item(keymap, "NLA_OT_select_all_toggle", IKEY, KM_PRESS, KM_CTRL, 0); + RNA_boolean_set(kmi->ptr, "invert", TRUE); /* borderselect */ - WM_keymap_add_item(keymap, "NLA_OT_select_border", BKEY, KM_PRESS, 0, 0); - RNA_boolean_set(WM_keymap_add_item(keymap, "NLA_OT_select_border", BKEY, KM_PRESS, KM_ALT, 0)->ptr, "axis_range", 1); + kmi = WM_keymap_add_item(keymap, "NLA_OT_select_border", BKEY, KM_PRESS, 0, 0); + RNA_boolean_set(kmi->ptr, "axis_range", FALSE); + kmi = WM_keymap_add_item(keymap, "NLA_OT_select_border", BKEY, KM_PRESS, KM_ALT, 0); + RNA_boolean_set(kmi->ptr, "axis_range", TRUE); /* view*/ /* auto-set range */ diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index bd5292e5154..7d475973c09 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -132,7 +132,7 @@ static uiBlock *socket_component_menu(bContext *C, ARegion *ar, void *args_v) uiBlock *block; uiLayout *layout; - block= uiBeginBlock(C, ar, "socket menu", UI_EMBOSS); + block= uiBeginBlock(C, ar, __func__, UI_EMBOSS); uiBlockSetFlag(block, UI_BLOCK_KEEP_OPEN); layout= uiLayoutColumn(uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, args->x, args->y+2, args->width, NODE_DY, UI_GetStyle()), 0); @@ -631,7 +631,7 @@ static void draw_group_socket_name(SpaceNode *snode, bNode *gnode, bNodeSocket * if (sock->flag & SOCK_DYNAMIC) { bt = uiDefBut(gnode->block, TEX, 0, "", sock->locx+xoffset, sock->locy+1+yoffset, 72, NODE_DY, - sock->name, 0, 31, 0, 0, ""); + sock->name, 0, sizeof(sock->name), 0, 0, ""); if (in_out==SOCK_IN) uiButSetFunc(bt, update_group_input_cb, snode, ngroup); else @@ -640,7 +640,7 @@ static void draw_group_socket_name(SpaceNode *snode, bNode *gnode, bNodeSocket * else { uiDefBut(gnode->block, LABEL, 0, sock->name, sock->locx+xoffset, sock->locy+1+yoffset, 72, NODE_DY, - NULL, 0, 31, 0, 0, ""); + NULL, 0, sizeof(sock->name), 0, 0, ""); } } @@ -1203,10 +1203,10 @@ static void node_composit_buts_image(uiLayout *layout, bContext *C, PointerRNA * /* don't use iuser->framenr directly because it may not be updated if auto-refresh is off */ Scene *scene= CTX_data_scene(C); ImageUser *iuser= node->storage; - char tstr[32]; + char numstr[32]; const int framenr= BKE_image_user_get_frame(iuser, CFRA, 0); - BLI_snprintf(tstr, sizeof(tstr), "Frame: %d", framenr); - uiItemL(layout, tstr, ICON_NONE); + BLI_snprintf(numstr, sizeof(numstr), "Frame: %d", framenr); + uiItemL(layout, numstr, ICON_NONE); } if (ELEM(source, IMA_SRC_SEQUENCE, IMA_SRC_MOVIE)) { @@ -1472,6 +1472,18 @@ static void node_composit_buts_splitviewer(uiLayout *layout, bContext *UNUSED(C) uiItemR(col, ptr, "factor", 0, NULL, ICON_NONE); } +static void node_composit_buts_double_edge_mask(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) +{ + uiLayout *col; + + col= uiLayoutColumn(layout, 0); + + uiItemL(col, "Inner Edge:", ICON_NONE); + uiItemR(col, ptr, "inner_mode", 0, "", ICON_NONE); + uiItemL(col, "Buffer Edge:", ICON_NONE); + uiItemR(col, ptr, "edge_mode", 0, "", ICON_NONE); +} + static void node_composit_buts_map_value(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { uiLayout *sub, *col; @@ -1926,6 +1938,9 @@ static void node_composit_set_butfunc(bNodeType *ntype) case CMP_NODE_ID_MASK: ntype->uifunc= node_composit_buts_id_mask; break; + case CMP_NODE_DOUBLEEDGEMASK: + ntype->uifunc= node_composit_buts_double_edge_mask; + break; case CMP_NODE_MATH: ntype->uifunc= node_buts_math; break; @@ -2264,211 +2279,6 @@ void draw_nodespace_back_pix(ARegion *ar, SpaceNode *snode, int color_manage) } } -void draw_nodespace_color_info(ARegion *ar, int color_manage, int channels, int x, int y, const char cp[4], const float fp[4]) -{ - char str[256]; - float dx= 6; - /* text colors */ - /* XXX colored text not allowed in Blender UI */ - #if 0 - unsigned char red[3] = {255, 50, 50}; - unsigned char green[3] = {0, 255, 0}; - unsigned char blue[3] = {100, 100, 255}; - #else - unsigned char red[3] = {255, 255, 255}; - unsigned char green[3] = {255, 255, 255}; - unsigned char blue[3] = {255, 255, 255}; - #endif - float hue=0, sat=0, val=0, lum=0, u=0, v=0; - float col[4], finalcol[4]; - - glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); - glEnable(GL_BLEND); - - /* noisy, high contrast make impossible to read if lower alpha is used. */ - glColor4ub(0, 0, 0, 190); - glRecti(0.0, 0.0, ar->winrct.xmax - ar->winrct.xmin + 1, 20); - glDisable(GL_BLEND); - - BLF_size(blf_mono_font, 11, 72); - - glColor3ub(255, 255, 255); - sprintf(str, "X:%-4d Y:%-4d |", x, y); - // UI_DrawString(6, 6, str); // works ok but fixed width is nicer. - BLF_position(blf_mono_font, dx, 6, 0); - BLF_draw_ascii(blf_mono_font, str, sizeof(str)); - dx += BLF_width(blf_mono_font, str); - - #if 0 /* XXX no Z value in compo backdrop atm */ - if(zp) { - glColor3ub(255, 255, 255); - sprintf(str, " Z:%-.4f |", 0.5f+0.5f*(((float)*zp)/(float)0x7fffffff)); - BLF_position(blf_mono_font, dx, 6, 0); - BLF_draw_ascii(blf_mono_font, str, sizeof(str)); - dx += BLF_width(blf_mono_font, str); - } - if(zpf) { - glColor3ub(255, 255, 255); - sprintf(str, " Z:%-.3f |", *zpf); - BLF_position(blf_mono_font, dx, 6, 0); - BLF_draw_ascii(blf_mono_font, str, sizeof(str)); - dx += BLF_width(blf_mono_font, str); - } - #endif - - if(channels >= 3) { - glColor3ubv(red); - if (fp) - sprintf(str, " R:%-.4f", fp[0]); - else if (cp) - sprintf(str, " R:%-3d", cp[0]); - else - sprintf(str, " R:-"); - BLF_position(blf_mono_font, dx, 6, 0); - BLF_draw_ascii(blf_mono_font, str, sizeof(str)); - dx += BLF_width(blf_mono_font, str); - - glColor3ubv(green); - if (fp) - sprintf(str, " G:%-.4f", fp[1]); - else if (cp) - sprintf(str, " G:%-3d", cp[1]); - else - sprintf(str, " G:-"); - BLF_position(blf_mono_font, dx, 6, 0); - BLF_draw_ascii(blf_mono_font, str, sizeof(str)); - dx += BLF_width(blf_mono_font, str); - - glColor3ubv(blue); - if (fp) - sprintf(str, " B:%-.4f", fp[2]); - else if (cp) - sprintf(str, " B:%-3d", cp[2]); - else - sprintf(str, " B:-"); - BLF_position(blf_mono_font, dx, 6, 0); - BLF_draw_ascii(blf_mono_font, str, sizeof(str)); - dx += BLF_width(blf_mono_font, str); - - if(channels == 4) { - glColor3ub(255, 255, 255); - if (fp) - sprintf(str, " A:%-.4f", fp[3]); - else if (cp) - sprintf(str, " A:%-3d", cp[3]); - else - sprintf(str, "- "); - BLF_position(blf_mono_font, dx, 6, 0); - BLF_draw_ascii(blf_mono_font, str, sizeof(str)); - dx += BLF_width(blf_mono_font, str); - } - } - - /* color rectangle */ - if (channels==1) { - if (fp) - col[0] = col[1] = col[2] = fp[0]; - else if (cp) - col[0] = col[1] = col[2] = (float)cp[0]/255.0f; - else - col[0] = col[1] = col[2] = 0.0f; - } - else if (channels==3) { - if (fp) - copy_v3_v3(col, fp); - else if (cp) { - col[0] = (float)cp[0]/255.0f; - col[1] = (float)cp[1]/255.0f; - col[2] = (float)cp[2]/255.0f; - } - else - zero_v3(col); - } - else if (channels==4) { - if (fp) - copy_v4_v4(col, fp); - else if (cp) { - col[0] = (float)cp[0]/255.0f; - col[1] = (float)cp[1]/255.0f; - col[2] = (float)cp[2]/255.0f; - col[3] = (float)cp[3]/255.0f; - } - else - zero_v4(col); - } - if (color_manage) { - linearrgb_to_srgb_v3_v3(finalcol, col); - finalcol[3] = col[3]; - } - else { - copy_v4_v4(finalcol, col); - } - glDisable(GL_BLEND); - glColor3fv(finalcol); - dx += 5; - glBegin(GL_QUADS); - glVertex2f(dx, 3); - glVertex2f(dx, 17); - glVertex2f(dx+30, 17); - glVertex2f(dx+30, 3); - glEnd(); - dx += 35; - - glColor3ub(255, 255, 255); - if(channels == 1) { - if (fp) { - rgb_to_hsv(fp[0], fp[0], fp[0], &hue, &sat, &val); - rgb_to_yuv(fp[0], fp[0], fp[0], &lum, &u, &v); - } - else if (cp) { - rgb_to_hsv((float)cp[0]/255.0f, (float)cp[0]/255.0f, (float)cp[0]/255.0f, &hue, &sat, &val); - rgb_to_yuv((float)cp[0]/255.0f, (float)cp[0]/255.0f, (float)cp[0]/255.0f, &lum, &u, &v); - } - - sprintf(str, "V:%-.4f", val); - BLF_position(blf_mono_font, dx, 6, 0); - BLF_draw_ascii(blf_mono_font, str, sizeof(str)); - dx += BLF_width(blf_mono_font, str); - - sprintf(str, " L:%-.4f", lum); - BLF_position(blf_mono_font, dx, 6, 0); - BLF_draw_ascii(blf_mono_font, str, sizeof(str)); - dx += BLF_width(blf_mono_font, str); - } - else if(channels >= 3) { - if (fp) { - rgb_to_hsv(fp[0], fp[1], fp[2], &hue, &sat, &val); - rgb_to_yuv(fp[0], fp[1], fp[2], &lum, &u, &v); - } - else if (cp) { - rgb_to_hsv((float)cp[0]/255.0f, (float)cp[1]/255.0f, (float)cp[2]/255.0f, &hue, &sat, &val); - rgb_to_yuv((float)cp[0]/255.0f, (float)cp[1]/255.0f, (float)cp[2]/255.0f, &lum, &u, &v); - } - - sprintf(str, "H:%-.4f", hue); - BLF_position(blf_mono_font, dx, 6, 0); - BLF_draw_ascii(blf_mono_font, str, sizeof(str)); - dx += BLF_width(blf_mono_font, str); - - sprintf(str, " S:%-.4f", sat); - BLF_position(blf_mono_font, dx, 6, 0); - BLF_draw_ascii(blf_mono_font, str, sizeof(str)); - dx += BLF_width(blf_mono_font, str); - - sprintf(str, " V:%-.4f", val); - BLF_position(blf_mono_font, dx, 6, 0); - BLF_draw_ascii(blf_mono_font, str, sizeof(str)); - dx += BLF_width(blf_mono_font, str); - - sprintf(str, " L:%-.4f", lum); - BLF_position(blf_mono_font, dx, 6, 0); - BLF_draw_ascii(blf_mono_font, str, sizeof(str)); - dx += BLF_width(blf_mono_font, str); - } - - (void)dx; -} - #if 0 /* note: needs to be userpref or opengl profile option */ static void draw_nodespace_back_tex(ScrArea *sa, SpaceNode *snode) diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c index da7f22b2030..a82ea9e9046 100644 --- a/source/blender/editors/space_node/node_draw.c +++ b/source/blender/editors/space_node/node_draw.c @@ -195,18 +195,18 @@ static void node_scaling_widget(int color_id, float aspect, float xmin, float ym static void node_uiblocks_init(const bContext *C, bNodeTree *ntree) { bNode *node; - char str[32]; + char uiblockstr[32]; /* add node uiBlocks in drawing order - prevents events going to overlapping nodes */ - for(node= ntree->nodes.first; node; node=node->next) { - /* ui block */ - sprintf(str, "node buttons %p", (void *)node); - node->block= uiBeginBlock(C, CTX_wm_region(C), str, UI_EMBOSS); - uiBlockSetHandleFunc(node->block, do_node_internal_buttons, node); - - /* this cancels events for background nodes */ - uiBlockSetFlag(node->block, UI_BLOCK_CLIP_EVENTS); + for (node= ntree->nodes.first; node; node= node->next) { + /* ui block */ + BLI_snprintf(uiblockstr, sizeof(uiblockstr), "node buttons %p", (void *)node); + node->block= uiBeginBlock(C, CTX_wm_region(C), uiblockstr, UI_EMBOSS); + uiBlockSetHandleFunc(node->block, do_node_internal_buttons, node); + + /* this cancels events for background nodes */ + uiBlockSetFlag(node->block, UI_BLOCK_CLIP_EVENTS); } } @@ -673,7 +673,7 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN BLI_strncpy(showname, nodeLabel(node), sizeof(showname)); //if(node->flag & NODE_MUTED) - // sprintf(showname, "[%s]", showname); + // BLI_snprintf(showname, sizeof(showname), "[%s]", showname); // XXX - dont print into self! uiDefBut(node->block, LABEL, 0, showname, (short)(rct->xmin+15), (short)(rct->ymax-NODE_DY), (int)(iconofs - rct->xmin-18.0f), NODE_DY, NULL, 0, 0, 0, 0, ""); @@ -835,7 +835,7 @@ static void node_draw_hidden(const bContext *C, ARegion *ar, SpaceNode *snode, b BLI_strncpy(showname, nodeLabel(node), sizeof(showname)); //if(node->flag & NODE_MUTED) - // sprintf(showname, "[%s]", showname); + // BLI_snprintf(showname, sizeof(showname), "[%s]", showname); // XXX - dont print into self! uiDefBut(node->block, LABEL, 0, showname, (short)(rct->xmin+15), (short)(centy-10), (int)(rct->xmax - rct->xmin-18.0f -12.0f), NODE_DY, NULL, 0, 0, 0, 0, ""); diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index 20fb385efdd..5beac4ea212 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -71,6 +71,7 @@ #include "IMB_imbuf_types.h" #include "ED_node.h" +#include "ED_image.h" #include "ED_screen.h" #include "ED_space_api.h" #include "ED_render.h" @@ -751,14 +752,14 @@ static int edit_node_poll(bContext *C) static void edit_node_properties(wmOperatorType *ot) { /* XXX could node be a context pointer? */ - RNA_def_string(ot->srna, "node", "", 32, "Node", ""); + RNA_def_string(ot->srna, "node", "", MAX_NAME, "Node", ""); RNA_def_int(ot->srna, "socket", 0, 0, MAX_SOCKET, "Socket", "", 0, MAX_SOCKET); RNA_def_enum(ot->srna, "in_out", socket_in_out_items, SOCK_IN, "Socket Side", ""); } static int edit_node_invoke_properties(bContext *C, wmOperator *op) { - if (!RNA_property_is_set(op->ptr, "node")) { + if (!RNA_struct_property_is_set(op->ptr, "node")) { bNode *node= CTX_data_pointer_get_type(C, "node", &RNA_Node).data; if (!node) return 0; @@ -766,10 +767,10 @@ static int edit_node_invoke_properties(bContext *C, wmOperator *op) RNA_string_set(op->ptr, "node", node->name); } - if (!RNA_property_is_set(op->ptr, "in_out")) + if (!RNA_struct_property_is_set(op->ptr, "in_out")) RNA_enum_set(op->ptr, "in_out", SOCK_IN); - if (!RNA_property_is_set(op->ptr, "socket")) + if (!RNA_struct_property_is_set(op->ptr, "socket")) RNA_int_set(op->ptr, "socket", 0); return 1; @@ -779,7 +780,7 @@ static void edit_node_properties_get(wmOperator *op, bNodeTree *ntree, bNode **r { bNode *node; bNodeSocket *sock=NULL; - char nodename[32]; + char nodename[MAX_NAME]; int sockindex; int in_out; @@ -889,20 +890,20 @@ static int node_group_socket_add_exec(bContext *C, wmOperator *op) { SpaceNode *snode = CTX_wm_space_node(C); int in_out= -1; - char name[32]= ""; + char name[MAX_NAME]= ""; int type= SOCK_FLOAT; bNodeTree *ngroup= snode->edittree; /* bNodeSocket *sock; */ /* UNUSED */ ED_preview_kill_jobs(C); - if (RNA_property_is_set(op->ptr, "name")) + if (RNA_struct_property_is_set(op->ptr, "name")) RNA_string_get(op->ptr, "name", name); - if (RNA_property_is_set(op->ptr, "type")) + if (RNA_struct_property_is_set(op->ptr, "type")) type = RNA_enum_get(op->ptr, "type"); - if (RNA_property_is_set(op->ptr, "in_out")) + if (RNA_struct_property_is_set(op->ptr, "in_out")) in_out = RNA_enum_get(op->ptr, "in_out"); else return OPERATOR_CANCELLED; @@ -932,7 +933,7 @@ void NODE_OT_group_socket_add(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO; RNA_def_enum(ot->srna, "in_out", socket_in_out_items, SOCK_IN, "Socket Type", "Input or Output"); - RNA_def_string(ot->srna, "name", "", 32, "Name", "Group socket name"); + RNA_def_string(ot->srna, "name", "", MAX_NAME, "Name", "Group socket name"); RNA_def_enum(ot->srna, "type", node_socket_type_items, SOCK_FLOAT, "Type", "Type of the group socket"); } @@ -948,12 +949,12 @@ static int node_group_socket_remove_exec(bContext *C, wmOperator *op) ED_preview_kill_jobs(C); - if (RNA_property_is_set(op->ptr, "index")) + if (RNA_struct_property_is_set(op->ptr, "index")) index = RNA_int_get(op->ptr, "index"); else return OPERATOR_CANCELLED; - if (RNA_property_is_set(op->ptr, "in_out")) + if (RNA_struct_property_is_set(op->ptr, "in_out")) in_out = RNA_enum_get(op->ptr, "in_out"); else return OPERATOR_CANCELLED; @@ -999,12 +1000,12 @@ static int node_group_socket_move_up_exec(bContext *C, wmOperator *op) ED_preview_kill_jobs(C); - if (RNA_property_is_set(op->ptr, "index")) + if (RNA_struct_property_is_set(op->ptr, "index")) index = RNA_int_get(op->ptr, "index"); else return OPERATOR_CANCELLED; - if (RNA_property_is_set(op->ptr, "in_out")) + if (RNA_struct_property_is_set(op->ptr, "in_out")) in_out = RNA_enum_get(op->ptr, "in_out"); else return OPERATOR_CANCELLED; @@ -1069,12 +1070,12 @@ static int node_group_socket_move_down_exec(bContext *C, wmOperator *op) ED_preview_kill_jobs(C); - if (RNA_property_is_set(op->ptr, "index")) + if (RNA_struct_property_is_set(op->ptr, "index")) index = RNA_int_get(op->ptr, "index"); else return OPERATOR_CANCELLED; - if (RNA_property_is_set(op->ptr, "in_out")) + if (RNA_struct_property_is_set(op->ptr, "in_out")) in_out = RNA_enum_get(op->ptr, "in_out"); else return OPERATOR_CANCELLED; @@ -1343,8 +1344,10 @@ static void sample_draw(const bContext *C, ARegion *ar, void *arg_info) { ImageSampleInfo *info= arg_info; - draw_nodespace_color_info(ar, (CTX_data_scene(C)->r.color_mgt_flag & R_COLOR_MANAGEMENT), info->channels, - info->x, info->y, info->col, info->colf); + ED_image_draw_info(ar, (CTX_data_scene(C)->r.color_mgt_flag & R_COLOR_MANAGEMENT), info->channels, + info->x, info->y, info->col, info->colf, + NULL, NULL /* zbuf - unused for nodes */ + ); } static void sample_apply(bContext *C, wmOperator *op, wmEvent *event) @@ -1926,7 +1929,7 @@ static int sort_nodes_locx(void *a, void *b) return 0; } -static int socket_is_available(bNodeTree *ntree, bNodeSocket *sock, int allow_used) +static int socket_is_available(bNodeTree *UNUSED(ntree), bNodeSocket *sock, int allow_used) { if (nodeSocketIsHidden(sock)) return 0; @@ -3435,7 +3438,7 @@ static int node_add_file_exec(bContext *C, wmOperator *op) ntemp.type = -1; /* check input variables */ - if (RNA_property_is_set(op->ptr, "filepath")) + if (RNA_struct_property_is_set(op->ptr, "filepath")) { char path[FILE_MAX]; RNA_string_get(op->ptr, "filepath", path); @@ -3449,9 +3452,9 @@ static int node_add_file_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } } - else if(RNA_property_is_set(op->ptr, "name")) + else if(RNA_struct_property_is_set(op->ptr, "name")) { - char name[32]; + char name[MAX_ID_NAME-2]; RNA_string_get(op->ptr, "name", name); ima= (Image *)find_id("IM", name); @@ -3495,7 +3498,7 @@ static int node_add_file_invoke(bContext *C, wmOperator *op, wmEvent *event) UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], &snode->mx, &snode->my); - if (RNA_property_is_set(op->ptr, "filepath") || RNA_property_is_set(op->ptr, "name")) + if (RNA_struct_property_is_set(op->ptr, "filepath") || RNA_struct_property_is_set(op->ptr, "name")) return node_add_file_exec(C, op); else return WM_operator_filesel(C, op, event); @@ -3517,7 +3520,7 @@ void NODE_OT_add_file(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH); //XXX TODO, relative_path - RNA_def_string(ot->srna, "name", "Image", 24, "Name", "Datablock name to assign"); + RNA_def_string(ot->srna, "name", "Image", MAX_ID_NAME-2, "Name", "Datablock name to assign"); } /********************** New node tree operator *********************/ @@ -3534,12 +3537,12 @@ static int new_node_tree_exec(bContext *C, wmOperator *op) /* retrieve state */ snode= CTX_wm_space_node(C); - if (RNA_property_is_set(op->ptr, "type")) + if (RNA_struct_property_is_set(op->ptr, "type")) treetype = RNA_enum_get(op->ptr, "type"); else treetype = snode->treetype; - if (RNA_property_is_set(op->ptr, "name")) + if (RNA_struct_property_is_set(op->ptr, "name")) RNA_string_get(op->ptr, "name", treename); ntree = ntreeAddTree(treename, treetype, 0); diff --git a/source/blender/editors/space_node/node_ops.c b/source/blender/editors/space_node/node_ops.c index b5c435b50e8..b71776f4266 100644 --- a/source/blender/editors/space_node/node_ops.c +++ b/source/blender/editors/space_node/node_ops.c @@ -34,6 +34,8 @@ #include "BKE_context.h" +#include "BLI_utildefines.h" + #include "ED_node.h" #include "ED_screen.h" #include "ED_transform.h" @@ -138,12 +140,14 @@ void node_keymap(struct wmKeyConfig *keyconf) /* mouse select in nodes used to be both keys, but perhaps this should be reduced? * NOTE: mouse-clicks on left-mouse will fall through to allow transform-tweak, but also link/resize */ - WM_keymap_add_item(keymap, "NODE_OT_select", ACTIONMOUSE, KM_PRESS, 0, 0); - WM_keymap_add_item(keymap, "NODE_OT_select", SELECTMOUSE, KM_PRESS, 0, 0); + kmi = WM_keymap_add_item(keymap, "NODE_OT_select", ACTIONMOUSE, KM_PRESS, 0, 0); + RNA_boolean_set(kmi->ptr, "extend", FALSE); + kmi = WM_keymap_add_item(keymap, "NODE_OT_select", SELECTMOUSE, KM_PRESS, 0, 0); + RNA_boolean_set(kmi->ptr, "extend", FALSE); kmi= WM_keymap_add_item(keymap, "NODE_OT_select", ACTIONMOUSE, KM_PRESS, KM_SHIFT, 0); - RNA_boolean_set(kmi->ptr, "extend", 1); + RNA_boolean_set(kmi->ptr, "extend", TRUE); kmi= WM_keymap_add_item(keymap, "NODE_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT, 0); - RNA_boolean_set(kmi->ptr, "extend", 1); + RNA_boolean_set(kmi->ptr, "extend", TRUE); RNA_boolean_set(WM_keymap_add_item(keymap, "NODE_OT_select_border", EVT_TWEAK_S, KM_ANY, 0, 0)->ptr, "tweak", 1); /* each of these falls through if not handled... */ diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c index f3bab197b3c..f8abfb6f4c3 100644 --- a/source/blender/editors/space_outliner/outliner_draw.c +++ b/source/blender/editors/space_outliner/outliner_draw.c @@ -628,7 +628,7 @@ static uiBlock *operator_search_menu(bContext *C, ARegion *ar, void *arg_kmi) /* fake button, it holds space for search items */ uiDefBut(block, LABEL, 0, "", 10, 15, 150, uiSearchBoxhHeight(), NULL, 0, 0, 0, 0, NULL); - but= uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, 256, 10, 0, 150, UI_UNIT_Y, 0, 0, ""); + but= uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, sizeof(search), 10, 0, 150, UI_UNIT_Y, 0, 0, ""); uiButSetSearchFunc(but, operator_search_cb, arg_kmi, operator_call_cb, ot); uiBoundsBlock(block, 6); @@ -1649,7 +1649,7 @@ void draw_outliner(const bContext *C) /* draw outliner stuff (background, hierachy lines and names) */ outliner_back(ar); - block= uiBeginBlock(C, ar, "outliner buttons", UI_EMBOSS); + block= uiBeginBlock(C, ar, __func__, UI_EMBOSS); outliner_draw_tree((bContext *)C, block, scene, ar, soops); if(ELEM(soops->outlinevis, SO_DATABLOCKS, SO_USERDEF)) { diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c index 9b1bd1d7b31..0ccbf9127c6 100644 --- a/source/blender/editors/space_outliner/outliner_edit.c +++ b/source/blender/editors/space_outliner/outliner_edit.c @@ -749,7 +749,7 @@ static void outliner_find_panel(Scene *UNUSED(scene), ARegion *ar, SpaceOops *so TreeElement *last_find; TreeStoreElem *tselem; int ytop, xdelta, prevFound=0; - char name[32]; + char name[sizeof(soops->search_string)]; /* get last found tree-element based on stored search_tse */ last_find= outliner_find_tse(soops, &soops->search_tse); @@ -803,7 +803,7 @@ static void outliner_find_panel(Scene *UNUSED(scene), ARegion *ar, SpaceOops *so /* store selection */ soops->search_tse= *tselem; - BLI_strncpy(soops->search_string, name, 33); + BLI_strncpy(soops->search_string, name, sizeof(soops->search_string)); soops->search_flags= flags; /* redraw */ diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c index 084e48c0d6e..33e0136b6bb 100644 --- a/source/blender/editors/space_outliner/outliner_tree.c +++ b/source/blender/editors/space_outliner/outliner_tree.c @@ -57,7 +57,7 @@ #include "BLI_utildefines.h" #include "BLI_math_base.h" -#if defined WIN32 && !defined _LIBC +#if defined WIN32 && !defined _LIBC || defined __sun # include "BLI_fnmatch.h" /* use fnmatch included in blenlib */ #else # ifndef _GNU_SOURCE @@ -1342,7 +1342,7 @@ static int outliner_filter_has_name(TreeElement *te, const char *name, int flags } else { char fn_name[sizeof(((struct SpaceOops *)NULL)->search_string) + 2]; - sprintf(fn_name, "*%s*", name); + BLI_snprintf(fn_name, sizeof(fn_name), "*%s*", name); found= fnmatch(fn_name, te->name, fn_flag)==0; } return found; diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c index 458e6453b77..f1d3d65559d 100644 --- a/source/blender/editors/space_sequencer/sequencer_add.c +++ b/source/blender/editors/space_sequencer/sequencer_add.c @@ -130,7 +130,7 @@ static void sequencer_generic_invoke_xy__internal(bContext *C, wmOperator *op, w RNA_int_set(op->ptr, "frame_start", (int)mval_v2d[0]); - if ((flag & SEQPROP_ENDFRAME) && RNA_property_is_set(op->ptr, "frame_end")==0) + if ((flag & SEQPROP_ENDFRAME) && RNA_struct_property_is_set(op->ptr, "frame_end")==0) RNA_int_set(op->ptr, "frame_end", (int)mval_v2d[0] + 25); // XXX arbitary but ok for now. if (!(flag & SEQPROP_NOPATHS)) { @@ -264,7 +264,7 @@ static int sequencer_add_scene_strip_invoke(bContext *C, wmOperator *op, wmEvent return OPERATOR_CANCELLED; } - if(!RNA_property_is_set(op->ptr, "scene")) + if(!RNA_struct_property_is_set(op->ptr, "scene")) return WM_enum_search_invoke(C, op, event); sequencer_generic_invoke_xy__internal(C, op, event, 0); @@ -371,7 +371,7 @@ static int sequencer_add_movie_strip_invoke(bContext *C, wmOperator *op, wmEvent } /* This is for drag and drop */ - if(RNA_collection_length(op->ptr, "files") || RNA_property_is_set(op->ptr, "filepath")) { + if(RNA_collection_length(op->ptr, "files") || RNA_struct_property_is_set(op->ptr, "filepath")) { sequencer_generic_invoke_xy__internal(C, op, event, SEQPROP_NOPATHS); return sequencer_add_movie_strip_exec(C, op); } @@ -423,7 +423,7 @@ static int sequencer_add_sound_strip_invoke(bContext *C, wmOperator *op, wmEvent } /* This is for drag and drop */ - if(RNA_collection_length(op->ptr, "files") || RNA_property_is_set(op->ptr, "filepath")) { + if(RNA_collection_length(op->ptr, "files") || RNA_struct_property_is_set(op->ptr, "filepath")) { sequencer_generic_invoke_xy__internal(C, op, event, SEQPROP_NOPATHS); return sequencer_add_sound_strip_exec(C, op); } @@ -650,7 +650,7 @@ static int sequencer_add_effect_strip_exec(bContext *C, wmOperator *op) /* an unset channel is a special case where we automatically go above * the other strips. */ - if(!RNA_property_is_set(op->ptr, "channel")) { + if(!RNA_struct_property_is_set(op->ptr, "channel")) { if(seq->seq1) { int chan= MAX3( seq->seq1 ? seq->seq1->machine : 0, seq->seq2 ? seq->seq2->machine : 0, @@ -686,7 +686,7 @@ static int sequencer_add_effect_strip_exec(bContext *C, wmOperator *op) /* add color */ static int sequencer_add_effect_strip_invoke(bContext *C, wmOperator *op, wmEvent *event) { - short is_type_set= RNA_property_is_set(op->ptr, "type"); + short is_type_set= RNA_struct_property_is_set(op->ptr, "type"); int type= -1; int prop_flag= SEQPROP_ENDFRAME; diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index 2b59a02deae..176ffd91e3b 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -328,7 +328,7 @@ static void draw_seq_handle(View2D *v2d, Sequence *seq, float pixelx, short dire float x1, x2, y1, y2; float handsize; float minhandle, maxhandle; - char str[32]; + char numstr[32]; unsigned int whichsel=0; x1= seq->startdisp; @@ -392,15 +392,15 @@ static void draw_seq_handle(View2D *v2d, Sequence *seq, float pixelx, short dire if(G.moving || (seq->flag & whichsel)) { const char col[4]= {255, 255, 255, 255}; if (direction == SEQ_LEFTHANDLE) { - sprintf(str, "%d", seq->startdisp); + BLI_snprintf(numstr, sizeof(numstr),"%d", seq->startdisp); x1= rx1; y1 -= 0.45f; } else { - sprintf(str, "%d", seq->enddisp - 1); + BLI_snprintf(numstr, sizeof(numstr), "%d", seq->enddisp - 1); x1= x2 - handsize*0.75f; y1= y2 + 0.05f; } - UI_view2d_text_cache_add(v2d, x1, y1, str, col); + UI_view2d_text_cache_add(v2d, x1, y1, numstr, col); } } diff --git a/source/blender/editors/space_sequencer/sequencer_intern.h b/source/blender/editors/space_sequencer/sequencer_intern.h index 4359e3a6652..812bdbc678f 100644 --- a/source/blender/editors/space_sequencer/sequencer_intern.h +++ b/source/blender/editors/space_sequencer/sequencer_intern.h @@ -122,7 +122,7 @@ void SEQUENCER_OT_rebuild_proxy(struct wmOperatorType *ot); void SEQUENCER_OT_view_all_preview(struct wmOperatorType *ot); /* sequencer_select.c */ -void SEQUENCER_OT_select_all_toggle(struct wmOperatorType *ot); +void SEQUENCER_OT_select_all(struct wmOperatorType *ot); void SEQUENCER_OT_select(struct wmOperatorType *ot); void SEQUENCER_OT_select_more(struct wmOperatorType *ot); void SEQUENCER_OT_select_less(struct wmOperatorType *ot); diff --git a/source/blender/editors/space_sequencer/sequencer_ops.c b/source/blender/editors/space_sequencer/sequencer_ops.c index 07ca56cde8b..a6d8b6c2612 100644 --- a/source/blender/editors/space_sequencer/sequencer_ops.c +++ b/source/blender/editors/space_sequencer/sequencer_ops.c @@ -92,8 +92,7 @@ void sequencer_operatortypes(void) WM_operatortype_append(SEQUENCER_OT_change_path); /* sequencer_select.c */ - WM_operatortype_append(SEQUENCER_OT_select_all_toggle); - WM_operatortype_append(SEQUENCER_OT_select_inverse); + WM_operatortype_append(SEQUENCER_OT_select_all); WM_operatortype_append(SEQUENCER_OT_select); WM_operatortype_append(SEQUENCER_OT_select_more); WM_operatortype_append(SEQUENCER_OT_select_less); @@ -133,17 +132,23 @@ void sequencer_keymap(wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "SEQUENCER_OT_properties", NKEY, KM_PRESS, 0, 0); - WM_keymap_add_item(keymap, "SEQUENCER_OT_select_all_toggle", AKEY, KM_PRESS, 0, 0); - WM_keymap_add_item(keymap, "SEQUENCER_OT_select_inverse", IKEY, KM_PRESS, KM_CTRL, 0); + kmi = WM_keymap_add_item(keymap, "SEQUENCER_OT_select_all", AKEY, KM_PRESS, 0, 0); + RNA_enum_set(kmi->ptr, "action", SEL_TOGGLE); + kmi = WM_keymap_add_item(keymap, "SEQUENCER_OT_select_all", IKEY, KM_PRESS, KM_CTRL, 0); + RNA_enum_set(kmi->ptr, "action", SEL_INVERT); RNA_enum_set(WM_keymap_add_item(keymap, "SEQUENCER_OT_cut", KKEY, KM_PRESS, 0, 0)->ptr, "type", SEQ_CUT_SOFT); RNA_enum_set(WM_keymap_add_item(keymap, "SEQUENCER_OT_cut", KKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "type", SEQ_CUT_HARD); - WM_keymap_add_item(keymap, "SEQUENCER_OT_mute", HKEY, KM_PRESS, 0, 0); - RNA_boolean_set(WM_keymap_add_item(keymap, "SEQUENCER_OT_mute", HKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "unselected", 1); + kmi = WM_keymap_add_item(keymap, "SEQUENCER_OT_mute", HKEY, KM_PRESS, 0, 0); + RNA_boolean_set(kmi->ptr, "unselected", FALSE); + kmi = WM_keymap_add_item(keymap, "SEQUENCER_OT_mute", HKEY, KM_PRESS, KM_SHIFT, 0); + RNA_boolean_set(kmi->ptr, "unselected", TRUE); - WM_keymap_add_item(keymap, "SEQUENCER_OT_unmute", HKEY, KM_PRESS, KM_ALT, 0); - RNA_boolean_set(WM_keymap_add_item(keymap, "SEQUENCER_OT_unmute", HKEY, KM_PRESS, KM_ALT|KM_SHIFT, 0)->ptr, "unselected", 1); + kmi = WM_keymap_add_item(keymap, "SEQUENCER_OT_unmute", HKEY, KM_PRESS, KM_ALT, 0); + RNA_boolean_set(kmi->ptr, "unselected", FALSE); + kmi = WM_keymap_add_item(keymap, "SEQUENCER_OT_unmute", HKEY, KM_PRESS, KM_ALT|KM_SHIFT, 0); + RNA_boolean_set(kmi->ptr, "unselected", TRUE); WM_keymap_add_item(keymap, "SEQUENCER_OT_lock", LKEY, KM_PRESS, KM_SHIFT, 0); WM_keymap_add_item(keymap, "SEQUENCER_OT_unlock", LKEY, KM_PRESS, KM_SHIFT|KM_ALT, 0); @@ -193,8 +198,16 @@ void sequencer_keymap(wmKeyConfig *keyconf) } /* Mouse selection, a bit verbose :/ */ - WM_keymap_add_item(keymap, "SEQUENCER_OT_select", SELECTMOUSE, KM_PRESS, 0, 0); - RNA_boolean_set(WM_keymap_add_item(keymap, "SEQUENCER_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT, 0)->ptr, "extend", 1); + kmi = WM_keymap_add_item(keymap, "SEQUENCER_OT_select", SELECTMOUSE, KM_PRESS, 0, 0); + RNA_boolean_set(kmi->ptr, "extend", FALSE); + RNA_boolean_set(kmi->ptr, "linked_handle", FALSE); + RNA_boolean_set(kmi->ptr, "left_right", FALSE); + RNA_boolean_set(kmi->ptr, "linked_time", FALSE); + kmi = WM_keymap_add_item(keymap, "SEQUENCER_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT, 0); + RNA_boolean_set(kmi->ptr, "extend", TRUE); + RNA_boolean_set(kmi->ptr, "linked_handle", FALSE); + RNA_boolean_set(kmi->ptr, "left_right", FALSE); + RNA_boolean_set(kmi->ptr, "linked_time", FALSE); /* 2.4x method, now use Alt for handles and select the side based on which handle was selected */ @@ -221,21 +234,31 @@ void sequencer_keymap(wmKeyConfig *keyconf) */ /* 2.5 method, Alt and use selected handle */ - RNA_boolean_set(WM_keymap_add_item(keymap, "SEQUENCER_OT_select", SELECTMOUSE, KM_PRESS, KM_ALT, 0)->ptr, "linked_handle", 1); + kmi = WM_keymap_add_item(keymap, "SEQUENCER_OT_select", SELECTMOUSE, KM_PRESS, KM_ALT, 0); + RNA_boolean_set(kmi->ptr, "extend", FALSE); + RNA_boolean_set(kmi->ptr, "linked_handle", TRUE); + RNA_boolean_set(kmi->ptr, "left_right", FALSE); + RNA_boolean_set(kmi->ptr, "linked_time", FALSE); kmi= WM_keymap_add_item(keymap, "SEQUENCER_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT|KM_ALT, 0); - RNA_boolean_set(kmi->ptr, "extend", 1); - RNA_boolean_set(kmi->ptr, "linked_handle", 1); + RNA_boolean_set(kmi->ptr, "extend", TRUE); + RNA_boolean_set(kmi->ptr, "linked_handle", TRUE); + RNA_boolean_set(kmi->ptr, "left_right", FALSE); + RNA_boolean_set(kmi->ptr, "linked_time", FALSE); /* match action editor */ kmi= WM_keymap_add_item(keymap, "SEQUENCER_OT_select", SELECTMOUSE, KM_PRESS, KM_CTRL, 0); - RNA_boolean_set(kmi->ptr, "left_right", 1); /* grr, these conflict - only use left_right if not over an active seq */ - RNA_boolean_set(kmi->ptr, "linked_time", 1); + RNA_boolean_set(kmi->ptr, "extend", FALSE); + RNA_boolean_set(kmi->ptr, "linked_handle", FALSE); + RNA_boolean_set(kmi->ptr, "left_right", TRUE); /* grr, these conflict - only use left_right if not over an active seq */ + RNA_boolean_set(kmi->ptr, "linked_time", TRUE); /* adjusted since 2.4 */ kmi= WM_keymap_add_item(keymap, "SEQUENCER_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT|KM_CTRL, 0); - RNA_boolean_set(kmi->ptr, "extend", 1); - RNA_boolean_set(kmi->ptr, "linked_time", 1); + RNA_boolean_set(kmi->ptr, "extend", TRUE); + RNA_boolean_set(kmi->ptr, "linked_handle", FALSE); + RNA_boolean_set(kmi->ptr, "left_right", FALSE); + RNA_boolean_set(kmi->ptr, "linked_time", TRUE); WM_keymap_add_item(keymap, "SEQUENCER_OT_select_more", PADPLUSKEY, KM_PRESS, KM_CTRL, 0); WM_keymap_add_item(keymap, "SEQUENCER_OT_select_less", PADMINUS, KM_PRESS, KM_CTRL, 0); diff --git a/source/blender/editors/space_sequencer/sequencer_scopes.c b/source/blender/editors/space_sequencer/sequencer_scopes.c index 8c189d96062..2bb40ce51f4 100644 --- a/source/blender/editors/space_sequencer/sequencer_scopes.c +++ b/source/blender/editors/space_sequencer/sequencer_scopes.c @@ -29,16 +29,17 @@ #include <math.h> #include <string.h> +#include "BLI_math_color.h" #include "BLI_utildefines.h" - - #include "IMB_imbuf_types.h" #include "IMB_imbuf.h" #include "sequencer_intern.h" -static void rgb_to_yuv(float rgb[3], float yuv[3]) +/* XXX, why is this function better then BLI_math version? + * only difference is it does some normalize after, need to double check on this - campbell */ +static void rgb_to_yuv_normalized(const float rgb[3], float yuv[3]) { yuv[0]= 0.299f*rgb[0] + 0.587f*rgb[1] + 0.114f*rgb[2]; yuv[1]= 0.492f*(rgb[2] - yuv[0]); @@ -169,10 +170,7 @@ static struct ImBuf *make_waveform_view_from_ibuf_byte(struct ImBuf * ibuf) for (x = 0; x < ibuf->x; x++) { unsigned char * rgb = src + 4 * (ibuf->x * y + x); - float v = 1.0 * - ( 0.299*rgb[0] - + 0.587*rgb[1] - + 0.114*rgb[2]) / 255.0; + float v = (float)rgb_to_luma_byte(rgb) / 255.0; unsigned char * p = tgt; p += 4 * (w * ((int) (v * (h - 3)) + 1) + x + 1); @@ -215,10 +213,7 @@ static struct ImBuf *make_waveform_view_from_ibuf_float(struct ImBuf * ibuf) for (x = 0; x < ibuf->x; x++) { float * rgb = src + 4 * (ibuf->x * y + x); - float v = 1.0f * - ( 0.299f*rgb[0] - + 0.587f*rgb[1] - + 0.114f*rgb[2]); + float v = rgb_to_luma(rgb); unsigned char * p = tgt; CLAMP(v, 0.0f, 1.0f); @@ -583,7 +578,7 @@ static void vectorscope_put_cross(unsigned char r, unsigned char g, rgb[0]= (float)r/255.0f; rgb[1]= (float)g/255.0f; rgb[2]= (float)b/255.0f; - rgb_to_yuv(rgb, yuv); + rgb_to_yuv_normalized(rgb, yuv); p = tgt + 4 * (w * (int) ((yuv[2] * (h - 3) + 1)) + (int) ((yuv[1] * (w - 3) + 1))); @@ -634,7 +629,7 @@ static struct ImBuf *make_vectorscope_view_from_ibuf_byte(struct ImBuf * ibuf) rgb[0]= (float)src1[0]/255.0f; rgb[1]= (float)src1[1]/255.0f; rgb[2]= (float)src1[2]/255.0f; - rgb_to_yuv(rgb, yuv); + rgb_to_yuv_normalized(rgb, yuv); p = tgt + 4 * (w * (int) ((yuv[2] * (h - 3) + 1)) + (int) ((yuv[1] * (w - 3) + 1))); @@ -684,7 +679,7 @@ static struct ImBuf *make_vectorscope_view_from_ibuf_float(struct ImBuf * ibuf) CLAMP(rgb[1], 0.0f, 1.0f); CLAMP(rgb[2], 0.0f, 1.0f); - rgb_to_yuv(rgb, yuv); + rgb_to_yuv_normalized(rgb, yuv); p = tgt + 4 * (w * (int) ((yuv[2] * (h - 3) + 1)) + (int) ((yuv[1] * (w - 3) + 1))); diff --git a/source/blender/editors/space_sequencer/sequencer_select.c b/source/blender/editors/space_sequencer/sequencer_select.c index 9eb900ed427..a6568950a01 100644 --- a/source/blender/editors/space_sequencer/sequencer_select.c +++ b/source/blender/editors/space_sequencer/sequencer_select.c @@ -179,8 +179,6 @@ static void UNUSED_FUNCTION(select_single_seq)(Scene *scene, Sequence *seq, int recurs_sel_seq(seq); } -// remove this function, replace with invert operator -//void swap_select_seq(Scene *scene) #if 0 static void select_neighbor_from_last(Scene *scene, int lr) { @@ -214,48 +212,65 @@ static void select_neighbor_from_last(Scene *scene, int lr) #endif /* (de)select operator */ -static int sequencer_deselect_exec(bContext *C, wmOperator *UNUSED(op)) +static int sequencer_de_select_all_exec(bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); - Editing *ed= seq_give_editing(scene, FALSE); + int action = RNA_enum_get(op->ptr, "action"); + + Scene *scene = CTX_data_scene(C); + Editing *ed = seq_give_editing(scene, FALSE); Sequence *seq; - int desel = 0; - for(seq= ed->seqbasep->first; seq; seq=seq->next) { - if(seq->flag & SEQ_ALLSEL) { - desel= 1; - break; + if (action == SEL_TOGGLE) { + action = SEL_SELECT; + for (seq = ed->seqbasep->first; seq; seq = seq->next) { + if (seq->flag & SEQ_ALLSEL) { + action = SEL_DESELECT; + break; + } } } - for(seq= ed->seqbasep->first; seq; seq=seq->next) { - if (desel) { - seq->flag &= ~SEQ_ALLSEL; - } - else { - seq->flag &= ~(SEQ_LEFTSEL+SEQ_RIGHTSEL); - seq->flag |= SELECT; + for (seq = ed->seqbasep->first; seq; seq = seq->next) { + switch (action) { + case SEL_SELECT: + seq->flag &= ~(SEQ_LEFTSEL + SEQ_RIGHTSEL); + seq->flag |= SELECT; + break; + case SEL_DESELECT: + seq->flag &= ~SEQ_ALLSEL; + break; + case SEL_INVERT: + if (seq->flag & SEQ_ALLSEL) { + seq->flag &= ~SEQ_ALLSEL; + } + else { + seq->flag &= ~(SEQ_LEFTSEL + SEQ_RIGHTSEL); + seq->flag |= SELECT; + } + break; } } - WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER|NA_SELECTED, scene); - + WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER | NA_SELECTED, scene); + return OPERATOR_FINISHED; } -void SEQUENCER_OT_select_all_toggle(struct wmOperatorType *ot) +void SEQUENCER_OT_select_all(struct wmOperatorType *ot) { /* identifiers */ ot->name= "Select or Deselect All"; - ot->idname= "SEQUENCER_OT_select_all_toggle"; + ot->idname= "SEQUENCER_OT_select_all"; ot->description="Select or deselect all strips"; /* api callbacks */ - ot->exec= sequencer_deselect_exec; + ot->exec= sequencer_de_select_all_exec; ot->poll= sequencer_edit_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + WM_operator_properties_select_all(ot); } diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c index 637c8fcdbcf..25b9c2f2864 100644 --- a/source/blender/editors/space_text/text_draw.c +++ b/source/blender/editors/space_text/text_draw.c @@ -75,7 +75,7 @@ static void text_font_end(SpaceText *UNUSED(st)) static int text_font_draw(SpaceText *UNUSED(st), int x, int y, char *str) { BLF_position(mono, x, y, 0); - BLF_draw(mono, str, 65535); /* XXX, use real length */ + BLF_draw(mono, str, BLF_DRAW_STR_DUMMY_MAX); return BLF_width(mono, str); } @@ -1766,7 +1766,7 @@ void draw_text_main(SpaceText *st, ARegion *ar) else UI_ThemeColor(TH_TEXT); - sprintf(linenr, "%*d", st->linenrs_tot, i + linecount + 1); + BLI_snprintf(linenr, sizeof(linenr), "%*d", st->linenrs_tot, i + linecount + 1); /* itoa(i + linecount + 1, linenr, 10); */ /* not ansi-c :/ */ text_font_draw(st, TXT_OFFSET - 7, y, linenr); diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index 566659e0391..e8ad6e19fd4 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -276,7 +276,7 @@ static int text_open_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) Text *text= CTX_data_edit_text(C); char *path= (text && text->name)? text->name: G.main->name; - if(RNA_property_is_set(op->ptr, "filepath")) + if(RNA_struct_property_is_set(op->ptr, "filepath")) return text_open_exec(C, op); text_open_init(C, op); @@ -534,7 +534,7 @@ static int text_save_as_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(even Text *text= CTX_data_edit_text(C); char *str; - if(RNA_property_is_set(op->ptr, "filepath")) + if(RNA_struct_property_is_set(op->ptr, "filepath")) return text_save_as_exec(C, op); if(text->name) @@ -2209,7 +2209,7 @@ static int text_scroll_invoke(bContext *C, wmOperator *op, wmEvent *event) SpaceText *st= CTX_wm_space_text(C); TextScroll *tsc; - if(RNA_property_is_set(op->ptr, "lines")) + if(RNA_struct_property_is_set(op->ptr, "lines")) return text_scroll_exec(C, op); tsc= MEM_callocN(sizeof(TextScroll), "TextScroll"); @@ -2289,7 +2289,7 @@ static int text_scroll_bar_invoke(bContext *C, wmOperator *op, wmEvent *event) const int *mval= event->mval; int zone= -1; - if(RNA_property_is_set(op->ptr, "lines")) + if(RNA_struct_property_is_set(op->ptr, "lines")) return text_scroll_exec(C, op); /* verify we are in the right zone */ @@ -2784,7 +2784,7 @@ static int text_insert_invoke(bContext *C, wmOperator *op, wmEvent *event) { int ret; - // if(!RNA_property_is_set(op->ptr, "text")) { /* always set from keymap XXX */ + // if(!RNA_struct_property_is_set(op->ptr, "text")) { /* always set from keymap XXX */ if(!RNA_string_length(op->ptr, "text")) { /* if alt/ctrl/super are pressed pass through */ if(event->ctrl || event->oskey) { diff --git a/source/blender/editors/space_view3d/drawanimviz.c b/source/blender/editors/space_view3d/drawanimviz.c index 1784d949761..638bf5b41a7 100644 --- a/source/blender/editors/space_view3d/drawanimviz.c +++ b/source/blender/editors/space_view3d/drawanimviz.c @@ -218,23 +218,23 @@ void draw_motion_path_instance(Scene *scene, col[3]= 255; for (i=0, mpv=mpv_start; i < len; i+=stepsize, mpv+=stepsize) { - char str[32]; + char numstr[32]; float co[3]; /* only draw framenum if several consecutive highlighted points don't occur on same point */ if (i == 0) { - sprintf(str, "%d", (i+sfra)); + sprintf(numstr, "%d", (i+sfra)); mul_v3_m4v3(co, ob->imat, mpv->co); - view3d_cached_text_draw_add(co, str, 0, V3D_CACHE_TEXT_WORLDSPACE|V3D_CACHE_TEXT_ASCII, col); + view3d_cached_text_draw_add(co, numstr, 0, V3D_CACHE_TEXT_WORLDSPACE|V3D_CACHE_TEXT_ASCII, col); } else if ((i > stepsize) && (i < len-stepsize)) { bMotionPathVert *mpvP = (mpv - stepsize); bMotionPathVert *mpvN = (mpv + stepsize); if ((equals_v3v3(mpv->co, mpvP->co)==0) || (equals_v3v3(mpv->co, mpvN->co)==0)) { - sprintf(str, "%d", (sfra+i)); + sprintf(numstr, "%d", (sfra+i)); mul_v3_m4v3(co, ob->imat, mpv->co); - view3d_cached_text_draw_add(co, str, 0, V3D_CACHE_TEXT_WORLDSPACE|V3D_CACHE_TEXT_ASCII, col); + view3d_cached_text_draw_add(co, numstr, 0, V3D_CACHE_TEXT_WORLDSPACE|V3D_CACHE_TEXT_ASCII, col); } } } @@ -293,11 +293,11 @@ void draw_motion_path_instance(Scene *scene, float mframe= (float)(sfra + i); if (BLI_dlrbTree_search_exact(&keys, compare_ak_cfraPtr, &mframe)) { - char str[32]; + char numstr[32]; - sprintf(str, "%d", (sfra+i)); + sprintf(numstr, "%d", (sfra+i)); mul_v3_m4v3(co, ob->imat, mpv->co); - view3d_cached_text_draw_add(co, str, 0, V3D_CACHE_TEXT_WORLDSPACE|V3D_CACHE_TEXT_ASCII, col); + view3d_cached_text_draw_add(co, numstr, 0, V3D_CACHE_TEXT_WORLDSPACE|V3D_CACHE_TEXT_ASCII, col); } } } diff --git a/source/blender/editors/space_view3d/drawmesh.c b/source/blender/editors/space_view3d/drawmesh.c index e0b1741b0d0..b1842578c20 100644 --- a/source/blender/editors/space_view3d/drawmesh.c +++ b/source/blender/editors/space_view3d/drawmesh.c @@ -547,7 +547,7 @@ static int draw_em_tf_mapped__set_draw(void *userData, int index) return draw_tface__set_draw_legacy(tface, data->has_mcol, matnr); } -static int wpaint__setSolidDrawOptions(void *userData, int index, int *drawSmooth_r) +static int wpaint__setSolidDrawOptions_material(void *userData, int index, int *drawSmooth_r) { Mesh *me = (Mesh*)userData; @@ -562,6 +562,16 @@ static int wpaint__setSolidDrawOptions(void *userData, int index, int *drawSmoot return 1; } +/* when face select is on, use face hidden flag */ +static int wpaint__setSolidDrawOptions_facemask(void *userData, int index, int *drawSmooth_r) +{ + Mesh *me = (Mesh*)userData; + MFace *mface = &me->mface[index]; + if (mface->flag & ME_HIDE) return 0; + *drawSmooth_r = 1; + return 1; +} + static void draw_mesh_text(Scene *scene, Object *ob, int glsl) { Mesh *me = ob->data; @@ -700,7 +710,7 @@ void draw_mesh_textured_old(Scene *scene, View3D *v3d, RegionView3D *rv3d, Objec } else if(draw_flags & DRAW_FACE_SELECT) { if(ob->mode & OB_MODE_WEIGHT_PAINT) - dm->drawMappedFaces(dm, wpaint__setSolidDrawOptions, GPU_enable_material, NULL, me, 1); + dm->drawMappedFaces(dm, wpaint__setSolidDrawOptions_facemask, GPU_enable_material, NULL, me, 1); else dm->drawMappedFacesTex(dm, me->mface ? draw_tface_mapped__set_draw : NULL, NULL, me); } @@ -857,7 +867,7 @@ void draw_mesh_textured(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *o /* weight paint mode exception */ int useColors= 1; - dm->drawMappedFaces(dm, wpaint__setSolidDrawOptions, + dm->drawMappedFaces(dm, wpaint__setSolidDrawOptions_material, GPU_enable_material, NULL, ob->data, useColors); } else { diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 1ee765522be..afe11cdd37f 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -2675,7 +2675,7 @@ static void draw_em_measure_stats(View3D *v3d, Object *ob, EditMesh *em, UnitSet EditFace *efa; float v1[3], v2[3], v3[3], v4[3], vmid[3]; float fvec[3]; - char val[32]; /* Stores the measurement display text here */ + char numstr[32]; /* Stores the measurement display text here */ const char *conv_float; /* Use a float conversion matching the grid size */ unsigned char col[4]= {0, 0, 0, 255}; /* color of the text to draw */ float area; /* area of the face */ @@ -2708,11 +2708,11 @@ static void draw_em_measure_stats(View3D *v3d, Object *ob, EditMesh *em, UnitSet mul_mat3_m4_v3(ob->obmat, v2); } if(unit->system) - bUnit_AsString(val, sizeof(val), len_v3v3(v1, v2)*unit->scale_length, 3, unit->system, B_UNIT_LENGTH, do_split, FALSE); + bUnit_AsString(numstr, sizeof(numstr), len_v3v3(v1, v2)*unit->scale_length, 3, unit->system, B_UNIT_LENGTH, do_split, FALSE); else - sprintf(val, conv_float, len_v3v3(v1, v2)); + sprintf(numstr, conv_float, len_v3v3(v1, v2)); - view3d_cached_text_draw_add(vmid, val, 0, V3D_CACHE_TEXT_ASCII, col); + view3d_cached_text_draw_add(vmid, numstr, 0, V3D_CACHE_TEXT_ASCII, col); } } } @@ -2742,11 +2742,11 @@ static void draw_em_measure_stats(View3D *v3d, Object *ob, EditMesh *em, UnitSet area = area_tri_v3(v1, v2, v3); if(unit->system) - bUnit_AsString(val, sizeof(val), area*unit->scale_length, 3, unit->system, B_UNIT_LENGTH, do_split, FALSE); // XXX should be B_UNIT_AREA + bUnit_AsString(numstr, sizeof(numstr), area*unit->scale_length, 3, unit->system, B_UNIT_LENGTH, do_split, FALSE); // XXX should be B_UNIT_AREA else - sprintf(val, conv_float, area); + sprintf(numstr, conv_float, area); - view3d_cached_text_draw_add(efa->cent, val, 0, V3D_CACHE_TEXT_ASCII, col); + view3d_cached_text_draw_add(efa->cent, numstr, 0, V3D_CACHE_TEXT_ASCII, col); } } } @@ -2780,31 +2780,31 @@ static void draw_em_measure_stats(View3D *v3d, Object *ob, EditMesh *em, UnitSet if( (e4->f & e1->f & SELECT) || (do_moving && (efa->v1->f & SELECT)) ) { /* Vec 1 */ - sprintf(val,"%.3g", RAD2DEGF(angle_v3v3v3(v4, v1, v2))); + sprintf(numstr,"%.3g", RAD2DEGF(angle_v3v3v3(v4, v1, v2))); interp_v3_v3v3(fvec, efa->cent, efa->v1->co, 0.8f); - view3d_cached_text_draw_add(fvec, val, 0, V3D_CACHE_TEXT_ASCII, col); + view3d_cached_text_draw_add(fvec, numstr, 0, V3D_CACHE_TEXT_ASCII, col); } if( (e1->f & e2->f & SELECT) || (do_moving && (efa->v2->f & SELECT)) ) { /* Vec 2 */ - sprintf(val,"%.3g", RAD2DEGF(angle_v3v3v3(v1, v2, v3))); + sprintf(numstr,"%.3g", RAD2DEGF(angle_v3v3v3(v1, v2, v3))); interp_v3_v3v3(fvec, efa->cent, efa->v2->co, 0.8f); - view3d_cached_text_draw_add(fvec, val, 0, V3D_CACHE_TEXT_ASCII, col); + view3d_cached_text_draw_add(fvec, numstr, 0, V3D_CACHE_TEXT_ASCII, col); } if( (e2->f & e3->f & SELECT) || (do_moving && (efa->v3->f & SELECT)) ) { /* Vec 3 */ if(efa->v4) - sprintf(val,"%.3g", RAD2DEGF(angle_v3v3v3(v2, v3, v4))); + sprintf(numstr,"%.3g", RAD2DEGF(angle_v3v3v3(v2, v3, v4))); else - sprintf(val,"%.3g", RAD2DEGF(angle_v3v3v3(v2, v3, v1))); + sprintf(numstr,"%.3g", RAD2DEGF(angle_v3v3v3(v2, v3, v1))); interp_v3_v3v3(fvec, efa->cent, efa->v3->co, 0.8f); - view3d_cached_text_draw_add(fvec, val, 0, V3D_CACHE_TEXT_ASCII, col); + view3d_cached_text_draw_add(fvec, numstr, 0, V3D_CACHE_TEXT_ASCII, col); } /* Vec 4 */ if(efa->v4) { if( (e3->f & e4->f & SELECT) || (do_moving && (efa->v4->f & SELECT)) ) { - sprintf(val,"%.3g", RAD2DEGF(angle_v3v3v3(v3, v4, v1))); + sprintf(numstr,"%.3g", RAD2DEGF(angle_v3v3v3(v3, v4, v1))); interp_v3_v3v3(fvec, efa->cent, efa->v4->co, 0.8f); - view3d_cached_text_draw_add(fvec, val, 0, V3D_CACHE_TEXT_ASCII, col); + view3d_cached_text_draw_add(fvec, numstr, 0, V3D_CACHE_TEXT_ASCII, col); } } } @@ -2817,7 +2817,7 @@ static void draw_em_indices(EditMesh *em) EditFace *f; EditVert *v; int i; - char val[32]; + char numstr[32]; float pos[3]; unsigned char col[4]; @@ -2827,8 +2827,8 @@ static void draw_em_indices(EditMesh *em) UI_GetThemeColor3ubv(TH_DRAWEXTRA_FACEANG, col); for (v = em->verts.first, i = 0; v; v = v->next, i++) { if (v->f & SELECT) { - sprintf(val, "%d", i); - view3d_cached_text_draw_add(v->co, val, 0, V3D_CACHE_TEXT_ASCII, col); + sprintf(numstr, "%d", i); + view3d_cached_text_draw_add(v->co, numstr, 0, V3D_CACHE_TEXT_ASCII, col); } } } @@ -2837,9 +2837,9 @@ static void draw_em_indices(EditMesh *em) UI_GetThemeColor3ubv(TH_DRAWEXTRA_EDGELEN, col); for (e = em->edges.first, i = 0; e; e = e->next, i++) { if (e->f & SELECT) { - sprintf(val, "%d", i); + sprintf(numstr, "%d", i); mid_v3_v3v3(pos, e->v1->co, e->v2->co); - view3d_cached_text_draw_add(pos, val, 0, V3D_CACHE_TEXT_ASCII, col); + view3d_cached_text_draw_add(pos, numstr, 0, V3D_CACHE_TEXT_ASCII, col); } } } @@ -2848,8 +2848,8 @@ static void draw_em_indices(EditMesh *em) UI_GetThemeColor3ubv(TH_DRAWEXTRA_FACEAREA, col); for (f = em->faces.first, i = 0; f; f = f->next, i++) { if (f->f & SELECT) { - sprintf(val, "%d", i); - view3d_cached_text_draw_add(f->cent, val, 0, V3D_CACHE_TEXT_ASCII, col); + sprintf(numstr, "%d", i); + view3d_cached_text_draw_add(f->cent, numstr, 0, V3D_CACHE_TEXT_ASCII, col); } } } @@ -3026,8 +3026,6 @@ static void draw_em_fancy(Scene *scene, View3D *v3d, RegionView3D *rv3d, draw_em_fancy_edges(scene, v3d, me, cageDM, 0, eed_act); } if(em) { -// XXX retopo_matrix_update(v3d); - draw_em_fancy_verts(scene, v3d, ob, cageDM, eve_act); if(me->drawflag & ME_DRAWNORMALS) { @@ -3206,6 +3204,7 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D bglPolygonOffset(rv3d->dist, 0.0); glDepthMask(1); glDisable(GL_LINE_STIPPLE); + glDisable(GL_BLEND); GPU_disable_material(); @@ -4068,7 +4067,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv int a, totpart, totpoint=0, totve=0, drawn, draw_as, totchild=0; int select=ob->flag&SELECT, create_cdata=0, need_v=0; GLint polygonmode[2]; - char val[32]; + char numstr[32]; unsigned char tcol[4]= {0, 0, 0, 255}; /* 1. */ @@ -4456,8 +4455,8 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv if((part->draw & PART_DRAW_NUM || part->draw & PART_DRAW_HEALTH) && (v3d->flag2 & V3D_RENDER_OVERRIDE)==0){ float vec_txt[3]; - char *val_pos= val; - val[0]= '\0'; + char *val_pos= numstr; + numstr[0]= '\0'; if(part->draw&PART_DRAW_NUM) { if(a < totpart && (part->draw & PART_DRAW_HEALTH) && (part->phystype==PART_PHYS_BOIDS)) { @@ -4476,7 +4475,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv /* in path drawing state.co is the end point */ /* use worldspace beause object matrix is already applied */ mul_v3_m4v3(vec_txt, ob->imat, state.co); - view3d_cached_text_draw_add(vec_txt, val, 10, V3D_CACHE_TEXT_WORLDSPACE|V3D_CACHE_TEXT_ASCII, tcol); + view3d_cached_text_draw_add(vec_txt, numstr, 10, V3D_CACHE_TEXT_WORLDSPACE|V3D_CACHE_TEXT_ASCII, tcol); } } } @@ -4565,10 +4564,10 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv for(a=0, pa=psys->particles; a<totpart; a++, pa++){ float vec_txt[3]; - sprintf(val, "%i", a); + BLI_snprintf(numstr, sizeof(numstr), "%i", a); /* use worldspace beause object matrix is already applied */ mul_v3_m4v3(vec_txt, ob->imat, cache[a]->co); - view3d_cached_text_draw_add(vec_txt, val, 10, V3D_CACHE_TEXT_WORLDSPACE|V3D_CACHE_TEXT_ASCII, tcol); + view3d_cached_text_draw_add(vec_txt, numstr, 10, V3D_CACHE_TEXT_WORLDSPACE|V3D_CACHE_TEXT_ASCII, tcol); } } } @@ -5353,8 +5352,6 @@ static void drawnurb(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base, short hide_handles = (cu->drawflag & CU_HIDE_HANDLES); int index; -// XXX retopo_matrix_update(v3d); - /* DispList */ UI_ThemeColor(TH_WIRE); drawDispList(scene, v3d, rv3d, base, dt); diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index cac5d856652..f2906ca9559 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -154,15 +154,23 @@ RegionView3D *ED_view3d_context_rv3d(bContext *C) /* ideally would return an rv3d but in some cases the region is needed too * so return that, the caller can then access the ar->regiondata */ -ARegion *ED_view3d_context_region_unlock(bContext *C) +int ED_view3d_context_user_region(bContext *C, View3D **v3d_r, ARegion **ar_r) { ScrArea *sa= CTX_wm_area(C); + + *v3d_r = NULL; + *ar_r = NULL; + if(sa && sa->spacetype==SPACE_VIEW3D) { ARegion *ar= CTX_wm_region(C); + View3D *v3d = (View3D *)sa->spacedata.first; + if(ar) { RegionView3D *rv3d= ar->regiondata; if(rv3d && rv3d->viewlock == 0) { - return ar; + *v3d_r = v3d; + *ar_r = ar; + return 1; } else { ARegion *ar_unlock_user= NULL; @@ -182,12 +190,22 @@ ARegion *ED_view3d_context_region_unlock(bContext *C) } /* camera/perspective view get priority when the active region is locked */ - if(ar_unlock_user) return ar_unlock_user; - if(ar_unlock) return ar_unlock; + if(ar_unlock_user) { + *v3d_r = v3d; + *ar_r = ar_unlock_user; + return 1; + } + + if(ar_unlock) { + *v3d_r = v3d; + *ar_r = ar_unlock; + return 1; + } } } } - return NULL; + + return 0; } /* Most of the time this isn't needed since you could assume the view matrix was @@ -553,7 +571,6 @@ static void view3d_main_area_free(ARegion *ar) if(rv3d->localvd) MEM_freeN(rv3d->localvd); if(rv3d->clipbb) MEM_freeN(rv3d->clipbb); - // XXX retopo_free_view_data(rv3d); if(rv3d->ri) { // XXX BIF_view3d_previewrender_free(rv3d); } diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c index 1b923c7a0cd..985d70d2144 100644 --- a/source/blender/editors/space_view3d/view3d_buttons.c +++ b/source/blender/editors/space_view3d/view3d_buttons.c @@ -188,7 +188,7 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float dg = BLI_findlink (&ob->defbase, dvert->dw[i].def_nr); if(dg) { max+= BLI_snprintf(str, sizeof(str), "%s %%x%d|", dg->name, dvert->dw[i].def_nr); - if(max<320) strcat(defstr, str); + if (max < sizeof(str)) strcat(defstr, str); } if(tfp->curdef==dvert->dw[i].def_nr) { @@ -1334,7 +1334,7 @@ static void view3d_panel_preview(bContext *C, ARegion *ar, short cntrl) // VIEW3 View3D *v3d= sa->spacedata.first; int ofsx, ofsy; - block= uiBeginBlock(C, ar, "view3d_panel_preview", UI_EMBOSS); + block= uiBeginBlock(C, ar, __func__, UI_EMBOSS); uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | UI_PNL_SCALE | cntrl); uiSetPanelHandler(VIEW3D_HANDLER_PREVIEW); // for close and esc diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index d3a0ee27256..ad85ff6dea8 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -863,24 +863,24 @@ static void draw_selected_name(Scene *scene, Object *ob) } } if(name && markern) - sprintf(info, "(%d) %s %s <%s>", CFRA, ob->id.name+2, name, markern); + BLI_snprintf(info, sizeof(info), "(%d) %s %s <%s>", CFRA, ob->id.name+2, name, markern); else if(name) - sprintf(info, "(%d) %s %s", CFRA, ob->id.name+2, name); + BLI_snprintf(info, sizeof(info), "(%d) %s %s", CFRA, ob->id.name+2, name); else - sprintf(info, "(%d) %s", CFRA, ob->id.name+2); + BLI_snprintf(info, sizeof(info), "(%d) %s", CFRA, ob->id.name+2); } else if(ELEM3(ob->type, OB_MESH, OB_LATTICE, OB_CURVE)) { Key *key= NULL; KeyBlock *kb = NULL; - char shapes[75]; + char shapes[MAX_NAME + 10]; /* try to display active shapekey too */ - shapes[0] = 0; + shapes[0] = '\0'; key = ob_get_key(ob); if(key){ kb = BLI_findlink(&key->block, ob->shapenr-1); if(kb){ - sprintf(shapes, ": %s ", kb->name); + BLI_snprintf(shapes, sizeof(shapes), ": %s ", kb->name); if(ob->shapeflag == OB_SHAPE_LOCK){ strcat(shapes, " (Pinned)"); } @@ -888,16 +888,16 @@ static void draw_selected_name(Scene *scene, Object *ob) } if(markern) - sprintf(info, "(%d) %s %s <%s>", CFRA, ob->id.name+2, shapes, markern); + BLI_snprintf(info, sizeof(info), "(%d) %s %s <%s>", CFRA, ob->id.name+2, shapes, markern); else - sprintf(info, "(%d) %s %s", CFRA, ob->id.name+2, shapes); + BLI_snprintf(info, sizeof(info), "(%d) %s %s", CFRA, ob->id.name+2, shapes); } else { /* standard object */ if (markern) - sprintf(info, "(%d) %s <%s>", CFRA, ob->id.name+2, markern); + BLI_snprintf(info, sizeof(info), "(%d) %s <%s>", CFRA, ob->id.name+2, markern); else - sprintf(info, "(%d) %s", CFRA, ob->id.name+2); + BLI_snprintf(info, sizeof(info), "(%d) %s", CFRA, ob->id.name+2); } /* color depends on whether there is a keyframe */ @@ -909,9 +909,9 @@ static void draw_selected_name(Scene *scene, Object *ob) else { /* no object */ if (markern) - sprintf(info, "(%d) <%s>", CFRA, markern); + BLI_snprintf(info, sizeof(info), "(%d) <%s>", CFRA, markern); else - sprintf(info, "(%d)", CFRA); + BLI_snprintf(info, sizeof(info), "(%d)", CFRA); /* color is always white */ UI_ThemeColor(TH_TEXT_HI); @@ -920,7 +920,7 @@ static void draw_selected_name(Scene *scene, Object *ob) if (U.uiflag & USER_SHOW_ROTVIEWICON) offset = 14 + (U.rvisize * 2); - BLF_draw_default(offset, 10, 0.0f, info, sizeof(info)-1); + BLF_draw_default(offset, 10, 0.0f, info, sizeof(info)); } static void view3d_camera_border(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D *rv3d, rctf *viewborder_r, short no_shift, short no_zoom) @@ -2251,32 +2251,46 @@ CustomDataMask ED_view3d_datamask(Scene *scene, View3D *v3d) return mask; } + +CustomDataMask ED_view3d_object_datamask(Scene *scene) +{ + Object *ob= scene->basact ? scene->basact->object : NULL; + CustomDataMask mask= 0; + + if (ob) { + /* check if we need tfaces & mcols due to face select or texture paint */ + if (paint_facesel_test(ob) || (ob->mode & OB_MODE_TEXTURE_PAINT)) { + mask |= CD_MASK_MTFACE | CD_MASK_MCOL; + } + + /* check if we need mcols due to vertex paint or weightpaint */ + if (ob->mode & OB_MODE_VERTEX_PAINT) { + mask |= CD_MASK_MCOL; + } + + if (ob->mode & OB_MODE_WEIGHT_PAINT) { + mask |= CD_MASK_WEIGHT_MCOL; + } + } + + return mask; +} + /* goes over all modes and view3d settings */ -CustomDataMask ED_viewedit_datamask(bScreen *screen) +CustomDataMask ED_view3d_screen_datamask(bScreen *screen) { Scene *scene= screen->scene; - Object *ob= scene->basact ? scene->basact->object : NULL; CustomDataMask mask = CD_MASK_BAREMESH; ScrArea *sa; - /* check if we need tfaces & mcols due to face select or texture paint */ - if(paint_facesel_test(ob) || (ob && ob->mode & OB_MODE_TEXTURE_PAINT)) - mask |= CD_MASK_MTFACE | CD_MASK_MCOL; - /* check if we need tfaces & mcols due to view mode */ for(sa = screen->areabase.first; sa; sa = sa->next) { if(sa->spacetype == SPACE_VIEW3D) { mask |= ED_view3d_datamask(scene, (View3D *)sa->spacedata.first); } } - - /* check if we need mcols due to vertex paint or weightpaint */ - if(ob) { - if(ob->mode & OB_MODE_VERTEX_PAINT) - mask |= CD_MASK_MCOL; - if(ob->mode & OB_MODE_WEIGHT_PAINT) - mask |= CD_MASK_WEIGHT_MCOL; - } + + mask |= ED_view3d_object_datamask(scene); return mask; } @@ -2609,7 +2623,7 @@ static void draw_viewport_fps(Scene *scene, ARegion *ar) BLI_snprintf(printable, sizeof(printable), "fps: %i", (int)(fps+0.5f)); } - BLF_draw_default_ascii(22, ar->winy-17, 0.0f, printable, sizeof(printable)-1); + BLF_draw_default_ascii(22, ar->winy-17, 0.0f, printable, sizeof(printable)); } static int view3d_main_area_draw_engine(const bContext *C, ARegion *ar) @@ -2876,14 +2890,15 @@ static void view3d_main_area_draw_info(const bContext *C, ARegion *ar, const cha draw_viewport_name(ar, v3d); } if (grid_unit) { /* draw below the viewport name */ - char tstr[32]= ""; + char numstr[32]= ""; UI_ThemeColor(TH_TEXT_HI); if(v3d->grid != 1.0f) { - BLI_snprintf(tstr, sizeof(tstr), "%s x %.4g", grid_unit, v3d->grid); + BLI_snprintf(numstr, sizeof(numstr), "%s x %.4g", grid_unit, v3d->grid); } - BLF_draw_default_ascii(22, ar->winy-(USER_SHOW_VIEWPORTNAME?40:20), 0.0f, tstr[0]?tstr : grid_unit, sizeof(tstr)); /* XXX, use real length */ + BLF_draw_default_ascii(22, ar->winy-(USER_SHOW_VIEWPORTNAME?40:20), 0.0f, + numstr[0] ? numstr : grid_unit, sizeof(numstr)); } } diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index fa970f7f9d8..224df5b9f80 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -1585,8 +1585,8 @@ static int viewzoom_exec(bContext *C, wmOperator *op) v3d= sa->spacedata.first; rv3d= ar->regiondata; - mx= RNA_property_is_set(op->ptr, "mx") ? RNA_int_get(op->ptr, "mx") : ar->winx / 2; - my= RNA_property_is_set(op->ptr, "my") ? RNA_int_get(op->ptr, "my") : ar->winy / 2; + mx= RNA_struct_property_is_set(op->ptr, "mx") ? RNA_int_get(op->ptr, "mx") : ar->winx / 2; + my= RNA_struct_property_is_set(op->ptr, "my") ? RNA_int_get(op->ptr, "my") : ar->winy / 2; use_cam_zoom= (rv3d->persp==RV3D_CAMOB) && !(rv3d->is_persp && ED_view3d_camera_lock_check(v3d, rv3d)); @@ -1667,12 +1667,12 @@ static int viewzoom_invoke(bContext *C, wmOperator *op, wmEvent *event) vod= op->customdata; /* if one or the other zoom position aren't set, set from event */ - if (!RNA_property_is_set(op->ptr, "mx") || !RNA_property_is_set(op->ptr, "my")) { + if (!RNA_struct_property_is_set(op->ptr, "mx") || !RNA_struct_property_is_set(op->ptr, "my")) { RNA_int_set(op->ptr, "mx", event->x); RNA_int_set(op->ptr, "my", event->y); } - if(RNA_property_is_set(op->ptr, "delta")) { + if(RNA_struct_property_is_set(op->ptr, "delta")) { viewzoom_exec(C, op); } else { @@ -1880,12 +1880,12 @@ static int viewdolly_invoke(bContext *C, wmOperator *op, wmEvent *event) vod= op->customdata; /* if one or the other zoom position aren't set, set from event */ - if (!RNA_property_is_set(op->ptr, "mx") || !RNA_property_is_set(op->ptr, "my")) { + if (!RNA_struct_property_is_set(op->ptr, "mx") || !RNA_struct_property_is_set(op->ptr, "my")) { RNA_int_set(op->ptr, "mx", event->x); RNA_int_set(op->ptr, "my", event->y); } - if(RNA_property_is_set(op->ptr, "delta")) { + if(RNA_struct_property_is_set(op->ptr, "delta")) { viewdolly_exec(C, op); } else { @@ -2653,13 +2653,16 @@ static void axis_set_view(bContext *C, View3D *v3d, ARegion *ar, float q1, float static int viewnumpad_exec(bContext *C, wmOperator *op) { - View3D *v3d = CTX_wm_view3d(C); - ARegion *ar= ED_view3d_context_region_unlock(C); - RegionView3D *rv3d= ar->regiondata; /* no NULL check is needed, poll checks */ + View3D *v3d; + ARegion *ar; + RegionView3D *rv3d; Scene *scene= CTX_data_scene(C); - static int perspo=RV3D_PERSP; + static int perspo = RV3D_PERSP; int viewnum, align_active, nextperspo; + ED_view3d_context_user_region(C, &v3d, &ar); + rv3d = ar->regiondata; + viewnum = RNA_enum_get(op->ptr, "type"); align_active = RNA_boolean_get(op->ptr, "align_active"); @@ -2783,7 +2786,7 @@ void VIEW3D_OT_viewnumpad(wmOperatorType *ot) /* api callbacks */ ot->exec= viewnumpad_exec; - ot->poll= ED_operator_rv3d_unlock_poll; + ot->poll= ED_operator_rv3d_user_region_poll; /* flags */ ot->flag= 0; @@ -2801,12 +2804,16 @@ static EnumPropertyItem prop_view_orbit_items[] = { static int vieworbit_exec(bContext *C, wmOperator *op) { - View3D *v3d= CTX_wm_view3d(C); - ARegion *ar= ED_view3d_context_region_unlock(C); - RegionView3D *rv3d= ar->regiondata; /* no NULL check is needed, poll checks */ + View3D *v3d; + ARegion *ar; + RegionView3D *rv3d; float phi, q1[4], new_quat[4]; int orbitdir; + /* no NULL check is needed, poll checks */ + ED_view3d_context_user_region(C, &v3d, &ar); + rv3d = ar->regiondata; + orbitdir = RNA_enum_get(op->ptr, "type"); if(rv3d->viewlock==0) { @@ -2852,7 +2859,7 @@ void VIEW3D_OT_view_orbit(wmOperatorType *ot) /* api callbacks */ ot->exec= vieworbit_exec; - ot->poll= ED_operator_rv3d_unlock_poll; + ot->poll= ED_operator_rv3d_user_region_poll; /* flags */ ot->flag= 0; @@ -2909,8 +2916,13 @@ void VIEW3D_OT_view_pan(wmOperatorType *ot) static int viewpersportho_exec(bContext *C, wmOperator *UNUSED(op)) { - ARegion *ar= ED_view3d_context_region_unlock(C); - RegionView3D *rv3d= ar->regiondata; /* no NULL check is needed, poll checks */ + View3D *v3d_dummy; + ARegion *ar; + RegionView3D *rv3d; + + /* no NULL check is needed, poll checks */ + ED_view3d_context_user_region(C, &v3d_dummy, &ar); + rv3d = ar->regiondata; if(rv3d->viewlock==0) { if(rv3d->persp!=RV3D_ORTHO) @@ -2932,7 +2944,7 @@ void VIEW3D_OT_view_persportho(wmOperatorType *ot) /* api callbacks */ ot->exec= viewpersportho_exec; - ot->poll= ED_operator_rv3d_unlock_poll; + ot->poll= ED_operator_rv3d_user_region_poll; /* flags */ ot->flag= 0; @@ -2960,16 +2972,16 @@ static int background_image_add_invoke(bContext *C, wmOperator *op, wmEvent *UNU View3D *v3d= CTX_wm_view3d(C); Image *ima= NULL; BGpic *bgpic; - char name[32]; + char name[MAX_ID_NAME-2]; /* check input variables */ - if(RNA_property_is_set(op->ptr, "filepath")) { + if(RNA_struct_property_is_set(op->ptr, "filepath")) { char path[FILE_MAX]; RNA_string_get(op->ptr, "filepath", path); ima= BKE_add_image_file(path); } - else if(RNA_property_is_set(op->ptr, "name")) { + else if(RNA_struct_property_is_set(op->ptr, "name")) { RNA_string_get(op->ptr, "name", name); ima= (Image *)find_id("IM", name); } @@ -3007,7 +3019,7 @@ void VIEW3D_OT_background_image_add(wmOperatorType *ot) ot->flag = 0; /* properties */ - RNA_def_string(ot->srna, "name", "Image", 24, "Name", "Image name to assign"); + RNA_def_string(ot->srna, "name", "Image", MAX_ID_NAME-2, "Name", "Image name to assign"); RNA_def_string(ot->srna, "filepath", "Path", FILE_MAX, "Filepath", "Path to image file"); } diff --git a/source/blender/editors/space_view3d/view3d_intern.h b/source/blender/editors/space_view3d/view3d_intern.h index 42f58ba26f7..e7c9a1bd3a0 100644 --- a/source/blender/editors/space_view3d/view3d_intern.h +++ b/source/blender/editors/space_view3d/view3d_intern.h @@ -152,6 +152,7 @@ void VIEW3D_OT_select_extend(struct wmOperatorType *ot); void VIEW3D_OT_select_circle(struct wmOperatorType *ot); void VIEW3D_OT_select_border(struct wmOperatorType *ot); void VIEW3D_OT_select_lasso(struct wmOperatorType *ot); +void VIEW3D_OT_select_menu(struct wmOperatorType *ot); void VIEW3D_OT_smoothview(struct wmOperatorType *ot); void VIEW3D_OT_camera_to_view(struct wmOperatorType *ot); diff --git a/source/blender/editors/space_view3d/view3d_ops.c b/source/blender/editors/space_view3d/view3d_ops.c index aeb850243c5..4594544b4f8 100644 --- a/source/blender/editors/space_view3d/view3d_ops.c +++ b/source/blender/editors/space_view3d/view3d_ops.c @@ -85,6 +85,7 @@ void view3d_operatortypes(void) WM_operatortype_append(VIEW3D_OT_enable_manipulator); WM_operatortype_append(VIEW3D_OT_cursor3d); WM_operatortype_append(VIEW3D_OT_select_lasso); + WM_operatortype_append(VIEW3D_OT_select_menu); WM_operatortype_append(VIEW3D_OT_camera_to_view); WM_operatortype_append(VIEW3D_OT_camera_to_view_selected); WM_operatortype_append(VIEW3D_OT_object_as_camera); @@ -261,33 +262,54 @@ void view3d_keymap(wmKeyConfig *keyconf) RNA_string_set(kmi->ptr, "value_2", "SOLID"); /* selection*/ - WM_keymap_add_item(keymap, "VIEW3D_OT_select", SELECTMOUSE, KM_PRESS, 0, 0); + kmi = WM_keymap_add_item(keymap, "VIEW3D_OT_select", SELECTMOUSE, KM_PRESS, 0, 0); + RNA_boolean_set(kmi->ptr, "extend", FALSE); + RNA_boolean_set(kmi->ptr, "center", FALSE); + RNA_boolean_set(kmi->ptr, "object", FALSE); + RNA_boolean_set(kmi->ptr, "enumerate", FALSE); kmi = WM_keymap_add_item(keymap, "VIEW3D_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT, 0); RNA_boolean_set(kmi->ptr, "extend", TRUE); + RNA_boolean_set(kmi->ptr, "center", FALSE); + RNA_boolean_set(kmi->ptr, "object", FALSE); + RNA_boolean_set(kmi->ptr, "enumerate", FALSE); kmi= WM_keymap_add_item(keymap, "VIEW3D_OT_select", SELECTMOUSE, KM_PRESS, KM_CTRL, 0); + RNA_boolean_set(kmi->ptr, "extend", FALSE); RNA_boolean_set(kmi->ptr, "center", TRUE); RNA_boolean_set(kmi->ptr, "object", TRUE); /* use Ctrl+Select for 2 purposes */ + RNA_boolean_set(kmi->ptr, "enumerate", FALSE); kmi= WM_keymap_add_item(keymap, "VIEW3D_OT_select", SELECTMOUSE, KM_PRESS, KM_ALT, 0); + RNA_boolean_set(kmi->ptr, "extend", FALSE); + RNA_boolean_set(kmi->ptr, "center", FALSE); + RNA_boolean_set(kmi->ptr, "object", FALSE); RNA_boolean_set(kmi->ptr, "enumerate", TRUE); /* selection key-combinations */ kmi = WM_keymap_add_item(keymap, "VIEW3D_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT|KM_CTRL, 0); - RNA_boolean_set(kmi->ptr, "center", TRUE); RNA_boolean_set(kmi->ptr, "extend", TRUE); + RNA_boolean_set(kmi->ptr, "center", TRUE); + RNA_boolean_set(kmi->ptr, "object", FALSE); + RNA_boolean_set(kmi->ptr, "enumerate", FALSE); kmi = WM_keymap_add_item(keymap, "VIEW3D_OT_select", SELECTMOUSE, KM_PRESS, KM_CTRL|KM_ALT, 0); + RNA_boolean_set(kmi->ptr, "extend", FALSE); RNA_boolean_set(kmi->ptr, "center", TRUE); + RNA_boolean_set(kmi->ptr, "object", FALSE); RNA_boolean_set(kmi->ptr, "enumerate", TRUE); kmi = WM_keymap_add_item(keymap, "VIEW3D_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT|KM_ALT, 0); RNA_boolean_set(kmi->ptr, "extend", TRUE); + RNA_boolean_set(kmi->ptr, "center", FALSE); + RNA_boolean_set(kmi->ptr, "object", FALSE); RNA_boolean_set(kmi->ptr, "enumerate", TRUE); kmi = WM_keymap_add_item(keymap, "VIEW3D_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT|KM_CTRL|KM_ALT, 0); - RNA_boolean_set(kmi->ptr, "center", TRUE); RNA_boolean_set(kmi->ptr, "extend", TRUE); + RNA_boolean_set(kmi->ptr, "center", TRUE); + RNA_boolean_set(kmi->ptr, "object", FALSE); RNA_boolean_set(kmi->ptr, "enumerate", TRUE); WM_keymap_add_item(keymap, "VIEW3D_OT_select_border", BKEY, KM_PRESS, 0, 0); - WM_keymap_add_item(keymap, "VIEW3D_OT_select_lasso", EVT_TWEAK_A, KM_ANY, KM_CTRL, 0); - RNA_boolean_set(WM_keymap_add_item(keymap, "VIEW3D_OT_select_lasso", EVT_TWEAK_A, KM_ANY, KM_SHIFT|KM_CTRL, 0)->ptr, "deselect", 1); + kmi = WM_keymap_add_item(keymap, "VIEW3D_OT_select_lasso", EVT_TWEAK_A, KM_ANY, KM_CTRL, 0); + RNA_boolean_set(kmi->ptr, "deselect", FALSE); + kmi = WM_keymap_add_item(keymap, "VIEW3D_OT_select_lasso", EVT_TWEAK_A, KM_ANY, KM_SHIFT|KM_CTRL, 0); + RNA_boolean_set(kmi->ptr, "deselect", TRUE); WM_keymap_add_item(keymap, "VIEW3D_OT_select_circle", CKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "VIEW3D_OT_clip_border", BKEY, KM_PRESS, KM_ALT, 0); diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index 551eb3cd6b5..ce93ca56a65 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -74,6 +74,7 @@ #include "RNA_access.h" #include "RNA_define.h" +#include "RNA_enum_types.h" #include "ED_armature.h" #include "ED_curve.h" @@ -1045,7 +1046,104 @@ static unsigned int samplerect(unsigned int *buf, int size, unsigned int dontdo) /* The max number of menu items in an object select menu */ +typedef struct SelMenuItemF { + char idname[MAX_ID_NAME-2]; + int icon; +} SelMenuItemF; + #define SEL_MENU_SIZE 22 +static SelMenuItemF object_mouse_select_menu_data[SEL_MENU_SIZE]; + +/* special (crappy) operator only for menu select */ +static EnumPropertyItem *object_select_menu_enum_itemf(bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), int *free) +{ + EnumPropertyItem *item= NULL, item_tmp= {0}; + int totitem= 0; + int i= 0; + + /* dont need context but avoid docgen using this */ + if (C == NULL || object_mouse_select_menu_data[i].idname[0] == '\0') { + return DummyRNA_NULL_items; + } + + for (; i < SEL_MENU_SIZE && object_mouse_select_menu_data[i].idname[0] != '\0'; i++) { + item_tmp.name= object_mouse_select_menu_data[i].idname; + item_tmp.identifier= object_mouse_select_menu_data[i].idname; + item_tmp.value= i; + item_tmp.icon= object_mouse_select_menu_data[i].icon; + RNA_enum_item_add(&item, &totitem, &item_tmp); + } + + RNA_enum_item_end(&item, &totitem); + *free= 1; + + return item; +} + +static int object_select_menu_exec(bContext *C, wmOperator *op) +{ + int name_index= RNA_enum_get(op->ptr, "name"); + short extend= RNA_boolean_get(op->ptr, "extend"); + short changed = 0; + const char *name= object_mouse_select_menu_data[name_index].idname; + + if(!extend) { + CTX_DATA_BEGIN(C, Base*, base, selectable_bases) { + if(base->flag & SELECT) { + ED_base_object_select(base, BA_DESELECT); + changed= 1; + } + } + CTX_DATA_END; + } + + CTX_DATA_BEGIN(C, Base*, base, selectable_bases) { + /* this is a bit dodjy, there should only be ONE object with this name, but library objects can mess this up */ + if(strcmp(name, base->object->id.name+2)==0) { + ED_base_object_activate(C, base); + ED_base_object_select(base, BA_SELECT); + changed= 1; + } + } + CTX_DATA_END; + + /* weak but ensures we activate menu again before using the enum */ + memset(object_mouse_select_menu_data, 0, sizeof(object_mouse_select_menu_data)); + + /* undo? */ + if(changed) { + WM_event_add_notifier(C, NC_SCENE|ND_OB_SELECT, CTX_data_scene(C)); + return OPERATOR_FINISHED; + } + else { + return OPERATOR_CANCELLED; + } +} + +void VIEW3D_OT_select_menu(wmOperatorType *ot) +{ + PropertyRNA *prop; + + /* identifiers */ + ot->name= "Select Menu"; + ot->description = "Menu object selection"; + ot->idname= "VIEW3D_OT_select_menu"; + + /* api callbacks */ + ot->invoke= WM_menu_invoke; + ot->exec= object_select_menu_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + /* keyingset to use (dynamic enum) */ + prop= RNA_def_enum(ot->srna, "name", DummyRNA_NULL_items, 0, "Object Name", ""); + RNA_def_enum_funcs(prop, object_select_menu_enum_itemf); + RNA_def_property_flag(prop, PROP_HIDDEN); + ot->prop= prop; + + RNA_def_boolean(ot->srna, "extend", 0, "Extend", "Extend selection instead of deselecting everything first"); +} static void deselectall_except(Scene *scene, Base *b) /* deselect all except b */ { @@ -1060,7 +1158,7 @@ static void deselectall_except(Scene *scene, Base *b) /* deselect all except b } } -static Base *mouse_select_menu(bContext *C, ViewContext *vc, unsigned int *buffer, int hits, const int mval[2], short extend) +static Base *object_mouse_select_menu(bContext *C, ViewContext *vc, unsigned int *buffer, int hits, const int mval[2], short extend) { short baseCount = 0; short ok; @@ -1098,9 +1196,6 @@ static Base *mouse_select_menu(bContext *C, ViewContext *vc, unsigned int *buffe } CTX_DATA_END; - if(baseCount) - - if(baseCount==0) { return NULL; } @@ -1110,35 +1205,30 @@ static Base *mouse_select_menu(bContext *C, ViewContext *vc, unsigned int *buffe return base; } else { - /* UI */ - uiPopupMenu *pup= uiPupMenuBegin(C, "Select Object", ICON_NONE); - uiLayout *layout= uiPupMenuLayout(pup); - uiLayout *split= uiLayoutSplit(layout, 0, 0); - uiLayout *column= uiLayoutColumn(split, 0); + /* UI, full in static array values that we later use in an enum function */ LinkNode *node; + int i; + + memset(object_mouse_select_menu_data, 0, sizeof(object_mouse_select_menu_data)); - node= linklist; - while(node) { + for (node = linklist, i = 0; node; node= node->next, i++) { Base *base=node->link; Object *ob= base->object; char *name= ob->id.name+2; - /* annoying!, since we need to set 2 props cant use this. */ - /* uiItemStringO(column, name, 0, "OBJECT_OT_select_name", "name", name); */ - { - PointerRNA ptr; + BLI_strncpy(object_mouse_select_menu_data[i].idname, name, MAX_ID_NAME-2); + object_mouse_select_menu_data[i].icon = uiIconFromID(&ob->id); + } - WM_operator_properties_create(&ptr, "OBJECT_OT_select_name"); - RNA_string_set(&ptr, "name", name); - RNA_boolean_set(&ptr, "extend", extend); - uiItemFullO(column, "OBJECT_OT_select_name", name, uiIconFromID((ID *)ob), ptr.data, WM_OP_EXEC_DEFAULT, 0); - } + { + PointerRNA ptr; - node= node->next; + WM_operator_properties_create(&ptr, "VIEW3D_OT_select_menu"); + RNA_boolean_set(&ptr, "extend", extend); + WM_operator_name_call(C, "VIEW3D_OT_select_menu", WM_OP_INVOKE_DEFAULT, &ptr); + WM_operator_properties_free(&ptr); } - uiPupMenuEnd(C, pup); - BLI_linklist_free(linklist, NULL); return NULL; } @@ -1364,7 +1454,7 @@ static int mouse_select(bContext *C, const int mval[2], short extend, short obce /* note; shift+alt goes to group-flush-selecting */ if(enumerate) { - basact= mouse_select_menu(C, &vc, NULL, 0, mval, extend); + basact= object_mouse_select_menu(C, &vc, NULL, 0, mval, extend); } else { base= startbase; while(base) { @@ -1401,7 +1491,7 @@ static int mouse_select(bContext *C, const int mval[2], short extend, short obce /* note; shift+alt goes to group-flush-selecting */ if(has_bones==0 && enumerate) { - basact= mouse_select_menu(C, &vc, buffer, hits, mval, extend); + basact= object_mouse_select_menu(C, &vc, buffer, hits, mval, extend); } else { basact= mouse_select_eval_buffer(&vc, buffer, hits, mval, startbase, has_bones); } diff --git a/source/blender/editors/space_view3d/view3d_toolbar.c b/source/blender/editors/space_view3d/view3d_toolbar.c index 49b1b3f723e..0705d066f26 100644 --- a/source/blender/editors/space_view3d/view3d_toolbar.c +++ b/source/blender/editors/space_view3d/view3d_toolbar.c @@ -177,7 +177,7 @@ static uiBlock *tool_search_menu(bContext *C, ARegion *ar, void *arg_listbase) /* fake button, it holds space for search items */ uiDefBut(block, LABEL, 0, "", 10, 15, 150, uiSearchBoxhHeight(), NULL, 0, 0, 0, 0, NULL); - but= uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, OP_MAX_TYPENAME, 10, 0, 150, 19, 0, 0, ""); + but= uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, sizeof(search), 10, 0, 150, 19, 0, 0, ""); uiButSetSearchFunc(but, operator_search_cb, arg_listbase, operator_call_cb, NULL); uiBoundsBlock(block, 6); diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index aa444125287..11492ee7804 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -466,13 +466,18 @@ void VIEW3D_OT_camera_to_view_selected(wmOperatorType *ot) static int view3d_setobjectascamera_exec(bContext *C, wmOperator *UNUSED(op)) -{ - View3D *v3d = CTX_wm_view3d(C); - ARegion *ar= ED_view3d_context_region_unlock(C); - RegionView3D *rv3d= ar->regiondata; /* no NULL check is needed, poll checks */ +{ + View3D *v3d; + ARegion *ar; + RegionView3D *rv3d; + Scene *scene= CTX_data_scene(C); Object *ob = CTX_data_active_object(C); + /* no NULL check is needed, poll checks */ + ED_view3d_context_user_region(C, &v3d, &ar); + rv3d = ar->regiondata; + if(ob) { Object *camera_old= (rv3d->persp == RV3D_CAMOB) ? V3D_CAMERA_SCENE(scene, v3d) : NULL; rv3d->persp= RV3D_CAMOB; @@ -489,9 +494,12 @@ static int view3d_setobjectascamera_exec(bContext *C, wmOperator *UNUSED(op)) return OPERATOR_FINISHED; } -int ED_operator_rv3d_unlock_poll(bContext *C) +int ED_operator_rv3d_user_region_poll(bContext *C) { - return ED_view3d_context_region_unlock(C) != NULL; + View3D *v3d_dummy; + ARegion *ar_dummy; + + return ED_view3d_context_user_region(C, &v3d_dummy, &ar_dummy); } void VIEW3D_OT_object_as_camera(wmOperatorType *ot) @@ -504,7 +512,7 @@ void VIEW3D_OT_object_as_camera(wmOperatorType *ot) /* api callbacks */ ot->exec= view3d_setobjectascamera_exec; - ot->poll= ED_operator_rv3d_unlock_poll; + ot->poll= ED_operator_rv3d_user_region_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 1029888df23..1e1f6e4279e 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -1403,18 +1403,21 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op) if (t->flag & T_MODAL) { /* save settings if not set in operator */ - if (RNA_struct_find_property(op->ptr, "proportional") && !RNA_property_is_set(op->ptr, "proportional")) { + if ( (prop = RNA_struct_find_property(op->ptr, "proportional")) && !RNA_property_is_set(op->ptr, prop)) + { if (t->obedit) ts->proportional = proportional; else ts->proportional_objects = (proportional != PROP_EDIT_OFF); } - if (RNA_struct_find_property(op->ptr, "proportional_size") && !RNA_property_is_set(op->ptr, "proportional_size")) { + if ( (prop = RNA_struct_find_property(op->ptr, "proportional_size")) && !RNA_property_is_set(op->ptr, prop)) + { ts->proportional_size = t->prop_size; } - - if (RNA_struct_find_property(op->ptr, "proportional_edit_falloff") && !RNA_property_is_set(op->ptr, "proportional_edit_falloff")) { + + if ( (prop = RNA_struct_find_property(op->ptr, "proportional_edit_falloff")) && !RNA_property_is_set(op->ptr, prop)) + { ts->prop_mode = t->prop_mode; } @@ -1425,8 +1428,9 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op) ts->snap_flag &= ~SCE_SNAP; } - if(t->spacetype == SPACE_VIEW3D) { - if (RNA_struct_find_property(op->ptr, "constraint_orientation") && !RNA_property_is_set(op->ptr, "constraint_orientation")) { + if (t->spacetype == SPACE_VIEW3D) { + if ( (prop = RNA_struct_find_property(op->ptr, "constraint_orientation")) && !RNA_property_is_set(op->ptr, prop)) + { View3D *v3d = t->view; v3d->twmode = t->current_orientation; @@ -1441,17 +1445,17 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op) RNA_float_set(op->ptr, "proportional_size", t->prop_size); } - if (RNA_struct_find_property(op->ptr, "axis")) + if ((prop = RNA_struct_find_property(op->ptr, "axis"))) { - RNA_float_set_array(op->ptr, "axis", t->axis); + RNA_property_float_set_array(op->ptr, prop, t->axis); } - if (RNA_struct_find_property(op->ptr, "mirror")) + if ((prop = RNA_struct_find_property(op->ptr, "mirror"))) { - RNA_boolean_set(op->ptr, "mirror", t->flag & T_MIRROR); + RNA_property_boolean_set(op->ptr, prop, t->flag & T_MIRROR); } - if (RNA_struct_find_property(op->ptr, "constraint_axis")) + if ((prop = RNA_struct_find_property(op->ptr, "constraint_axis"))) { /* constraint orientation can be global, event if user selects something else * so use the orientation in the constraint if set @@ -1475,7 +1479,7 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op) } } - RNA_boolean_set_array(op->ptr, "constraint_axis", constraint_axis); + RNA_property_boolean_set_array(op->ptr, prop, constraint_axis); } } @@ -1483,6 +1487,7 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op) int initTransform(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event, int mode) { int options = 0; + PropertyRNA *prop; t->context = C; @@ -1490,9 +1495,12 @@ int initTransform(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event, int t->state = TRANS_STARTING; - if(RNA_struct_find_property(op->ptr, "texture_space")) - if(RNA_boolean_get(op->ptr, "texture_space")) + if ( (prop = RNA_struct_find_property(op->ptr, "texture_space")) && RNA_property_is_set(op->ptr, prop)) + { + if(RNA_property_boolean_get(op->ptr, prop)) { options |= CTX_TEXTURE; + } + } t->options = options; @@ -1699,10 +1707,9 @@ int initTransform(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event, int /* overwrite initial values if operator supplied a non-null vector */ - if (RNA_property_is_set(op->ptr, "value")) + if ( (prop = RNA_struct_find_property(op->ptr, "value")) && RNA_property_is_set(op->ptr, prop)) { float values[4]= {0}; /* incase value isn't length 4, avoid uninitialized memory */ - PropertyRNA *prop= RNA_struct_find_property(op->ptr, "value"); if(RNA_property_array_check(prop)) { RNA_float_get_array(op->ptr, "value", values); @@ -1716,19 +1723,19 @@ int initTransform(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event, int } /* Transformation axis from operator */ - if (RNA_struct_find_property(op->ptr, "axis") && RNA_property_is_set(op->ptr, "axis")) + if ((prop = RNA_struct_find_property(op->ptr, "axis")) && RNA_property_is_set(op->ptr, prop)) { - RNA_float_get_array(op->ptr, "axis", t->axis); + RNA_property_float_get_array(op->ptr, prop, t->axis); normalize_v3(t->axis); copy_v3_v3(t->axis_orig, t->axis); } /* Constraint init from operator */ - if (RNA_struct_find_property(op->ptr, "constraint_axis") && RNA_property_is_set(op->ptr, "constraint_axis")) + if ((prop = RNA_struct_find_property(op->ptr, "constraint_axis")) && RNA_property_is_set(op->ptr, prop)) { int constraint_axis[3]; - RNA_boolean_get_array(op->ptr, "constraint_axis", constraint_axis); + RNA_property_boolean_get_array(op->ptr, prop, constraint_axis); if (constraint_axis[0] || constraint_axis[1] || constraint_axis[2]) { @@ -2559,9 +2566,9 @@ static void headerResize(TransInfo *t, float vec[3], char *str) outputNumInput(&(t->num), tvec); } else { - sprintf(&tvec[0], "%.4f", vec[0]); - sprintf(&tvec[20], "%.4f", vec[1]); - sprintf(&tvec[40], "%.4f", vec[2]); + BLI_snprintf(&tvec[0], 20, "%.4f", vec[0]); + BLI_snprintf(&tvec[20], 20, "%.4f", vec[1]); + BLI_snprintf(&tvec[40], 20, "%.4f", vec[2]); } if (t->con.mode & CON_APPLY) { @@ -2632,7 +2639,7 @@ static void ElementResize(TransInfo *t, TransData *td, float mat[3][3]) /* local constraint shouldn't alter center */ if ((t->around == V3D_LOCAL) && ( (t->flag & (T_OBJECT|T_POSE)) || - ((t->flag & T_EDIT) && (t->settings->selectmode & SCE_SELECT_FACE)) || + ((t->flag & T_EDIT) && (t->settings->selectmode & (SCE_SELECT_EDGE|SCE_SELECT_FACE))) || (t->obedit && t->obedit->type == OB_ARMATURE)) ) { @@ -2919,7 +2926,7 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short /* local constraint shouldn't alter center */ if (around == V3D_LOCAL) { if ( (t->flag & (T_OBJECT|T_POSE)) || - (t->settings->selectmode & SCE_SELECT_FACE) || + (t->settings->selectmode & (SCE_SELECT_EDGE|SCE_SELECT_FACE)) || (t->obedit && t->obedit->type == OB_ARMATURE)) { center = td->center; diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h index 2233aeda92e..aab7dda0e86 100644 --- a/source/blender/editors/transform/transform.h +++ b/source/blender/editors/transform/transform.h @@ -281,7 +281,7 @@ typedef struct TransInfo { char *undostr; /* if set, uses this string for undo */ float spacemtx[3][3]; /* orientation matrix of the current space */ - char spacename[32]; /* name of the current space */ + char spacename[64]; /* name of the current space, MAX_NAME */ struct Object *poseobj; /* if t->flag & T_POSE, this denotes pose object */ diff --git a/source/blender/editors/transform/transform_constraints.c b/source/blender/editors/transform/transform_constraints.c index b88e57e1861..bd34477c13f 100644 --- a/source/blender/editors/transform/transform_constraints.c +++ b/source/blender/editors/transform/transform_constraints.c @@ -59,6 +59,7 @@ #include "BLI_math.h" #include "BLI_utildefines.h" +#include "BLI_string.h" //#include "blendef.h" // @@ -552,7 +553,7 @@ static void applyObjectConstraintRot(TransInfo *t, TransData *td, float vec[3], void setConstraint(TransInfo *t, float space[3][3], int mode, const char text[]) { - strncpy(t->con.text + 1, text, 48); + BLI_strncpy(t->con.text + 1, text, sizeof(t->con.text) - 1); copy_m3_m3(t->con.mtx, space); t->con.mode = mode; getConstraintMatrix(t); @@ -579,7 +580,7 @@ void setLocalConstraint(TransInfo *t, int mode, const char text[]) setConstraint(t, t->data->axismtx, mode, text); } else { - strncpy(t->con.text + 1, text, 48); + BLI_strncpy(t->con.text + 1, text, sizeof(t->con.text) - 1); copy_m3_m3(t->con.mtx, t->data->axismtx); t->con.mode = mode; getConstraintMatrix(t); @@ -598,7 +599,7 @@ void setLocalConstraint(TransInfo *t, int mode, const char text[]) /* Set the constraint according to the user defined orientation - ftext is a format string passed to sprintf. It will add the name of + ftext is a format string passed to BLI_snprintf. It will add the name of the orientation where %s is (logically). */ void setUserConstraint(TransInfo *t, short orientation, int mode, const char ftext[]) @@ -609,28 +610,28 @@ void setUserConstraint(TransInfo *t, short orientation, int mode, const char fte case V3D_MANIP_GLOBAL: { float mtx[3][3]= MAT3_UNITY; - sprintf(text, ftext, "global"); + BLI_snprintf(text, sizeof(text), ftext, "global"); setConstraint(t, mtx, mode, text); } break; case V3D_MANIP_LOCAL: - sprintf(text, ftext, "local"); + BLI_snprintf(text, sizeof(text), ftext, "local"); setLocalConstraint(t, mode, text); break; case V3D_MANIP_NORMAL: - sprintf(text, ftext, "normal"); + BLI_snprintf(text, sizeof(text), ftext, "normal"); setConstraint(t, t->spacemtx, mode, text); break; case V3D_MANIP_VIEW: - sprintf(text, ftext, "view"); + BLI_snprintf(text, sizeof(text), ftext, "view"); setConstraint(t, t->spacemtx, mode, text); break; case V3D_MANIP_GIMBAL: - sprintf(text, ftext, "gimbal"); + BLI_snprintf(text, sizeof(text), ftext, "gimbal"); setConstraint(t, t->spacemtx, mode, text); break; default: /* V3D_MANIP_CUSTOM */ - sprintf(text, ftext, t->spacename); + BLI_snprintf(text, sizeof(text), ftext, t->spacename); setConstraint(t, t->spacemtx, mode, text); break; } @@ -874,11 +875,11 @@ static void setNearestAxis2d(TransInfo *t) /* no correction needed... just use whichever one is lower */ if ( abs(t->mval[0]-t->con.imval[0]) < abs(t->mval[1]-t->con.imval[1]) ) { t->con.mode |= CON_AXIS1; - sprintf(t->con.text, " along Y axis"); + BLI_snprintf(t->con.text, sizeof(t->con.text), " along Y axis"); } else { t->con.mode |= CON_AXIS0; - sprintf(t->con.text, " along X axis"); + BLI_snprintf(t->con.text, sizeof(t->con.text), " along X axis"); } } @@ -929,31 +930,31 @@ static void setNearestAxis3d(TransInfo *t) if (len[0] <= len[1] && len[0] <= len[2]) { if (t->modifiers & MOD_CONSTRAINT_PLANE) { t->con.mode |= (CON_AXIS1|CON_AXIS2); - sprintf(t->con.text, " locking %s X axis", t->spacename); + BLI_snprintf(t->con.text, sizeof(t->con.text), " locking %s X axis", t->spacename); } else { t->con.mode |= CON_AXIS0; - sprintf(t->con.text, " along %s X axis", t->spacename); + BLI_snprintf(t->con.text, sizeof(t->con.text), " along %s X axis", t->spacename); } } else if (len[1] <= len[0] && len[1] <= len[2]) { if (t->modifiers & MOD_CONSTRAINT_PLANE) { t->con.mode |= (CON_AXIS0|CON_AXIS2); - sprintf(t->con.text, " locking %s Y axis", t->spacename); + BLI_snprintf(t->con.text, sizeof(t->con.text), " locking %s Y axis", t->spacename); } else { t->con.mode |= CON_AXIS1; - sprintf(t->con.text, " along %s Y axis", t->spacename); + BLI_snprintf(t->con.text, sizeof(t->con.text), " along %s Y axis", t->spacename); } } else if (len[2] <= len[1] && len[2] <= len[0]) { if (t->modifiers & MOD_CONSTRAINT_PLANE) { t->con.mode |= (CON_AXIS0|CON_AXIS1); - sprintf(t->con.text, " locking %s Z axis", t->spacename); + BLI_snprintf(t->con.text, sizeof(t->con.text), " locking %s Z axis", t->spacename); } else { t->con.mode |= CON_AXIS2; - sprintf(t->con.text, " along %s Z axis", t->spacename); + BLI_snprintf(t->con.text, sizeof(t->con.text), " along %s Z axis", t->spacename); } } } diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index bc7514b4c9a..44dc909314a 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -1926,6 +1926,19 @@ static void get_face_center(float *cent, EditMesh *em, EditVert *eve) } } +static void get_edge_center(float *cent, EditMesh *em, EditVert *eve) +{ + EditEdge *eed; + + for(eed= em->edges.first; eed; eed= eed->next) + if(eed->f & SELECT) + if(eed->v1==eve || eed->v2==eve) + break; + if(eed) { + mid_v3_v3v3(cent, eed->v1->co, eed->v2->co); + } +} + /* way to overwrite what data is edited with transform * static void VertsToTransData(TransData *td, EditVert *eve, BakeKey *key) */ static void VertsToTransData(TransInfo *t, TransData *td, EditMesh *em, EditVert *eve) @@ -1937,8 +1950,12 @@ static void VertsToTransData(TransInfo *t, TransData *td, EditMesh *em, EditVert td->loc = eve->co; copy_v3_v3(td->center, td->loc); - if(t->around==V3D_LOCAL && (em->selectmode & SCE_SELECT_FACE)) - get_face_center(td->center, em, eve); + if(t->around==V3D_LOCAL) { + if(em->selectmode & SCE_SELECT_FACE) + get_face_center(td->center, em, eve); + else if(em->selectmode & SCE_SELECT_EDGE) + get_edge_center(td->center, em, eve); + } copy_v3_v3(td->iloc, td->loc); // Setting normals diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index f6aca0336be..fff683b1ef6 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -1077,7 +1077,7 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event) if(v3d->flag & V3D_ALIGN) t->flag |= T_V3D_ALIGN; t->around = v3d->around; - if (op && RNA_struct_find_property(op->ptr, "constraint_orientation") && RNA_property_is_set(op->ptr, "constraint_orientation")) + if (op && RNA_struct_find_property(op->ptr, "constraint_orientation") && RNA_struct_property_is_set(op->ptr, "constraint_orientation")) { t->current_orientation = RNA_enum_get(op->ptr, "constraint_orientation"); @@ -1100,7 +1100,7 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event) /* initialize UV transform from */ if (op && RNA_struct_find_property(op->ptr, "correct_uv")) { - if(RNA_property_is_set(op->ptr, "correct_uv")) { + if(RNA_struct_property_is_set(op->ptr, "correct_uv")) { if(RNA_boolean_get(op->ptr, "correct_uv")) { t->settings->uvcalc_flag |= UVCALC_TRANSFORM_CORRECT; } @@ -1146,7 +1146,7 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event) t->around = V3D_CENTER; } - if (op && RNA_property_is_set(op->ptr, "release_confirm")) + if (op && RNA_struct_property_is_set(op->ptr, "release_confirm")) { if (RNA_boolean_get(op->ptr, "release_confirm")) { @@ -1161,7 +1161,7 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event) } } - if (op && RNA_struct_find_property(op->ptr, "mirror") && RNA_property_is_set(op->ptr, "mirror")) + if (op && RNA_struct_find_property(op->ptr, "mirror") && RNA_struct_property_is_set(op->ptr, "mirror")) { if (RNA_boolean_get(op->ptr, "mirror")) { @@ -1182,7 +1182,7 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event) /* setting PET flag only if property exist in operator. Otherwise, assume it's not supported */ if (op && RNA_struct_find_property(op->ptr, "proportional")) { - if (RNA_property_is_set(op->ptr, "proportional")) + if (RNA_struct_property_is_set(op->ptr, "proportional")) { switch(RNA_enum_get(op->ptr, "proportional")) { @@ -1215,7 +1215,7 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event) } } - if (op && RNA_struct_find_property(op->ptr, "proportional_size") && RNA_property_is_set(op->ptr, "proportional_size")) + if (op && RNA_struct_find_property(op->ptr, "proportional_size") && RNA_struct_property_is_set(op->ptr, "proportional_size")) { t->prop_size = RNA_float_get(op->ptr, "proportional_size"); } @@ -1232,7 +1232,7 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event) t->prop_size = 1.0f; } - if (op && RNA_struct_find_property(op->ptr, "proportional_edit_falloff") && RNA_property_is_set(op->ptr, "proportional_edit_falloff")) + if (op && RNA_struct_find_property(op->ptr, "proportional_edit_falloff") && RNA_struct_property_is_set(op->ptr, "proportional_edit_falloff")) { t->prop_mode = RNA_enum_get(op->ptr, "proportional_edit_falloff"); } diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c index 90f95bea696..b7aba109cdd 100644 --- a/source/blender/editors/transform/transform_ops.c +++ b/source/blender/editors/transform/transform_ops.c @@ -268,7 +268,7 @@ static void TRANSFORM_OT_delete_orientation(struct wmOperatorType *ot) static int create_orientation_exec(bContext *C, wmOperator *op) { - char name[36]; + char name[MAX_NAME]; int use = RNA_boolean_get(op->ptr, "use"); int overwrite = RNA_boolean_get(op->ptr, "overwrite"); @@ -301,7 +301,7 @@ static void TRANSFORM_OT_create_orientation(struct wmOperatorType *ot) ot->poll = ED_operator_areaactive; ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO; - RNA_def_string(ot->srna, "name", "", 35, "Name", "Text to insert at the cursor position"); + RNA_def_string(ot->srna, "name", "", MAX_NAME, "Name", "Text to insert at the cursor position"); RNA_def_boolean(ot->srna, "use", 0, "Use after creation", "Select orientation after its creation"); RNA_def_boolean(ot->srna, "overwrite", 0, "Overwrite previous", "Overwrite previously created orientation with same name"); } @@ -429,7 +429,7 @@ static int transform_invoke(bContext *C, wmOperator *op, wmEvent *event) return OPERATOR_CANCELLED; } - if(RNA_property_is_set(op->ptr, "value")) { + if(RNA_struct_property_is_set(op->ptr, "value")) { return transform_exec(C, op); } else { diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c index 3aa155fc8bb..8a9249f78e5 100644 --- a/source/blender/editors/transform/transform_orientations.c +++ b/source/blender/editors/transform/transform_orientations.c @@ -145,7 +145,7 @@ TransformOrientation *createObjectSpace(bContext *C, ReportList *UNUSED(reports) /* use object name if no name is given */ if (name[0] == 0) { - strncpy(name, ob->id.name+2, 35); + strncpy(name, ob->id.name+2, MAX_ID_NAME-2); } return addMatrixSpace(C, mat, name, overwrite); @@ -289,7 +289,7 @@ TransformOrientation* addMatrixSpace(bContext *C, float mat[3][3], char name[], { ts = MEM_callocN(sizeof(TransformOrientation), "UserTransSpace from matrix"); BLI_addtail(transform_spaces, ts); - strncpy(ts->name, name, 35); + strncpy(ts->name, name, sizeof(ts->name)); } /* copy matrix into transform space */ @@ -422,10 +422,11 @@ const char * BIF_menustringTransformOrientation(const bContext *C, const char *t TransformOrientation *ts; int i = V3D_MANIP_CUSTOM; char *str_menu, *p; + const int elem_size = MAX_NAME + 4; title = IFACE_(title); - str_menu = MEM_callocN(strlen(menu) + strlen(title) + 1 + 40 * BIF_countTransformOrientation(C), TIP_("UserTransSpace from matrix")); + str_menu = MEM_callocN(strlen(menu) + strlen(title) + 1 + elem_size * BIF_countTransformOrientation(C), TIP_("UserTransSpace from matrix")); p = str_menu; p += sprintf(str_menu, "%s", title); diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c index ed3e949c8a0..d079bd41c10 100644 --- a/source/blender/editors/transform/transform_snap.c +++ b/source/blender/editors/transform/transform_snap.c @@ -445,18 +445,18 @@ void initSnapping(TransInfo *t, wmOperator *op) resetSnapping(t); /* if snap property exists */ - if (op && RNA_struct_find_property(op->ptr, "snap") && RNA_property_is_set(op->ptr, "snap")) + if (op && RNA_struct_find_property(op->ptr, "snap") && RNA_struct_property_is_set(op->ptr, "snap")) { if (RNA_boolean_get(op->ptr, "snap")) { t->modifiers |= MOD_SNAP; - if (RNA_property_is_set(op->ptr, "snap_target")) + if (RNA_struct_property_is_set(op->ptr, "snap_target")) { snap_target = RNA_enum_get(op->ptr, "snap_target"); } - if (RNA_property_is_set(op->ptr, "snap_point")) + if (RNA_struct_property_is_set(op->ptr, "snap_point")) { RNA_float_get_array(op->ptr, "snap_point", t->tsnap.snapPoint); t->tsnap.status |= SNAP_FORCED|POINT_INIT; diff --git a/source/blender/editors/util/ed_util.c b/source/blender/editors/util/ed_util.c index 1a1022a5c7f..73322a8292d 100644 --- a/source/blender/editors/util/ed_util.c +++ b/source/blender/editors/util/ed_util.c @@ -179,18 +179,18 @@ void unpack_menu(bContext *C, const char *opname, const char *id_name, const cha BLI_strncpy(local_name, abs_name, sizeof(local_name)); BLI_splitdirstring(local_name, fi); - sprintf(local_name, "//%s/%s", folder, fi); + BLI_snprintf(local_name, sizeof(local_name), "//%s/%s", folder, fi); if(strcmp(abs_name, local_name)!=0) { switch(checkPackedFile(local_name, pf)) { case PF_NOFILE: - sprintf(line, "Create %s", local_name); + BLI_snprintf(line, sizeof(line), "Create %s", local_name); props_ptr= uiItemFullO(layout, opname, line, ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS); RNA_enum_set(&props_ptr, "method", PF_WRITE_LOCAL); RNA_string_set(&props_ptr, "id", id_name); break; case PF_EQUAL: - sprintf(line, "Use %s (identical)", local_name); + BLI_snprintf(line, sizeof(line), "Use %s (identical)", local_name); //uiItemEnumO(layout, opname, line, 0, "method", PF_USE_LOCAL); props_ptr= uiItemFullO(layout, opname, line, ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS); RNA_enum_set(&props_ptr, "method", PF_USE_LOCAL); @@ -198,13 +198,13 @@ void unpack_menu(bContext *C, const char *opname, const char *id_name, const cha break; case PF_DIFFERS: - sprintf(line, "Use %s (differs)", local_name); + BLI_snprintf(line, sizeof(line), "Use %s (differs)", local_name); //uiItemEnumO(layout, opname, line, 0, "method", PF_USE_LOCAL); props_ptr= uiItemFullO(layout, opname, line, ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS); RNA_enum_set(&props_ptr, "method", PF_USE_LOCAL); RNA_string_set(&props_ptr, "id", id_name); - sprintf(line, "Overwrite %s", local_name); + BLI_snprintf(line, sizeof(line), "Overwrite %s", local_name); //uiItemEnumO(layout, opname, line, 0, "method", PF_WRITE_LOCAL); props_ptr= uiItemFullO(layout, opname, line, ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS); RNA_enum_set(&props_ptr, "method", PF_WRITE_LOCAL); @@ -216,27 +216,27 @@ void unpack_menu(bContext *C, const char *opname, const char *id_name, const cha switch(checkPackedFile(abs_name, pf)) { case PF_NOFILE: - sprintf(line, "Create %s", abs_name); + BLI_snprintf(line, sizeof(line), "Create %s", abs_name); //uiItemEnumO(layout, opname, line, 0, "method", PF_WRITE_ORIGINAL); props_ptr= uiItemFullO(layout, opname, line, ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS); RNA_enum_set(&props_ptr, "method", PF_WRITE_ORIGINAL); RNA_string_set(&props_ptr, "id", id_name); break; case PF_EQUAL: - sprintf(line, "Use %s (identical)", abs_name); + BLI_snprintf(line, sizeof(line), "Use %s (identical)", abs_name); //uiItemEnumO(layout, opname, line, 0, "method", PF_USE_ORIGINAL); props_ptr= uiItemFullO(layout, opname, line, ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS); RNA_enum_set(&props_ptr, "method", PF_USE_ORIGINAL); RNA_string_set(&props_ptr, "id", id_name); break; case PF_DIFFERS: - sprintf(line, "Use %s (differs)", abs_name); + BLI_snprintf(line, sizeof(line), "Use %s (differs)", abs_name); //uiItemEnumO(layout, opname, line, 0, "method", PF_USE_ORIGINAL); props_ptr= uiItemFullO(layout, opname, line, ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS); RNA_enum_set(&props_ptr, "method", PF_USE_ORIGINAL); RNA_string_set(&props_ptr, "id", id_name); - sprintf(line, "Overwrite %s", abs_name); + BLI_snprintf(line, sizeof(line), "Overwrite %s", abs_name); //uiItemEnumO(layout, opname, line, 0, "method", PF_WRITE_ORIGINAL); props_ptr= uiItemFullO(layout, opname, line, ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS); RNA_enum_set(&props_ptr, "method", PF_WRITE_ORIGINAL); diff --git a/source/blender/editors/util/numinput.c b/source/blender/editors/util/numinput.c index 6c8713aa03e..52422d37f29 100644 --- a/source/blender/editors/util/numinput.c +++ b/source/blender/editors/util/numinput.c @@ -31,9 +31,10 @@ #include <math.h> /* fabs */ -#include <stdio.h> /* for sprintf */ +#include <stdio.h> /* for size_t */ #include "BLI_utildefines.h" +#include "BLI_string.h" #include "WM_types.h" @@ -84,34 +85,34 @@ void outputNumInput(NumInput *n, char *str) inv[0] = 0; if( n->val[i] > 1e10f || n->val[i] < -1e10f ) - sprintf(&str[j*20], "%s%.4e%c", inv, n->val[i], cur); + BLI_snprintf(&str[j*20], 20, "%s%.4e%c", inv, n->val[i], cur); else switch (n->ctrl[i]) { case 0: - sprintf(&str[j*20], "%sNONE%c", inv, cur); + BLI_snprintf(&str[j*20], 20, "%sNONE%c", inv, cur); break; case 1: case -1: - sprintf(&str[j*20], "%s%.0f%c", inv, n->val[i], cur); + BLI_snprintf(&str[j*20], 20, "%s%.0f%c", inv, n->val[i], cur); break; case 10: case -10: - sprintf(&str[j*20], "%s%.f.%c", inv, n->val[i], cur); + BLI_snprintf(&str[j*20], 20, "%s%.f.%c", inv, n->val[i], cur); break; case 100: case -100: - sprintf(&str[j*20], "%s%.1f%c", inv, n->val[i], cur); + BLI_snprintf(&str[j*20], 20, "%s%.1f%c", inv, n->val[i], cur); break; case 1000: case -1000: - sprintf(&str[j*20], "%s%.2f%c", inv, n->val[i], cur); + BLI_snprintf(&str[j*20], 20, "%s%.2f%c", inv, n->val[i], cur); break; case 10000: case -10000: - sprintf(&str[j*20], "%s%.3f%c", inv, n->val[i], cur); + BLI_snprintf(&str[j*20], 20, "%s%.3f%c", inv, n->val[i], cur); break; default: - sprintf(&str[j*20], "%s%.4e%c", inv, n->val[i], cur); + BLI_snprintf(&str[j*20], 20, "%s%.4e%c", inv, n->val[i], cur); } } } diff --git a/source/blender/editors/util/undo.c b/source/blender/editors/util/undo.c index 3ec99ca7508..4fb9f916df7 100644 --- a/source/blender/editors/util/undo.c +++ b/source/blender/editors/util/undo.c @@ -509,7 +509,7 @@ static int undo_history_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(even /* note: also check ed_undo_step() in top if you change notifiers */ static int undo_history_exec(bContext *C, wmOperator *op) { - if(RNA_property_is_set(op->ptr, "item")) { + if(RNA_struct_property_is_set(op->ptr, "item")) { int undosys= get_undo_system(C); int item= RNA_int_get(op->ptr, "item"); diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c index 1f71cd8a4c6..7d56d5c479f 100644 --- a/source/blender/editors/uvedit/uvedit_ops.c +++ b/source/blender/editors/uvedit/uvedit_ops.c @@ -3360,10 +3360,10 @@ void ED_keymap_uvedit(wmKeyConfig *keyconf) keymap->poll= ED_operator_uvedit; /* pick selection */ - WM_keymap_add_item(keymap, "UV_OT_select", SELECTMOUSE, KM_PRESS, 0, 0); - RNA_boolean_set(WM_keymap_add_item(keymap, "UV_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT, 0)->ptr, "extend", 1); - WM_keymap_add_item(keymap, "UV_OT_select_loop", SELECTMOUSE, KM_PRESS, KM_ALT, 0); - RNA_boolean_set(WM_keymap_add_item(keymap, "UV_OT_select_loop", SELECTMOUSE, KM_PRESS, KM_SHIFT|KM_ALT, 0)->ptr, "extend", 1); + RNA_boolean_set(WM_keymap_add_item(keymap, "UV_OT_select", SELECTMOUSE, KM_PRESS, 0, 0)->ptr, "extend", FALSE); + RNA_boolean_set(WM_keymap_add_item(keymap, "UV_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT, 0)->ptr, "extend", TRUE); + RNA_boolean_set(WM_keymap_add_item(keymap, "UV_OT_select_loop", SELECTMOUSE, KM_PRESS, KM_ALT, 0)->ptr, "extend", FALSE); + RNA_boolean_set(WM_keymap_add_item(keymap, "UV_OT_select_loop", SELECTMOUSE, KM_PRESS, KM_SHIFT|KM_ALT, 0)->ptr, "extend", TRUE); /* border/circle selection */ WM_keymap_add_item(keymap, "UV_OT_select_border", BKEY, KM_PRESS, 0, 0); @@ -3371,8 +3371,8 @@ void ED_keymap_uvedit(wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "UV_OT_circle_select", CKEY, KM_PRESS, 0, 0); /* selection manipulation */ - WM_keymap_add_item(keymap, "UV_OT_select_linked", LKEY, KM_PRESS, KM_CTRL, 0); - WM_keymap_add_item(keymap, "UV_OT_select_linked_pick", LKEY, KM_PRESS, 0, 0); + RNA_boolean_set(WM_keymap_add_item(keymap, "UV_OT_select_linked", LKEY, KM_PRESS, KM_CTRL, 0)->ptr, "extend", FALSE); + RNA_boolean_set(WM_keymap_add_item(keymap, "UV_OT_select_linked_pick", LKEY, KM_PRESS, 0, 0)->ptr, "extend", FALSE); RNA_boolean_set(WM_keymap_add_item(keymap, "UV_OT_select_linked", LKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0)->ptr, "extend", TRUE); RNA_boolean_set(WM_keymap_add_item(keymap, "UV_OT_select_linked_pick", LKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "extend", TRUE); diff --git a/source/blender/editors/uvedit/uvedit_unwrap_ops.c b/source/blender/editors/uvedit/uvedit_unwrap_ops.c index 830dc224c94..17e5bebd6b0 100644 --- a/source/blender/editors/uvedit/uvedit_unwrap_ops.c +++ b/source/blender/editors/uvedit/uvedit_unwrap_ops.c @@ -46,6 +46,7 @@ #include "BLI_editVert.h" #include "BLI_uvproject.h" #include "BLI_utildefines.h" +#include "BLI_string.h" #include "BKE_context.h" #include "BKE_customdata.h" @@ -334,7 +335,7 @@ static void minimize_stretch_iteration(bContext *C, wmOperator *op, int interact param_flush(ms->handle); if(sa) { - sprintf(str, "Minimize Stretch. Blend %.2f", ms->blend); + BLI_snprintf(str, sizeof(str), "Minimize Stretch. Blend %.2f", ms->blend); ED_area_headerprint(sa, str); } @@ -498,7 +499,7 @@ static int pack_islands_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } - if(RNA_property_is_set(op->ptr, "margin")) { + if(RNA_struct_property_is_set(op->ptr, "margin")) { scene->toolsettings->uvcalc_margin= RNA_float_get(op->ptr, "margin"); } else { diff --git a/source/blender/gpu/GPU_extensions.h b/source/blender/gpu/GPU_extensions.h index 1dbe9ed7371..9fb0dd1ae07 100644 --- a/source/blender/gpu/GPU_extensions.h +++ b/source/blender/gpu/GPU_extensions.h @@ -167,7 +167,7 @@ void GPU_shader_uniform_vector(GPUShader *shader, int location, int length, int arraysize, float *value); void GPU_shader_uniform_texture(GPUShader *shader, int location, GPUTexture *tex); -int GPU_shader_get_attribute(GPUShader *shader, char *name); +int GPU_shader_get_attribute(GPUShader *shader, const char *name); /* Vertex attributes for shaders */ @@ -179,7 +179,7 @@ typedef struct GPUVertexAttribs { int glindex; int gltexco; int attribid; - char name[32]; + char name[64]; /* MAX_CUSTOMDATA_LAYER_NAME */ } layer[GPU_MAX_ATTRIB]; int totlayer; diff --git a/source/blender/gpu/intern/gpu_extensions.c b/source/blender/gpu/intern/gpu_extensions.c index c4ed88635b7..cc486b75245 100644 --- a/source/blender/gpu/intern/gpu_extensions.c +++ b/source/blender/gpu/intern/gpu_extensions.c @@ -1156,7 +1156,7 @@ void GPU_shader_uniform_texture(GPUShader *UNUSED(shader), int location, GPUText GPU_print_error("Post Uniform Texture"); } -int GPU_shader_get_attribute(GPUShader *shader, char *name) +int GPU_shader_get_attribute(GPUShader *shader, const char *name) { int index; diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c index 93ea067cfb7..ef2abb20cf3 100644 --- a/source/blender/gpu/intern/gpu_material.c +++ b/source/blender/gpu/intern/gpu_material.c @@ -173,7 +173,7 @@ static void gpu_material_set_attrib_id(GPUMaterial *material) * removed by the glsl compiler by dead code elimination */ for(a=0, b=0; a<attribs->totlayer; a++) { - sprintf(name, "att%d", attribs->layer[a].attribid); + BLI_snprintf(name, sizeof(name), "att%d", attribs->layer[a].attribid); attribs->layer[a].glindex = GPU_shader_get_attribute(shader, name); if(attribs->layer[a].glindex >= 0) { diff --git a/source/blender/imbuf/intern/anim_movie.c b/source/blender/imbuf/intern/anim_movie.c index e6d09285685..a0903379528 100644 --- a/source/blender/imbuf/intern/anim_movie.c +++ b/source/blender/imbuf/intern/anim_movie.c @@ -1289,7 +1289,7 @@ struct ImBuf * IMB_anim_absolute(struct anim * anim, int position, if (ibuf) { if (filter_y) IMB_filtery(ibuf); - sprintf(ibuf->name, "%s.%04d", anim->name, anim->curposition + 1); + BLI_snprintf(ibuf->name, sizeof(ibuf->name), "%s.%04d", anim->name, anim->curposition + 1); } return(ibuf); diff --git a/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp b/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp index 3e017d5af82..f98f37e388c 100644 --- a/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp +++ b/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp @@ -703,11 +703,11 @@ void DDSHeader::setSwizzleCode(uint8 c0, uint8 c1, uint8 c2, uint8 c3) void DDSHeader::setPixelFormat(uint bitcount, uint rmask, uint gmask, uint bmask, uint amask) { // Make sure the masks are correct. - if ((rmask & gmask) || \ - (rmask & bmask) || \ - (rmask & amask) || \ - (gmask & bmask) || \ - (gmask & amask) || \ + if ((rmask & gmask) || + (rmask & bmask) || + (rmask & amask) || + (gmask & bmask) || + (gmask & amask) || (bmask & amask)) { printf("DDS: bad RGBA masks, pixel format not set\n"); return; diff --git a/source/blender/imbuf/intern/divers.c b/source/blender/imbuf/intern/divers.c index 034b5724ca6..442309ccf7a 100644 --- a/source/blender/imbuf/intern/divers.c +++ b/source/blender/imbuf/intern/divers.c @@ -46,9 +46,9 @@ /**************************** Interlace/Deinterlace **************************/ -void IMB_de_interlace(struct ImBuf *ibuf) +void IMB_de_interlace(ImBuf *ibuf) { - struct ImBuf * tbuf1, * tbuf2; + ImBuf * tbuf1, * tbuf2; if (ibuf == NULL) return; if (ibuf->flags & IB_fields) return; @@ -73,9 +73,9 @@ void IMB_de_interlace(struct ImBuf *ibuf) ibuf->y /= 2; } -void IMB_interlace(struct ImBuf *ibuf) +void IMB_interlace(ImBuf *ibuf) { - struct ImBuf * tbuf1, * tbuf2; + ImBuf * tbuf1, * tbuf2; if (ibuf == NULL) return; ibuf->flags &= ~IB_fields; @@ -100,14 +100,76 @@ void IMB_interlace(struct ImBuf *ibuf) } } +/************************* Floyd-Steinberg dithering *************************/ + +typedef struct DitherContext { + int *error_buf, *e; + int v[4], v0[4], v1[4]; + float f; +} DitherContext; + +DitherContext *create_dither_context(int w, float factor) +{ + DitherContext *di; + int i; + + di= MEM_callocN(sizeof(DitherContext), "dithering context"); + di->f= factor / 16.0f; + di->error_buf= MEM_callocN(4*(w+1)*sizeof(int), "dithering error"); + di->e= di->error_buf; + + for(i=0; i<4; ++i) + di->v[i]= di->v0[i]= di->v1[i]= 1024.0f*(BLI_frand()-0.5f); + + return di; +} + +static void clear_dither_context(DitherContext *di) +{ + MEM_freeN(di->error_buf); + MEM_freeN(di); +} + +static void dither_finish_row(DitherContext *di) +{ + int i; + + for(i=0; i<4; i++) + di->v[i]= di->v0[i]= di->v1[i] = 0; + + di->e= di->error_buf; +} + +MINLINE unsigned char dither_value(unsigned short v_in, DitherContext *di, int i) +{ + int dv, d2; + unsigned char v_out; + + di->v[i] = v_in + (2*di->v[i] + di->e[4]) * di->f; + CLAMP(di->v[i], 0, 0xFF00); + v_out = USHORTTOUCHAR(di->v[i]); + di->v[i] -= v_out<<8; + dv = di->v[i]; + d2 = di->v[i]<<1; + di->v[i] += d2; + *(di->e++) = di->v[i] + di->v0[i]; + di->v[i] += d2; + + di->v0[i] = di->v[i] + di->v1[i]; + di->v1[i] = dv; + di->v[i] += d2; + + return v_out; +} + /************************* Generic Buffer Conversion *************************/ MINLINE void byte_to_float_v4(float f[4], const uchar b[4]) { - f[0] = b[0] * (1.0f/255.0f); - f[1] = b[1] * (1.0f/255.0f); - f[2] = b[2] * (1.0f/255.0f); - f[3] = b[3] * (1.0f/255.0f); + f[0]= b[0] * (1.0f/255.0f); + f[1]= b[1] * (1.0f/255.0f); + f[2]= b[2] * (1.0f/255.0f); + f[3]= b[3] * (1.0f/255.0f); } MINLINE void float_to_byte_v4(uchar b[4], const float f[4]) @@ -115,10 +177,26 @@ MINLINE void float_to_byte_v4(uchar b[4], const float f[4]) F4TOCHAR4(f, b); } -MINLINE void float_to_byte_dither_v4(uchar b[4], const float f[4], float dither) +MINLINE void ushort_to_byte_v4(uchar b[4], const unsigned short us[4]) { - float tmp[4] = {f[0]+dither, f[1]+dither, f[2]+dither, f[3]+dither}; - float_to_byte_v4(b, tmp); + b[0]= USHORTTOUCHAR(us[0]); + b[1]= USHORTTOUCHAR(us[1]); + b[2]= USHORTTOUCHAR(us[2]); + b[3]= USHORTTOUCHAR(us[3]); +} + +MINLINE void ushort_to_byte_dither_v4(uchar b[4], const unsigned short us[4], DitherContext *di) +{ + b[0]= dither_value(us[0], di, 0); + b[1]= dither_value(us[1], di, 1); + b[2]= dither_value(us[2], di, 2); + b[3]= dither_value(us[3], di, 3); +} + +MINLINE void float_to_byte_dither_v4(uchar b[4], const float f[4], DitherContext *di) +{ + unsigned short us[4] = {FTOUSHORT(f[0]), FTOUSHORT(f[1]), FTOUSHORT(f[2]), FTOUSHORT(f[3])}; + ushort_to_byte_dither_v4(b, us, di); } /* float to byte pixels, output 4-channel RGBA */ @@ -127,26 +205,28 @@ void IMB_buffer_byte_from_float(uchar *rect_to, const float *rect_from, int width, int height, int stride_to, int stride_from) { float tmp[4]; - float dither_fac = dither/255.0f; int x, y; + DitherContext *di; /* we need valid profiles */ BLI_assert(profile_to != IB_PROFILE_NONE); BLI_assert(profile_from != IB_PROFILE_NONE); - if(channels_from==1) { + BLI_init_srgb_conversion(); + if(dither) + di= create_dither_context(width, dither); + + for(y = 0; y < height; y++) { + if(channels_from == 1) { /* single channel input */ - for(y = 0; y < height; y++) { const float *from = rect_from + stride_from*y; uchar *to = rect_to + stride_to*y*4; for(x = 0; x < width; x++, from++, to+=4) to[0] = to[1] = to[2] = to[3] = FTOCHAR(from[0]); } - } - else if(channels_from == 3) { + else if(channels_from == 3) { /* RGB input */ - for(y = 0; y < height; y++) { const float *from = rect_from + stride_from*y*3; uchar *to = rect_to + stride_to*y*4; @@ -174,10 +254,8 @@ void IMB_buffer_byte_from_float(uchar *rect_to, const float *rect_from, } } } - } - else if(channels_from == 4) { + else if(channels_from == 4) { /* RGBA input */ - for(y = 0; y < height; y++) { const float *from = rect_from + stride_from*y*4; uchar *to = rect_to + stride_to*y*4; @@ -185,7 +263,7 @@ void IMB_buffer_byte_from_float(uchar *rect_to, const float *rect_from, /* no color space conversion */ if(dither) { for(x = 0; x < width; x++, from+=4, to+=4) - float_to_byte_dither_v4(to, from, (BLI_frand()-0.5f)*dither_fac); + float_to_byte_dither_v4(to, from, di); } else { for(x = 0; x < width; x++, from+=4, to+=4) @@ -194,28 +272,30 @@ void IMB_buffer_byte_from_float(uchar *rect_to, const float *rect_from, } else if(profile_to == IB_PROFILE_SRGB) { /* convert from linear to sRGB */ + unsigned short us[4]; + if(dither && predivide) { for(x = 0; x < width; x++, from+=4, to+=4) { - linearrgb_to_srgb_predivide_v4(tmp, from); - float_to_byte_dither_v4(to, tmp, (BLI_frand()-0.5f)*dither_fac); + linearrgb_to_srgb_ushort4_predivide(us, from); + ushort_to_byte_dither_v4(to, us, di); } } else if(dither) { for(x = 0; x < width; x++, from+=4, to+=4) { - linearrgb_to_srgb_v4(tmp, from); - float_to_byte_dither_v4(to, tmp, (BLI_frand()-0.5f)*dither_fac); + linearrgb_to_srgb_ushort4(us, from); + ushort_to_byte_dither_v4(to, us, di); } } else if(predivide) { for(x = 0; x < width; x++, from+=4, to+=4) { - linearrgb_to_srgb_predivide_v4(tmp, from); - float_to_byte_v4(to, tmp); + linearrgb_to_srgb_ushort4_predivide(us, from); + ushort_to_byte_v4(to, us); } } else { for(x = 0; x < width; x++, from+=4, to+=4) { - linearrgb_to_srgb_v4(tmp, from); - float_to_byte_v4(to, tmp); + linearrgb_to_srgb_ushort4(us, from); + ushort_to_byte_v4(to, us); } } } @@ -224,13 +304,13 @@ void IMB_buffer_byte_from_float(uchar *rect_to, const float *rect_from, if(dither && predivide) { for(x = 0; x < width; x++, from+=4, to+=4) { srgb_to_linearrgb_predivide_v4(tmp, from); - float_to_byte_dither_v4(to, tmp, (BLI_frand()-0.5f)*dither_fac); + float_to_byte_dither_v4(to, tmp, di); } } else if(dither) { for(x = 0; x < width; x++, from+=4, to+=4) { srgb_to_linearrgb_v4(tmp, from); - float_to_byte_dither_v4(to, tmp, (BLI_frand()-0.5f)*dither_fac); + float_to_byte_dither_v4(to, tmp, di); } } else if(predivide) { @@ -247,7 +327,13 @@ void IMB_buffer_byte_from_float(uchar *rect_to, const float *rect_from, } } } + + if(dither) + dither_finish_row(di); } + + if(dither) + clear_dither_context(di); } /* byte to float pixels, input and output 4-channel RGBA */ @@ -262,6 +348,8 @@ void IMB_buffer_float_from_byte(float *rect_to, const uchar *rect_from, BLI_assert(profile_to != IB_PROFILE_NONE); BLI_assert(profile_from != IB_PROFILE_NONE); + BLI_init_srgb_conversion(); + /* RGBA input */ for(y = 0; y < height; y++) { const uchar *from = rect_from + stride_from*y*4; @@ -276,14 +364,12 @@ void IMB_buffer_float_from_byte(float *rect_to, const uchar *rect_from, /* convert sRGB to linear */ if(predivide) { for(x = 0; x < width; x++, from+=4, to+=4) { - byte_to_float_v4(tmp, from); - srgb_to_linearrgb_predivide_v4(to, tmp); + srgb_to_linearrgb_uchar4_predivide(to, from); } } else { for(x = 0; x < width; x++, from+=4, to+=4) { - byte_to_float_v4(tmp, from); - srgb_to_linearrgb_v4(to, tmp); + srgb_to_linearrgb_uchar4(to, from); } } } @@ -451,7 +537,7 @@ void IMB_buffer_byte_from_byte(uchar *rect_to, const uchar *rect_from, /****************************** ImBuf Conversion *****************************/ -void IMB_rect_from_float(struct ImBuf *ibuf) +void IMB_rect_from_float(ImBuf *ibuf) { int predivide= (ibuf->flags & IB_cm_predivide); int profile_from; @@ -482,7 +568,7 @@ void IMB_rect_from_float(struct ImBuf *ibuf) } /* converts from linear float to sRGB byte for part of the texture, buffer will hold the changed part */ -void IMB_partial_rect_from_float(struct ImBuf *ibuf, float *buffer, int x, int y, int w, int h) +void IMB_partial_rect_from_float(ImBuf *ibuf, float *buffer, int x, int y, int w, int h) { float *rect_float; uchar *rect_byte; @@ -521,7 +607,7 @@ void IMB_partial_rect_from_float(struct ImBuf *ibuf, float *buffer, int x, int y ibuf->userflags &= ~IB_RECT_INVALID; } -void IMB_float_from_rect(struct ImBuf *ibuf) +void IMB_float_from_rect(ImBuf *ibuf) { int predivide= (ibuf->flags & IB_cm_predivide); int profile_from; @@ -547,7 +633,7 @@ void IMB_float_from_rect(struct ImBuf *ibuf) } /* no profile conversion */ -void IMB_float_from_rect_simple(struct ImBuf *ibuf) +void IMB_float_from_rect_simple(ImBuf *ibuf) { int predivide= (ibuf->flags & IB_cm_predivide); @@ -559,7 +645,7 @@ void IMB_float_from_rect_simple(struct ImBuf *ibuf) ibuf->x, ibuf->y, ibuf->x, ibuf->x); } -void IMB_convert_profile(struct ImBuf *ibuf, int profile) +void IMB_convert_profile(ImBuf *ibuf, int profile) { int predivide= (ibuf->flags & IB_cm_predivide); int profile_from, profile_to; @@ -601,7 +687,7 @@ void IMB_convert_profile(struct ImBuf *ibuf, int profile) /* use when you need to get a buffer with a certain profile * if the return */ -float *IMB_float_profile_ensure(struct ImBuf *ibuf, int profile, int *alloc) +float *IMB_float_profile_ensure(ImBuf *ibuf, int profile, int *alloc) { int predivide= (ibuf->flags & IB_cm_predivide); int profile_from, profile_to; @@ -649,7 +735,7 @@ float *IMB_float_profile_ensure(struct ImBuf *ibuf, int profile, int *alloc) /**************************** Color to Grayscale *****************************/ /* no profile conversion */ -void IMB_color_to_bw(struct ImBuf *ibuf) +void IMB_color_to_bw(ImBuf *ibuf) { float *rctf= ibuf->rect_float; uchar *rct= (uchar*)ibuf->rect; diff --git a/source/blender/imbuf/intern/indexer.c b/source/blender/imbuf/intern/indexer.c index ce14951b5fb..e1481d2a08f 100644 --- a/source/blender/imbuf/intern/indexer.c +++ b/source/blender/imbuf/intern/indexer.c @@ -386,12 +386,12 @@ static void get_proxy_filename(struct anim * anim, IMB_Proxy_Size preview_size, stream_suffix[0] = 0; if (anim->streamindex > 0) { - BLI_snprintf(stream_suffix, 20, "_st%d", anim->streamindex); + BLI_snprintf(stream_suffix, sizeof(stream_suffix), "_st%d", anim->streamindex); } - BLI_snprintf(proxy_name, 256, "proxy_%d%s.avi", + BLI_snprintf(proxy_name, sizeof(proxy_name), "proxy_%d%s.avi", (int) (proxy_fac[i] * 100), stream_suffix); - BLI_snprintf(proxy_temp_name, 256, "proxy_%d%s_part.avi", + BLI_snprintf(proxy_temp_name, sizeof(proxy_temp_name), "proxy_%d%s_part.avi", (int) (proxy_fac[i] * 100), stream_suffix); get_index_dir(anim, index_dir); diff --git a/source/blender/imbuf/intern/tiff.c b/source/blender/imbuf/intern/tiff.c index 2051b8d2195..6fe2a3b8bc2 100644 --- a/source/blender/imbuf/intern/tiff.c +++ b/source/blender/imbuf/intern/tiff.c @@ -541,7 +541,7 @@ ImBuf *imb_loadtiff(unsigned char *mem, size_t size, int flags) } else { fprintf(stderr, - "imb_loadtiff: could not allocate memory for TIFF " \ + "imb_loadtiff: could not allocate memory for TIFF " "image.\n"); TIFFClose(image); return NULL; diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h index a33aabab36d..0e58ca6bd61 100644 --- a/source/blender/makesdna/DNA_ID.h +++ b/source/blender/makesdna/DNA_ID.h @@ -53,7 +53,7 @@ typedef struct IDProperty { struct IDProperty *next, *prev; char type, subtype; short flag; - char name[32]; + char name[64]; /* MAX_IDPROP_NAME */ int saved; /*saved is used to indicate if this struct has been saved yet. seemed like a good idea as a pad var was needed anyway :)*/ IDPropertyData data; /* note, alignment for 64 bits */ @@ -65,7 +65,7 @@ typedef struct IDProperty { saved.*/ } IDProperty; -#define MAX_IDPROP_NAME 32 +#define MAX_IDPROP_NAME 64 #define DEFAULT_ALLOC_FOR_NULL_STRINGS 64 /*->type*/ @@ -86,6 +86,10 @@ typedef struct IDProperty { /* IDP_STRING */ #define IDP_STRING_SUB_UTF8 0 /* default */ #define IDP_STRING_SUB_BYTE 1 /* arbitrary byte array, _not_ null terminated */ +/*->flag*/ +#define IDP_FLAG_GHOST (1<<7) /* this means the propery is set but RNA will return + * false when checking 'RNA_property_is_set', + * currently this is a runtime flag */ /* add any future new id property types here.*/ @@ -96,7 +100,8 @@ typedef struct IDProperty { * provides a common handle to place all data in double-linked lists. * */ -#define MAX_ID_NAME 24 +/* 2 characters for ID code and 64 for actual name */ +#define MAX_ID_NAME 66 /* There's a nasty circular dependency here.... void* to the rescue! I * really wonder why this is needed. */ @@ -104,14 +109,14 @@ typedef struct ID { void *next, *prev; struct ID *newid; struct Library *lib; - char name[24]; - short us; + char name[66]; + short pad, us; /** * LIB_... flags report on status of the datablock this ID belongs * to. */ short flag; - int icon_id; + int icon_id, pad2; IDProperty *properties; } ID; diff --git a/source/blender/makesdna/DNA_action_types.h b/source/blender/makesdna/DNA_action_types.h index 97cd8a9fcc9..be1b4baf7c2 100644 --- a/source/blender/makesdna/DNA_action_types.h +++ b/source/blender/makesdna/DNA_action_types.h @@ -184,7 +184,7 @@ typedef struct bPoseChannel { IDProperty *prop; /* User-Defined Properties on this PoseChannel */ ListBase constraints;/* Constraints that act on this PoseChannel */ - char name[32]; /* Channels need longer names than normal blender objects */ + char name[64]; /* need to match bone name length: MAXBONENAME */ short flag; /* dynamic, for detecting transform changes */ short ikflag; /* settings for IK bones */ @@ -345,7 +345,7 @@ typedef struct bPose { void *ikparam; /* IK solver parameters, structure depends on iksolver */ bAnimVizSettings avs; /* settings for visualization of bone animation */ - char proxy_act_bone[32]; /* proxy active bone name*/ + char proxy_act_bone[64]; /* proxy active bone name, MAXBONENAME */ } bPose; @@ -670,7 +670,7 @@ typedef struct bActionChannel { ListBase constraintChannels; /* Constraint Channels (when Action Channel represents an Object or Bone) */ int flag; /* settings accessed via bitmapping */ - char name[32]; /* channel name */ + char name[64]; /* channel name, MAX_NAME */ int temp; /* temporary setting - may be used to indicate group that channel belongs to during syncing */ } bActionChannel; diff --git a/source/blender/makesdna/DNA_actuator_types.h b/source/blender/makesdna/DNA_actuator_types.h index a4280a6e463..3be46538c22 100644 --- a/source/blender/makesdna/DNA_actuator_types.h +++ b/source/blender/makesdna/DNA_actuator_types.h @@ -50,8 +50,8 @@ typedef struct bActionActuator { struct bAction *act; /* Pointer to action */ short type, flag; /* Playback type */ // not in use float sta, end; /* Start & End frames */ - char name[32]; /* For property-driven playback */ - char frameProp[32]; /* Set this property to the actions current frame */ + char name[64]; /* For property-driven playback, MAX_NAME */ + char frameProp[64]; /* Set this property to the actions current frame, MAX_NAME */ short blendin; /* Number of frames of blending */ short priority; /* Execution priority */ short layer; /* Animation layer */ @@ -90,7 +90,7 @@ typedef struct bEditObjectActuator { short type, flag; struct Object *ob; struct Mesh *me; - char name[32]; + char name[64]; /* MAX_NAME */ float linVelocity[3]; /* initial lin. velocity on creation */ float angVelocity[3]; /* initial ang. velocity on creation */ float mass; @@ -107,7 +107,7 @@ typedef struct bSceneActuator { typedef struct bPropertyActuator { int pad, type; - char name[32], value[32]; + char name[64], value[64]; /* MAX_NAME */ struct Object *ob; } bPropertyActuator; @@ -125,8 +125,8 @@ typedef struct bObjectActuator { typedef struct bIpoActuator { short flag, type; float sta, end; - char name[32]; - char frameProp[32]; /* Set this property to the actions current frame */ + char name[64]; /* MAX_NAME */ + char frameProp[64]; /* Set this property to the actions current frame, MAX_NAME */ short pad1, pad2, pad3, pad4; @@ -147,13 +147,13 @@ typedef struct bConstraintActuator { int pad; float minloc[3], maxloc[3]; float minrot[3], maxrot[3]; - char matprop[32]; + char matprop[64]; /* MAX_NAME */ } bConstraintActuator; typedef struct bGroupActuator { short flag, type; int sta, end; - char name[32]; /* property or groupkey */ + char name[64]; /* property or groupkey, MAX_NAME */ short pad[3], cur, butsta, butend;/* not referenced, can remove? */ /* struct Group *group; not used, remove */ @@ -168,16 +168,16 @@ typedef struct bRandomActuator { int int_arg_2; float float_arg_1; float float_arg_2; - char propname[32]; + char propname[64]; /* MAX_NAME */ } bRandomActuator; typedef struct bMessageActuator { - char toPropName[32]; /* Send to all objects with this propertyname. Empty to broadcast. */ + char toPropName[64]; /* Send to all objects with this propertyname. Empty to broadcast. MAX_NAME. */ struct Object *toObject;/* (Possible future use) pointer to a single destination object. */ - char subject[32]; /* Message Subject to send. */ + char subject[64]; /* Message Subject to send. MAX_NAME. */ short bodyType, pad1; /* bodyType is either 'User defined text' or PropName */ int pad2; - char body[32]; /* Either User Defined Text or our PropName to send value of */ + char body[64]; /* Either User Defined Text or our PropName to send value of, MAX_NAME */ } bMessageActuator; typedef struct bGameActuator { @@ -220,8 +220,8 @@ typedef struct bStateActuator { } bStateActuator; typedef struct bArmatureActuator { - char posechannel[32]; - char constraint[32]; + char posechannel[64]; /* MAX_NAME */ + char constraint[64]; /* MAX_NAME */ int type; /* 0=run, 1=enable, 2=disable, 3=set target, 4=set weight */ float weight; struct Object *target; @@ -250,7 +250,7 @@ typedef struct bActuator { */ short flag; short otype, go; - char name[32]; + char name[64]; /* MAX_NAME */ /** * data must point to an object actuator type struct. @@ -520,10 +520,6 @@ typedef struct bActuator { #define ACT_STATE_REMOVE 2 #define ACT_STATE_CHANGE 3 -/* cameraactuator->axis */ -#define ACT_CAMERA_X (float)'x' -#define ACT_CAMERA_Y (float)'y' - /* steeringactuator->type */ #define ACT_STEERING_SEEK 0 #define ACT_STEERING_FLEE 1 diff --git a/source/blender/makesdna/DNA_armature_types.h b/source/blender/makesdna/DNA_armature_types.h index 45c30315575..33f965663de 100644 --- a/source/blender/makesdna/DNA_armature_types.h +++ b/source/blender/makesdna/DNA_armature_types.h @@ -49,7 +49,7 @@ typedef struct Bone { IDProperty *prop; /* User-Defined Properties on this Bone */ struct Bone *parent; /* Parent (ik parent if appropriate flag is set */ ListBase childbase; /* Children */ - char name[32]; /* Name of the bone - must be unique within the armature */ + char name[64]; /* Name of the bone - must be unique within the armature, MAXBONENAME */ float roll; /* roll is input for editmode, length calculated */ float head[3]; @@ -200,6 +200,6 @@ typedef enum eBone_Flag { BONE_NO_LOCAL_LOCATION = (1<<22) /* bone location is in armature space */ } eBone_Flag; -#define MAXBONENAME 32 +#define MAXBONENAME 64 #endif diff --git a/source/blender/makesdna/DNA_brush_types.h b/source/blender/makesdna/DNA_brush_types.h index e5c500f1fea..6e7385d683d 100644 --- a/source/blender/makesdna/DNA_brush_types.h +++ b/source/blender/makesdna/DNA_brush_types.h @@ -81,7 +81,7 @@ typedef struct Brush { float plane_offset; /* offset for plane brushes (clay, flatten, fill, scrape) */ char sculpt_tool; /* active sculpt tool */ - char vertexpaint_tool; /* active vertex/weight paint tool/blend mode */ + char vertexpaint_tool; /* active vertex/weight paint blend mode (poorly named) */ char imagepaint_tool; /* active image paint tool */ char pad3[5]; @@ -167,9 +167,20 @@ enum { SCULPT_DISP_DIR_VIEW, SCULPT_DISP_DIR_X, SCULPT_DISP_DIR_Y, - SCULPT_DISP_DIR_Z, + SCULPT_DISP_DIR_Z }; +enum { + PAINT_BLEND_MIX, + PAINT_BLEND_ADD, + PAINT_BLEND_SUB, + PAINT_BLEND_MUL, + PAINT_BLEND_BLUR, + PAINT_BLEND_LIGHTEN, + PAINT_BLEND_DARKEN +}; + + #define MAX_BRUSH_PIXEL_RADIUS 200 #endif diff --git a/source/blender/makesdna/DNA_constraint_types.h b/source/blender/makesdna/DNA_constraint_types.h index c829d5be294..fdc493ddfd3 100644 --- a/source/blender/makesdna/DNA_constraint_types.h +++ b/source/blender/makesdna/DNA_constraint_types.h @@ -61,11 +61,12 @@ typedef struct bConstraint { char ownspace; /* Space that owner should be evaluated in */ char tarspace; /* Space that target should be evaluated in (only used if 1 target) */ - char name[30]; /* Constraint name */ + char name[64]; /* Constraint name, MAX_NAME */ + + short pad; float enforce; /* Amount of influence exherted by constraint (0.0-1.0) */ float headtail; /* Point along subtarget bone where the actual target is. 0=head (default for all), 1=tail*/ - int pad; struct Ipo *ipo DNA_DEPRECATED; /* local influence ipo or driver */ /* old animation system, deprecated for 2.5 */ @@ -85,7 +86,7 @@ typedef struct bConstraintTarget { struct bConstraintTarget *next, *prev; struct Object *tar; /* object to use as target */ - char subtarget[32]; /* subtarget - pchan or vgroup name */ + char subtarget[64]; /* subtarget - pchan or vgroup name, MAX_ID_NAME-2 */ float matrix[4][4]; /* matrix used during constraint solving - should be cleared before each use */ @@ -121,7 +122,7 @@ typedef struct bPythonConstraint { ListBase targets; /* a list of targets that this constraint has (bConstraintTarget-s) */ struct Object *tar; /* target from previous implementation (version-patch sets this to NULL on file-load) */ - char subtarget[32]; /* subtarger from previous implentation (version-patch sets this to "" on file-load) */ + char subtarget[64]; /* subtarger from previous implentation (version-patch sets this to "" on file-load), MAX_ID_NAME-2 */ } bPythonConstraint; @@ -137,9 +138,9 @@ typedef struct bKinematicConstraint { short flag; /* All & CopyPose: some options Like CONSTRAINT_IK_TIP */ short rootbone; /* All: index to rootbone, if zero go all the way to mother bone */ short max_rootbone; /* CopyPose: for auto-ik, maximum length of chain */ - char subtarget[32]; /* All: String to specify sub-object target */ + char subtarget[64]; /* All: String to specify sub-object target, MAX_ID_NAME-2 */ struct Object *poletar; /* All: Pole vector target */ - char polesubtarget[32]; /* All: Pole vector sub-object target */ + char polesubtarget[64]; /* All: Pole vector sub-object target, MAX_ID_NAME-2 */ float poleangle; /* All: Pole vector rest angle */ float weight; /* All: Weight of constraint in IK tree */ float orientweight; /* CopyPose: Amount of rotation a target applies on chain */ @@ -187,7 +188,7 @@ typedef struct bTrackToConstraint { int reserved2; int flags; int pad; - char subtarget[32]; + char subtarget[64]; /* MAX_ID_NAME-2 */ } bTrackToConstraint; /* Copy Rotation Constraint */ @@ -195,7 +196,7 @@ typedef struct bRotateLikeConstraint { struct Object *tar; int flag; int reserved1; - char subtarget[32]; + char subtarget[64]; /* MAX_ID_NAME-2 */ } bRotateLikeConstraint; /* Copy Location Constraint */ @@ -203,7 +204,7 @@ typedef struct bLocateLikeConstraint { struct Object *tar; int flag; int reserved1; - char subtarget[32]; + char subtarget[64]; /* MAX_ID_NAME-2 */ } bLocateLikeConstraint; /* Copy Scale Constraint */ @@ -211,7 +212,7 @@ typedef struct bSizeLikeConstraint { struct Object *tar; int flag; int reserved1; - char subtarget[32]; + char subtarget[64]; /* MAX_ID_NAME-2 */ } bSizeLikeConstraint; /* Maintain Volume Constraint */ @@ -223,7 +224,7 @@ typedef struct bSameVolumeConstraint { /* Copy Transform Constraint */ typedef struct bTransLikeConstraint { struct Object *tar; - char subtarget[32]; + char subtarget[64]; /* MAX_ID_NAME-2 */ } bTransLikeConstraint; /* Floor Constraint */ @@ -234,7 +235,7 @@ typedef struct bMinMaxConstraint { int flag; short sticky, stuck, pad1, pad2; /* for backward compatibility */ float cache[3]; - char subtarget[32]; + char subtarget[64]; /* MAX_ID_NAME-2 */ } bMinMaxConstraint; /* Action Constraint */ @@ -248,7 +249,7 @@ typedef struct bActionConstraint { float max; int pad; struct bAction *act; - char subtarget[32]; + char subtarget[64]; /* MAX_ID_NAME-2 */ } bActionConstraint; /* Locked Axis Tracking constraint */ @@ -256,7 +257,7 @@ typedef struct bLockTrackConstraint { struct Object *tar; int trackflag; int lockflag; - char subtarget[32]; + char subtarget[64]; /* MAX_ID_NAME-2 */ } bLockTrackConstraint; /* Damped Tracking constraint */ @@ -264,7 +265,7 @@ typedef struct bDampTrackConstraint { struct Object *tar; int trackflag; int pad; - char subtarget[32]; + char subtarget[64]; /* MAX_ID_NAME-2 */ } bDampTrackConstraint; /* Follow Path constraints */ @@ -287,7 +288,7 @@ typedef struct bStretchToConstraint { int plane; float orglength; float bulge; - char subtarget[32]; + char subtarget[64]; /* MAX_ID_NAME-2 */ } bStretchToConstraint; /* Rigid Body constraint */ @@ -323,13 +324,13 @@ typedef struct bChildOfConstraint { int flag; /* settings */ int pad; float invmat[4][4]; /* parent-inverse matrix to use */ - char subtarget[32]; /* string to specify a subobject target */ + char subtarget[64]; /* string to specify a subobject target, MAX_ID_NAME-2 */ } bChildOfConstraint; /* Generic Transform->Transform Constraint */ typedef struct bTransformConstraint { struct Object *tar; /* target (i.e. 'driver' object/bone) */ - char subtarget[32]; + char subtarget[64]; /* MAX_ID_NAME-2 */ short from, to; /* can be loc(0) , rot(1), or size(2) */ char map[3]; /* defines which target-axis deform is copied by each owner-axis */ @@ -348,7 +349,7 @@ typedef struct bPivotConstraint { * Either target object + offset, or just offset is used */ struct Object *tar; /* target object (optional) */ - char subtarget[32]; /* subtarget name (optional) */ + char subtarget[64]; /* subtarget name (optional), MAX_ID_NAME-2 */ float offset[3]; /* offset from the target to use, regardless of whether it exists */ /* Rotation-driven activation: @@ -391,7 +392,7 @@ typedef struct bSizeLimitConstraint { /* Limit Distance Constraint */ typedef struct bDistLimitConstraint { struct Object *tar; - char subtarget[32]; + char subtarget[64]; /* MAX_ID_NAME-2 */ float dist; /* distance (radius of clamping sphere) from target */ float soft; /* distance from clamping-sphere to start applying 'fade' */ @@ -413,9 +414,9 @@ typedef struct bShrinkwrapConstraint { /* Follow Track constraints */ typedef struct bFollowTrackConstraint { struct MovieClip *clip; - char track[24]; + char track[64]; /* MAX_NAME */ int flag, pad; - char object[24]; + char object[64]; /* MAX_NAME */ struct Object *camera; struct Object *depth_ob; } bFollowTrackConstraint; @@ -430,7 +431,7 @@ typedef struct bCameraSolverConstraint { typedef struct bObjectSolverConstraint { struct MovieClip *clip; int flag, pad; - char object[24]; + char object[64]; /* MAX_NAME */ float invmat[4][4]; /* parent-inverse matrix to use */ struct Object *camera; } bObjectSolverConstraint; diff --git a/source/blender/makesdna/DNA_controller_types.h b/source/blender/makesdna/DNA_controller_types.h index c8f4325d717..51ab29db7ae 100644 --- a/source/blender/makesdna/DNA_controller_types.h +++ b/source/blender/makesdna/DNA_controller_types.h @@ -54,7 +54,7 @@ typedef struct bController { short type, flag, inputs, totlinks; short otype, totslinks, pad2, pad3; - char name[32]; + char name[64]; void *data; struct bActuator **links; diff --git a/source/blender/makesdna/DNA_customdata_types.h b/source/blender/makesdna/DNA_customdata_types.h index 8259eea42ce..00a0cf8881f 100644 --- a/source/blender/makesdna/DNA_customdata_types.h +++ b/source/blender/makesdna/DNA_customdata_types.h @@ -48,10 +48,12 @@ typedef struct CustomDataLayer { int active_clone; /* number of the layer to render*/ int active_mask; /* number of the layer to render*/ char pad[4]; - char name[32]; /* layer name */ + char name[64]; /* layer name, MAX_CUSTOMDATA_LAYER_AAME */ void *data; /* layer data */ } CustomDataLayer; +#define MAX_CUSTOMDATA_LAYER_NAME 64 + typedef struct CustomDataExternal { char filename[240]; /* FILE_MAX */ } CustomDataExternal; diff --git a/source/blender/makesdna/DNA_defs.h b/source/blender/makesdna/DNA_defs.h index 575938da653..46d7fc2b009 100644 --- a/source/blender/makesdna/DNA_defs.h +++ b/source/blender/makesdna/DNA_defs.h @@ -47,4 +47,7 @@ #define USE_BMESH_FORWARD_COMPAT +/* non-id name variables should use this length */ +#define MAX_NAME 64 + #endif /* DNA_DEFS_H */ diff --git a/source/blender/makesdna/DNA_dynamicpaint_types.h b/source/blender/makesdna/DNA_dynamicpaint_types.h index d58e11d9640..cee8e5cd8d7 100644 --- a/source/blender/makesdna/DNA_dynamicpaint_types.h +++ b/source/blender/makesdna/DNA_dynamicpaint_types.h @@ -111,7 +111,7 @@ typedef struct DynamicPaintSurface { /* initial color */ float init_color[4]; struct Tex *init_texture; - char init_layername[40]; + char init_layername[64]; /* MAX_CUSTOMDATA_LAYER_NAME */ int dry_speed, diss_speed; float depth_clamp, disp_factor; @@ -124,10 +124,10 @@ typedef struct DynamicPaintSurface { int pad_; - char uvlayer_name[32]; + char uvlayer_name[64]; /* MAX_CUSTOMDATA_LAYER_NAME */ char image_output_path[240]; - char output_name[40]; - char output_name2[40]; /* some surfaces have 2 outputs */ + char output_name[64]; /* MAX_CUSTOMDATA_LAYER_NAME */ + char output_name2[64]; /* MAX_CUSTOMDATA_LAYER_NAME */ /* some surfaces have 2 outputs */ } DynamicPaintSurface; diff --git a/source/blender/makesdna/DNA_effect_types.h b/source/blender/makesdna/DNA_effect_types.h index b7437b5e973..ddff22aae37 100644 --- a/source/blender/makesdna/DNA_effect_types.h +++ b/source/blender/makesdna/DNA_effect_types.h @@ -118,7 +118,7 @@ typedef struct PartEff { short staticstep, omat, timetex, speedtex, flag2, flag2neg; short disp, vertgroup_v; - char vgroupname[32], vgroupname_v[32]; + char vgroupname[64], vgroupname_v[64]; /* MAX_VGROUP_NAME */ float imat[4][4]; /* inverse matrix of parent Object */ Particle *keys; diff --git a/source/blender/makesdna/DNA_key_types.h b/source/blender/makesdna/DNA_key_types.h index 12fb9b92602..b64389a365c 100644 --- a/source/blender/makesdna/DNA_key_types.h +++ b/source/blender/makesdna/DNA_key_types.h @@ -48,8 +48,8 @@ typedef struct KeyBlock { void *data; float *weights; - char name[32]; - char vgroup[32]; + char name[64]; /* MAX_NAME */ + char vgroup[64]; /* MAX_VGROUP_NAME */ float slidermin; float slidermax; @@ -61,7 +61,7 @@ typedef struct Key { struct AnimData *adt; /* animation data (must be immediately after id for utilities to use it) */ KeyBlock *refkey; - char elemstr[32]; + char elemstr[64]; /* MAX_NAME */ int elemsize; float curval DNA_DEPRECATED; diff --git a/source/blender/makesdna/DNA_lattice_types.h b/source/blender/makesdna/DNA_lattice_types.h index 2a67afb5708..0a73ed5b24f 100644 --- a/source/blender/makesdna/DNA_lattice_types.h +++ b/source/blender/makesdna/DNA_lattice_types.h @@ -66,7 +66,7 @@ typedef struct Lattice { struct Key *key; struct MDeformVert *dvert; - char vgroup[32]; /* multiply the influence */ + char vgroup[64]; /* multiply the influence, MAX_VGROUP_NAME */ /* used while deforming, always free and NULL after use */ float *latticedata; diff --git a/source/blender/makesdna/DNA_material_types.h b/source/blender/makesdna/DNA_material_types.h index 82939d96ca0..98a15235229 100644 --- a/source/blender/makesdna/DNA_material_types.h +++ b/source/blender/makesdna/DNA_material_types.h @@ -121,7 +121,7 @@ typedef struct Material { float hasize, flaresize, subsize, flareboost; float strand_sta, strand_end, strand_ease, strand_surfnor; float strand_min, strand_widthfade; - char strand_uvname[32]; + char strand_uvname[64]; /* MAX_CUSTOMDATA_LAYER_NAME */ float sbias; /* shadow bias to prevent terminator prob */ float lbias; /* factor to multiply lampbias with (0.0 = no mult) */ diff --git a/source/blender/makesdna/DNA_meta_types.h b/source/blender/makesdna/DNA_meta_types.h index ae658cee8f5..863e2b2e6ed 100644 --- a/source/blender/makesdna/DNA_meta_types.h +++ b/source/blender/makesdna/DNA_meta_types.h @@ -45,7 +45,6 @@ typedef struct MetaElem { struct MetaElem *next, *prev; struct BoundBox *bb; /* Bound Box of MetaElem */ - int i1,j1,k1, i2,j2,k2; /* corners of Bounding Box in lattice */ short type, flag, selcol1, selcol2; float x, y, z; /* Position of center of MetaElem */ diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h index 77fa03aeedc..e310f148110 100644 --- a/source/blender/makesdna/DNA_modifier_types.h +++ b/source/blender/makesdna/DNA_modifier_types.h @@ -96,7 +96,7 @@ typedef struct ModifierData { int type, mode; int stackindex, pad; - char name[32]; + char name[64]; /* MAX_NAME */ /* XXX for timing info set by caller... solve later? (ton) */ struct Scene *scene; @@ -117,7 +117,7 @@ typedef struct MappingInfoModifierData { struct Tex *texture; struct Object *map_object; - char uvlayer_name[32]; + char uvlayer_name[64]; /* MAX_CUSTOMDATA_LAYER_NAME */ int uvlayer_tmp; int texmapping; } MappingInfoModifierData; @@ -134,14 +134,14 @@ typedef struct LatticeModifierData { ModifierData modifier; struct Object *object; - char name[32]; /* optional vertexgroup name */ + char name[64]; /* optional vertexgroup name, MAX_VGROUP_NAME */ } LatticeModifierData; typedef struct CurveModifierData { ModifierData modifier; struct Object *object; - char name[32]; /* optional vertexgroup name */ + char name[64]; /* optional vertexgroup name, MAX_VGROUP_NAME */ short defaxis; /* axis along which curve deforms */ char pad[6]; } CurveModifierData; @@ -166,7 +166,7 @@ typedef struct MaskModifierData { ModifierData modifier; struct Object *ob_arm; /* armature to use to in place of hardcoded vgroup */ - char vgroup[32]; /* name of vertex group to use to mask */ + char vgroup[64]; /* name of vertex group to use to mask, MAX_VGROUP_NAME */ int mode; /* using armature or hardcoded vgroup */ int flag; /* flags for various things */ @@ -278,7 +278,7 @@ typedef struct BevelModifierData { short lim_flags; /* flags to tell the tool how to limit the bevel */ short e_flags; /* flags to direct how edge weights are applied to verts */ float bevel_angle; /* if the BME_BEVEL_ANGLE is set, this will be how "sharp" an edge must be before it gets beveled */ - char defgrp_name[32]; /* if the BME_BEVEL_VWEIGHT option is set, this will be the name of the vert group */ + char defgrp_name[64]; /* if the BME_BEVEL_VWEIGHT option is set, this will be the name of the vert group, MAX_VGROUP_NAME */ } BevelModifierData; typedef struct BMeshModifierData { @@ -310,14 +310,14 @@ typedef struct DisplaceModifierData { /* keep in sync with MappingInfoModifierData */ struct Tex *texture; struct Object *map_object; - char uvlayer_name[32]; + char uvlayer_name[64]; /* MAX_CUSTOMDATA_LAYER_NAME */ int uvlayer_tmp; int texmapping; /* end MappingInfoModifierData */ float strength; int direction; - char defgrp_name[32]; + char defgrp_name[64]; /* MAX_VGROUP_NAME */ float midlevel; int pad; } DisplaceModifierData; @@ -349,7 +349,7 @@ typedef struct UVProjectModifierData { int num_projectors; float aspectx, aspecty; float scalex, scaley; - char uvlayer_name[32]; + char uvlayer_name[64]; /* MAX_CUSTOMDATA_LAYER_NAME */ int uvlayer_tmp, pad; } UVProjectModifierData; @@ -373,7 +373,7 @@ typedef struct DecimateModifierData { typedef struct SmoothModifierData { ModifierData modifier; float fac; - char defgrp_name[32]; + char defgrp_name[64]; /* MAX_VGROUP_NAME */ short flag, repeat; } SmoothModifierData; @@ -397,7 +397,7 @@ typedef struct CastModifierData { float fac; float radius; float size; - char defgrp_name[32]; + char defgrp_name[64]; /* MAX_VGROUP_NAME */ short flag, type; } CastModifierData; @@ -416,13 +416,13 @@ typedef struct WaveModifierData { /* keep in sync with MappingInfoModifierData */ struct Tex *texture; struct Object *map_object; - char uvlayer_name[32]; + char uvlayer_name[64]; /* MAX_CUSTOMDATA_LAYER_NAME */ int uvlayer_tmp; int texmapping; /* end MappingInfoModifierData */ struct Object *objectcenter; - char defgrp_name[32]; + char defgrp_name[64]; /* MAX_VGROUP_NAME */ short flag, pad; @@ -440,14 +440,14 @@ typedef struct ArmatureModifierData { int pad2; struct Object *object; float *prevCos; /* stored input of previous modifier, for vertexgroup blending */ - char defgrp_name[32]; + char defgrp_name[64]; /* MAX_VGROUP_NAME */ } ArmatureModifierData; typedef struct HookModifierData { ModifierData modifier; struct Object *object; - char subtarget[32]; /* optional name of bone target */ + char subtarget[64]; /* optional name of bone target, MAX_ID_NAME-2 */ float parentinv[4][4]; /* matrix making current transform unmodified */ float cent[3]; /* visualization of hook */ @@ -456,7 +456,7 @@ typedef struct HookModifierData { int *indexar; /* if NULL, it's using vertexgroup */ int totindex; float force; - char name[32]; /* optional vertexgroup name */ + char name[64]; /* optional vertexgroup name, MAX_VGROUP_NAME */ } HookModifierData; typedef struct SoftbodyModifierData { @@ -537,7 +537,7 @@ typedef struct MeshDeformModifierData { ModifierData modifier; struct Object *object; /* mesh object */ - char defgrp_name[32]; /* optional vertexgroup name */ + char defgrp_name[64]; /* optional vertexgroup name, MAX_VGROUP_NAME */ short gridsize, flag, mode, pad; @@ -613,7 +613,7 @@ typedef struct ExplodeModifierData { int *facepa; short flag, vgroup; float protect; - char uvname[32]; + char uvname[64]; /* MAX_CUSTOMDATA_LAYER_NAME */ } ExplodeModifierData; typedef struct MultiresModifierData { @@ -640,7 +640,7 @@ typedef struct ShrinkwrapModifierData { struct Object *target; /* shrink target */ struct Object *auxTarget; /* additional shrink target */ - char vgroup_name[32]; /* optional vertexgroup name */ + char vgroup_name[64]; /* optional vertexgroup name, MAX_VGROUP_NAME */ float keepDist; /* distance offset to keep from mesh/projection point */ short shrinkType; /* shrink type projection */ short shrinkOpts; /* shrink options */ @@ -680,7 +680,7 @@ typedef struct SimpleDeformModifierData { ModifierData modifier; struct Object *origin; /* object to control the origin of modifier space coordinates */ - char vgroup_name[32]; /* optional vertexgroup name */ + char vgroup_name[64]; /* optional vertexgroup name, MAX_VGROUP_NAME */ float factor; /* factors to control simple deforms */ float limit[2]; /* lower and upper limit */ @@ -712,7 +712,7 @@ typedef struct ShapeKeyModifierData { typedef struct SolidifyModifierData { ModifierData modifier; - char defgrp_name[32]; /* name of vertex group to use */ + char defgrp_name[64]; /* name of vertex group to use, MAX_VGROUP_NAME */ float offset; /* new surface offset level*/ float offset_fac; /* midpoint of the offset */ float offset_fac_vg; /* factor for the minimum weight to use when vgroups are used, avoids 0.0 weights giving duplicate geometry */ @@ -774,7 +774,7 @@ typedef struct OceanModifierData { int bakeend; char cachepath[240]; // FILE_MAX - char foamlayername[32]; + char foamlayername[64]; /* MAX_CUSTOMDATA_LAYER_NAME */ char cached; char geometry_mode; @@ -814,7 +814,7 @@ typedef struct WarpModifierData { /* keep in sync with MappingInfoModifierData */ struct Tex *texture; struct Object *map_object; - char uvlayer_name[32]; + char uvlayer_name[64]; /* MAX_CUSTOMDATA_LAYER_NAME */ int uvlayer_tmp; int texmapping; /* end MappingInfoModifierData */ @@ -822,7 +822,7 @@ typedef struct WarpModifierData { struct Object *object_from; struct Object *object_to; struct CurveMapping *curfalloff; - char defgrp_name[32]; /* optional vertexgroup name */ + char defgrp_name[64]; /* optional vertexgroup name, MAX_VGROUP_NAME */ float strength; float falloff_radius; char flag; /* not used yet */ @@ -850,7 +850,7 @@ typedef struct WeightVGEditModifierData { /* Note: I tried to keep everything logically ordered - provided the * alignment constraints... */ - char defgrp_name[32]; /* Name of vertex group to edit. */ + char defgrp_name[64]; /* Name of vertex group to edit. MAX_VGROUP_NAME. */ short edit_flags; /* Using MOD_WVG_EDIT_* flags. */ short falloff_type; /* Using MOD_WVG_MAPPING_* defines. */ @@ -865,7 +865,7 @@ typedef struct WeightVGEditModifierData { /* Masking options. */ float mask_constant; /* The global "influence", if no vgroup nor tex is used as mask. */ /* Name of mask vertex group from which to get weight factors. */ - char mask_defgrp_name[32]; + char mask_defgrp_name[64]; /* MAX_VGROUP_NAME */ /* Texture masking. */ int mask_tex_use_channel; /* Which channel to use as weightf. */ @@ -873,7 +873,7 @@ typedef struct WeightVGEditModifierData { struct Object *mask_tex_map_obj; /* Name of the map object. */ /* How to map the texture (using MOD_DISP_MAP_* constants). */ int mask_tex_mapping; - char mask_tex_uvlayer_name[32]; /* Name of the UV map. */ + char mask_tex_uvlayer_name[64]; /* Name of the UV map. MAX_CUSTOMDATA_LAYER_NAME */ /* Padding... */ int pad_i1; @@ -899,8 +899,8 @@ typedef struct WeightVGMixModifierData { /* XXX Note: I tried to keep everything logically ordered – provided the * alignment constraints... */ - char defgrp_name_a[32]; /* Name of vertex group to modify/weight. */ - char defgrp_name_b[32]; /* Name of other vertex group to mix in. */ + char defgrp_name_a[64]; /* Name of vertex group to modify/weight. MAX_VGROUP_NAME. */ + char defgrp_name_b[64]; /* Name of other vertex group to mix in. MAX_VGROUP_NAME. */ float default_weight_a; /* Default weight value for first vgroup. */ float default_weight_b; /* Default weight value to mix in. */ char mix_mode; /* How second vgroups weights affect first ones */ @@ -911,14 +911,14 @@ typedef struct WeightVGMixModifierData { /* Masking options. */ float mask_constant; /* The global "influence", if no vgroup nor tex is used as mask. */ /* Name of mask vertex group from which to get weight factors. */ - char mask_defgrp_name[32]; + char mask_defgrp_name[64]; /* MAX_VGROUP_NAME */ /* Texture masking. */ int mask_tex_use_channel; /* Which channel to use as weightf. */ struct Tex *mask_texture; /* The texture. */ struct Object *mask_tex_map_obj; /* Name of the map object. */ int mask_tex_mapping; /* How to map the texture! */ - char mask_tex_uvlayer_name[32]; /* Name of the UV map. */ + char mask_tex_uvlayer_name[64]; /* Name of the UV map. MAX_CUSTOMDATA_LAYER_NAME. */ /* Padding... */ int pad_i1; @@ -946,7 +946,7 @@ typedef struct WeightVGProximityModifierData { /* Note: I tried to keep everything logically ordered - provided the * alignment constraints... */ - char defgrp_name[32]; /* Name of vertex group to modify/weight. */ + char defgrp_name[64]; /* Name of vertex group to modify/weight. MAX_VGROUP_NAME. */ /* Proximity modes. */ int proximity_mode; @@ -958,14 +958,14 @@ typedef struct WeightVGProximityModifierData { /* Masking options. */ float mask_constant; /* The global "influence", if no vgroup nor tex is used as mask. */ /* Name of mask vertex group from which to get weight factors. */ - char mask_defgrp_name[32]; + char mask_defgrp_name[64]; /* MAX_VGROUP_NAME */ /* Texture masking. */ int mask_tex_use_channel; /* Which channel to use as weightf. */ struct Tex *mask_texture; /* The texture. */ struct Object *mask_tex_map_obj; /* Name of the map object. */ int mask_tex_mapping; /* How to map the texture! */ - char mask_tex_uvlayer_name[32]; /* Name of the UV Map. */ + char mask_tex_uvlayer_name[64]; /* Name of the UV Map. MAX_CUSTOMDATA_LAYER_NAME. */ float min_dist, max_dist; /* Distances mapping to 0.0/1.0 weights. */ diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h index e2d612169e7..fe4f6905f42 100644 --- a/source/blender/makesdna/DNA_node_types.h +++ b/source/blender/makesdna/DNA_node_types.h @@ -49,7 +49,7 @@ struct bGPdata; struct uiBlock; struct Image; -#define NODE_MAXSTR 32 +#define NODE_MAXSTR 64 typedef struct bNodeStack { float vec[4]; @@ -71,7 +71,7 @@ typedef struct bNodeStack { typedef struct bNodeSocket { struct bNodeSocket *next, *prev, *new_sock; - char name[32]; + char name[64]; /* MAX_NAME */ void *storage; /* custom storage */ @@ -142,7 +142,7 @@ typedef struct bNodePreview { typedef struct bNode { struct bNode *next, *prev, *new_node; - char name[32]; + char name[64]; /* MAX_NAME */ short type, flag; short done, level; /* both for dependency and sorting */ short lasty, menunr; /* lasty: check preview render status, menunr: browse ID blocks */ @@ -160,7 +160,7 @@ typedef struct bNode { int update; /* update flags */ - char label[32]; /* custom user-defined label */ + char label[64]; /* custom user-defined label, MAX_NAME */ short custom1, custom2; /* to be abused for buttons */ float custom3, custom4; @@ -369,12 +369,12 @@ typedef struct NodeTwoFloats { } NodeTwoFloats; typedef struct NodeGeometry { - char uvname[32]; - char colname[32]; + char uvname[64]; /* MAX_CUSTOMDATA_LAYER_NAME */ + char colname[64]; } NodeGeometry; typedef struct NodeVertexCol { - char name[32]; + char name[64]; } NodeVertexCol; /* qdn: Defocus blur node */ @@ -448,6 +448,10 @@ typedef struct NodeTexImage { int color_space, pad; } NodeTexImage; +typedef struct NodeTexChecker { + NodeTexBase base; +} NodeTexChecker; + typedef struct NodeTexEnvironment { NodeTexBase base; int color_space, pad; @@ -493,7 +497,7 @@ typedef struct NodeShaderAttribute { /* TEX_output */ typedef struct TexNodeOutput { - char name[32]; + char name[64]; } TexNodeOutput; /* comp channel matte */ diff --git a/source/blender/makesdna/DNA_object_force.h b/source/blender/makesdna/DNA_object_force.h index 5875ff30bcc..28c28bbf329 100644 --- a/source/blender/makesdna/DNA_object_force.h +++ b/source/blender/makesdna/DNA_object_force.h @@ -274,7 +274,7 @@ typedef struct SoftBody { /* general options */ float nodemass; /* softbody mass of *vertex* */ - char namedVG_Mass[32]; /* along with it introduce mass painting + char namedVG_Mass[64]; /* MAX_VGROUP_NAME */ /* along with it introduce mass painting starting to fix old bug .. nastyness that VG are indexes rather find them by name tag to find it -> jow20090613 */ float grav; /* softbody amount of gravitaion to apply */ @@ -289,7 +289,7 @@ typedef struct SoftBody { float maxgoal; float defgoal; /* default goal for vertices without vgroup */ short vertgroup; /* index starting at 1 */ - char namedVG_Softgoal[32]; /* starting to fix old bug .. nastyness that VG are indexes + char namedVG_Softgoal[64]; /* MAX_VGROUP_NAME */ /* starting to fix old bug .. nastyness that VG are indexes rather find them by name tag to find it -> jow20090613 */ short fuzzyness; /* */ @@ -297,7 +297,7 @@ typedef struct SoftBody { /* springs */ float inspring; /* softbody inner springs */ float infrict; /* softbody inner springs friction */ - char namedVG_Spring_K[32]; /* along with it introduce Spring_K painting + char namedVG_Spring_K[64]; /* MAX_VGROUP_NAME */ /* along with it introduce Spring_K painting starting to fix old bug .. nastyness that VG are indexes rather find them by name tag to find it -> jow20090613 */ @@ -337,8 +337,8 @@ typedef struct SoftBody { float lcom[3]; float lrot[3][3]; float lscale[3][3]; - char pad4[4]; + int last_frame; } SoftBody; diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h index 7f1239195ec..b8580b47269 100644 --- a/source/blender/makesdna/DNA_object_types.h +++ b/source/blender/makesdna/DNA_object_types.h @@ -61,11 +61,11 @@ struct bGPdata; /* Vertex Groups - Name Info */ typedef struct bDeformGroup { struct bDeformGroup *next, *prev; - char name[32]; + char name[64]; /* MAX_VGROUP_NAME */ /* need this flag for locking weights */ char flag, pad[7]; } bDeformGroup; -#define MAX_VGROUP_NAME 32 +#define MAX_VGROUP_NAME 64 /* bDeformGroup->flag */ #define DG_LOCK_WEIGHT 1 @@ -107,7 +107,7 @@ typedef struct Object { short type, partype; int par1, par2, par3; /* can be vertexnrs */ - char parsubstr[32]; /* String describing subobject info */ + char parsubstr[64]; /* String describing subobject info, MAX_ID_NAME-2 */ struct Object *parent, *track; /* if ob->proxy (or proxy_group), this object is proxy for object ob->proxy */ /* proxy_from is set in target back to the proxy. */ @@ -273,7 +273,7 @@ typedef struct ObHook { float cent[3]; /* visualization of hook */ float falloff; /* if not zero, falloff is distance where influence zero */ - char name[32]; + char name[64]; /* MAX_NAME */ int *indexar; int totindex, curindex; /* curindex is cache for fast lookup */ diff --git a/source/blender/makesdna/DNA_particle_types.h b/source/blender/makesdna/DNA_particle_types.h index 07efd17df7f..4c3279c6527 100644 --- a/source/blender/makesdna/DNA_particle_types.h +++ b/source/blender/makesdna/DNA_particle_types.h @@ -261,7 +261,7 @@ typedef struct ParticleSystem struct ListBase targets; /* used for keyed and boid physics */ - char name[32]; /* particle system name */ + char name[64]; /* particle system name, MAX_NAME */ float imat[4][4]; /* used for duplicators */ float cfra, tree_frame, bvhtree_frame; @@ -269,7 +269,7 @@ typedef struct ParticleSystem int flag, totpart, totunexist, totchild, totcached, totchildcache; short recalc, target_psys, totkeyed, bakespace; - char bb_uvname[3][32]; /* billboard uv name */ + char bb_uvname[3][64]; /* billboard uv name, MAX_CUSTOMDATA_LAYER_NAME */ /* if you change these remember to update array lengths to PSYS_TOT_VG! */ short vgroup[12], vg_neg, rt3; /* vertex groups, 0==disable, 1==starting index */ diff --git a/source/blender/makesdna/DNA_property_types.h b/source/blender/makesdna/DNA_property_types.h index e74ae41a421..a36e362632b 100644 --- a/source/blender/makesdna/DNA_property_types.h +++ b/source/blender/makesdna/DNA_property_types.h @@ -43,7 +43,7 @@ typedef struct bProperty { struct bProperty *next, *prev; - char name[32]; + char name[64]; /* MAX_NAME */ short type, flag; int data; /* data should be 4 bytes to store int,float stuff */ void *poin; /* references data unless its a string which is malloc'd */ diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index 4d74089972b..5cb6fca7c5e 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -60,6 +60,10 @@ struct SceneStats; struct bGPdata; struct MovieClip; +/* ************************************************************* */ +/* Scene Data */ + +/* Base - Wrapper for referencing Objects in a Scene */ typedef struct Base { struct Base *next, *prev; unsigned int lay, selcol; @@ -68,6 +72,9 @@ typedef struct Base { struct Object *object; } Base; +/* ************************************************************* */ +/* Output Format Data */ + typedef struct AviCodecData { void *lpFormat; /* save format */ void *lpParms; /* compressor options */ @@ -143,6 +150,8 @@ typedef struct FFMpegCodecData { IDProperty *properties; } FFMpegCodecData; +/* ************************************************************* */ +/* Audio */ typedef struct AudioData { int mixrate; // 2.5: now in FFMpegCodecData: audio_mixrate @@ -156,10 +165,14 @@ typedef struct AudioData { float pad2; } AudioData; +/* *************************************************************** */ +/* Render Layers */ + +/* Render Layer */ typedef struct SceneRenderLayer { struct SceneRenderLayer *next, *prev; - char name[32]; + char name[64]; /* MAX_NAME */ struct Material *mat_override; struct Group *light_override; @@ -216,6 +229,7 @@ typedef struct SceneRenderLayer { /* note, srl->passflag is treestore element 'nr' in outliner, short still... */ +/* *************************************************************** */ /* Generic image format settings, * this is used for NodeImageFile and IMAGE_OT_save_as operator too. @@ -319,6 +333,9 @@ typedef struct ImageFormatData { /* ImageFormatData.cineon_flag */ #define R_IMF_CINEON_FLAG_LOG (1<<0) /* was R_CINEON_LOG */ +/* *************************************************************** */ +/* Render Data */ + typedef struct RenderData { struct ImageFormatData im_format; @@ -504,6 +521,9 @@ typedef struct RenderData { char engine[32]; } RenderData; +/* *************************************************************** */ +/* Render Conversion/Simplfication Settings */ + /* control render convert and shading engine */ typedef struct RenderProfile { struct RenderProfile *next, *prev; @@ -518,6 +538,9 @@ typedef struct RenderProfile { } RenderProfile; +/* *************************************************************** */ +/* Game Engine - Dome */ + typedef struct GameDome { short res, mode; short angle, tilt; @@ -532,6 +555,9 @@ typedef struct GameDome { #define DOME_PANORAM_SPH 5 #define DOME_NUM_MODES 6 +/* *************************************************************** */ +/* Game Engine */ + typedef struct GameFraming { float col[3]; char type, pad1, pad2, pad3; @@ -562,8 +588,9 @@ typedef struct GameData { /* standalone player */ struct GameFraming framing; - short fullscreen, xplay, yplay, freqplay; + short playerflag, xplay, yplay, freqplay; short depth, attrib, rt1, rt2; + short aasamples, pad4[3]; /* stereo/dome mode */ struct GameDome dome; @@ -640,11 +667,18 @@ typedef struct GameData { #define GAME_SHOW_OBSTACLE_SIMULATION (1 << 16) /* Note: GameData.flag is now an int (max 32 flags). A short could only take 16 flags */ +/* GameData.playerflag */ +#define GAME_PLAYER_FULLSCREEN (1 << 0) +#define GAME_PLAYER_DESKTOP_RESOLUTION (1 << 1) + /* GameData.matmode */ #define GAME_MAT_TEXFACE 0 #define GAME_MAT_MULTITEX 1 #define GAME_MAT_GLSL 2 +/* *************************************************************** */ +/* Markers */ + typedef struct TimeMarker { struct TimeMarker *next, *prev; int frame; @@ -653,6 +687,10 @@ typedef struct TimeMarker { struct Object *camera; } TimeMarker; +/* *************************************************************** */ +/* Paint Mode/Tool Data */ + +/* Paint Tool Base */ typedef struct Paint { struct Brush *brush; @@ -663,6 +701,10 @@ typedef struct Paint { int flags; } Paint; +/* ------------------------------------------- */ +/* Image Paint */ + +/* Texture/Image Editor */ typedef struct ImagePaintSettings { Paint paint; @@ -677,6 +719,10 @@ typedef struct ImagePaintSettings { void *paintcursor; /* wm handle */ } ImagePaintSettings; +/* ------------------------------------------- */ +/* Particle Edit */ + +/* Settings for a Particle Editing Brush */ typedef struct ParticleBrushData { short size; /* common setting */ short step, invert, count; /* for specific brushes only */ @@ -684,6 +730,7 @@ typedef struct ParticleBrushData { float strength; } ParticleBrushData; +/* Particle Edit Mode Settings */ typedef struct ParticleEditSettings { short flag; short totrekey; @@ -704,12 +751,10 @@ typedef struct ParticleEditSettings { struct Object *object; } ParticleEditSettings; -typedef struct TransformOrientation { - struct TransformOrientation *next, *prev; - char name[36]; - float mat[3][3]; -} TransformOrientation; +/* ------------------------------------------- */ +/* Sculpt */ +/* Sculpt */ typedef struct Sculpt { Paint paint; @@ -740,6 +785,10 @@ typedef struct Sculpt { int pad; } Sculpt; +/* ------------------------------------------- */ +/* Vertex Paint */ + +/* Vertex Paint */ typedef struct VPaint { Paint paint; @@ -753,13 +802,59 @@ typedef struct VPaint { /* VPaint flag */ #define VP_COLINDEX 1 -#define VP_AREA 2 +#define VP_AREA 2 /* vertex paint only */ #define VP_NORMALS 8 #define VP_SPRAY 16 // #define VP_MIRROR_X 32 // deprecated in 2.5x use (me->editflag & ME_EDIT_MIRROR_X) -#define VP_ONLYVGROUP 128 +#define VP_ONLYVGROUP 128 /* weight paint only */ + +/* *************************************************************** */ +/* Transform Orientations */ + +typedef struct TransformOrientation { + struct TransformOrientation *next, *prev; + char name[64]; /* MAX_NAME */ + float mat[3][3]; + int pad; +} TransformOrientation; + +/* *************************************************************** */ +/* Unified Paint Settings */ + +/* These settings can override the equivalent fields in the active + Brush for any paint mode; the flag field controls whether these + values are used */ +typedef struct UnifiedPaintSettings { + /* unified radius of brush in pixels */ + int size; + + /* unified radius of brush in Blender units */ + float unprojected_radius; + + /* unified strength of brush */ + float alpha; + + /* user preferences for sculpt and paint */ + int flag; +} UnifiedPaintSettings; + +typedef enum { + UNIFIED_PAINT_SIZE = (1<<0), + UNIFIED_PAINT_ALPHA = (1<<1), + + /* only used if unified size is enabled, mirros the brush flags + BRUSH_LOCK_SIZE and BRUSH_SIZE_PRESSURE */ + UNIFIED_PAINT_BRUSH_LOCK_SIZE = (1<<2), + UNIFIED_PAINT_BRUSH_SIZE_PRESSURE = (1<<3), + + /* only used if unified alpha is enabled, mirrors the brush flag + BRUSH_ALPHA_PRESSURE */ + UNIFIED_PAINT_BRUSH_ALPHA_PRESSURE = (1<<4) +} UnifiedPaintSettingsFlags; +/* *************************************************************** */ +/* Tool Settings */ typedef struct ToolSettings { VPaint *vpaint; /* vertex paint */ @@ -830,13 +925,9 @@ typedef struct ToolSettings { /* Auto-Keying Mode */ short autokey_mode, autokey_flag; /* defines in DNA_userdef_types.h */ - /* Retopo */ - char retopo_mode; - char retopo_paint_tool; - char line_div, ellipse_div, retopo_hotspot; - /* Multires */ char multires_subdiv_type; + char pad2[5]; /* Skeleton generation */ short skgen_resolution; @@ -880,33 +971,52 @@ typedef struct ToolSettings { char auto_normalize; /*auto normalizing mode in wpaint*/ char multipaint; /* paint multiple bones in wpaint */ - short sculpt_paint_settings; /* user preferences for sculpt and paint */ + /* XXX: these sculpt_paint_* fields are deprecated, use the + unified_paint_settings field instead! */ + short sculpt_paint_settings DNA_DEPRECATED; short pad1; - int sculpt_paint_unified_size; /* unified radius of brush in pixels */ - float sculpt_paint_unified_unprojected_radius;/* unified radius of brush in Blender units */ - float sculpt_paint_unified_alpha; /* unified strength of brush */ + int sculpt_paint_unified_size DNA_DEPRECATED; + float sculpt_paint_unified_unprojected_radius DNA_DEPRECATED; + float sculpt_paint_unified_alpha DNA_DEPRECATED; + + /* Unified Paint Settings */ + struct UnifiedPaintSettings unified_paint_settings; } ToolSettings; +/* *************************************************************** */ +/* Assorted Scene Data */ + +/* ------------------------------------------- */ +/* Stats (show in Info header) */ + typedef struct bStats { /* scene totals for visible layers */ int totobj, totlamp, totobjsel, totcurve, totmesh, totarmature; int totvert, totface; } bStats; +/* ------------------------------------------- */ +/* Unit Settings */ + typedef struct UnitSettings { /* Display/Editing unit options for each scene */ float scale_length; /* maybe have other unit conversions? */ char system; /* imperial, metric etc */ char system_rotation; /* not implimented as a propper unit system yet */ short flag; - } UnitSettings; +/* ------------------------------------------- */ +/* Global/Common Physics Settings */ + typedef struct PhysicsSettings { float gravity[3]; int flag, quick_cache_step, rt; } PhysicsSettings; +/* *************************************************************** */ +/* Scene ID-Block */ + typedef struct Scene { ID id; struct AnimData *adt; /* animation data (must be immediately after id for utilities to use it) */ @@ -964,7 +1074,7 @@ typedef struct Scene { /* User-Defined KeyingSets */ int active_keyingset; /* index of the active KeyingSet. first KeyingSet has index 1, 'none' active is 0, 'add new' is -1 */ - ListBase keyingsets; /* KeyingSets for the given frame */ + ListBase keyingsets; /* KeyingSets for this scene */ /* Game Settings */ struct GameFraming framing DNA_DEPRECATED; // XXX deprecated since 2.5 @@ -1276,6 +1386,7 @@ typedef struct Scene { #define FFMPEG_MULTIPLEX_AUDIO 1 /* deprecated, you can choose none as audiocodec now */ #define FFMPEG_AUTOSPLIT_OUTPUT 2 +#define FFMPEG_LOSSLESS_OUTPUT 4 /* Paint.flags */ typedef enum { @@ -1298,13 +1409,6 @@ typedef enum SculptFlags { SCULPT_ONLY_DEFORM = (1<<8), } SculptFlags; -/* sculpt_paint_settings */ -#define SCULPT_PAINT_USE_UNIFIED_SIZE (1<<0) -#define SCULPT_PAINT_USE_UNIFIED_ALPHA (1<<1) -#define SCULPT_PAINT_UNIFIED_LOCK_BRUSH_SIZE (1<<2) -#define SCULPT_PAINT_UNIFIED_SIZE_PRESSURE (1<<3) -#define SCULPT_PAINT_UNIFIED_ALPHA_PRESSURE (1<<4) - /* ImagePaintSettings.flag */ #define IMAGEPAINT_DRAWING 1 // #define IMAGEPAINT_DRAW_TOOL 2 // deprecated @@ -1376,15 +1480,6 @@ typedef enum SculptFlags { #define PE_TYPE_SOFTBODY 1 #define PE_TYPE_CLOTH 2 -/* toolsettings->retopo_mode */ -#define RETOPO 1 -#define RETOPO_PAINT 2 - -/* toolsettings->retopo_paint_tool */ /*UNUSED*/ -/* #define RETOPO_PEN 1 */ -/* #define RETOPO_LINE 2 */ -/* #define RETOPO_ELLIPSE 4 */ - /* toolsettings->skgen_options */ #define SKGEN_FILTER_INTERNAL (1 << 0) #define SKGEN_FILTER_EXTERNAL (1 << 1) diff --git a/source/blender/makesdna/DNA_sensor_types.h b/source/blender/makesdna/DNA_sensor_types.h index e7444b06898..80f19b30079 100644 --- a/source/blender/makesdna/DNA_sensor_types.h +++ b/source/blender/makesdna/DNA_sensor_types.h @@ -40,7 +40,7 @@ struct Material; /* ****************** SENSORS ********************* */ typedef struct bNearSensor { - char name[32]; + char name[64]; /* MAX_NAME */ float dist, resetdist; int lastval, pad; } bNearSensor; @@ -59,7 +59,7 @@ typedef struct bMouseSensor { } bMouseSensor; typedef struct bTouchSensor { - char name[32]; + char name[64]; /* MAX_NAME */ struct Material *ma; float dist, pad; } bTouchSensor; @@ -70,25 +70,25 @@ typedef struct bKeyboardSensor { /** * Name of the target property */ - char targetName[32]; + char targetName[64]; /* MAX_NAME */ /** * Name of the toggle property */ - char toggleName[32]; + char toggleName[64]; /* MAX_NAME */ } bKeyboardSensor; typedef struct bPropertySensor { int type; int pad; - char name[32]; - char value[32]; - char maxvalue[32]; + char name[64]; /* MAX_NAME */ + char value[64]; + char maxvalue[64]; } bPropertySensor; typedef struct bActuatorSensor { int type; int pad; - char name[32]; + char name[64]; /* MAX_NAME */ } bActuatorSensor; typedef struct bDelaySensor { @@ -99,8 +99,8 @@ typedef struct bDelaySensor { } bDelaySensor; typedef struct bCollisionSensor { - char name[32]; /* property name */ - char materialName[32]; /* material */ + char name[64]; /* property name. MAX_NAME */ + char materialName[64]; /* material */ // struct Material *ma; // XXX remove materialName short damptimer, damp; short mode; /* flag to choose material or property */ @@ -108,23 +108,23 @@ typedef struct bCollisionSensor { } bCollisionSensor; typedef struct bRadarSensor { - char name[32]; + char name[64]; /* MAX_NAME */ float angle; float range; short flag, axis; } bRadarSensor; typedef struct bRandomSensor { - char name[32]; + char name[64]; /* MAX_NAME */ int seed; int delay; } bRandomSensor; typedef struct bRaySensor { - char name[32]; + char name[64]; /* MAX_NAME */ float range; - char propname[32]; - char matname[32]; + char propname[64]; + char matname[64]; //struct Material *ma; // XXX remove materialName short mode; short pad1; @@ -132,8 +132,8 @@ typedef struct bRaySensor { } bRaySensor; typedef struct bArmatureSensor { - char posechannel[32]; - char constraint[32]; + char posechannel[64]; /* MAX_NAME */ + char constraint[64]; /* MAX_NAME */ int type; float value; } bArmatureSensor; @@ -147,12 +147,12 @@ typedef struct bMessageSensor { /** * Can be used to filter on subjects like this */ - char subject[32]; + char subject[64]; /** * (Possible future use) body to filter on */ - char body[32]; + char body[64]; } bMessageSensor; typedef struct bSensor { @@ -160,7 +160,7 @@ typedef struct bSensor { /* pulse and freq are the bool toggle and frame count for pulse mode */ short type, otype, flag, pulse; short freq, totlinks, pad1, pad2; - char name[32]; + char name[64]; /* MAX_NAME */ void *data; struct bController **links; @@ -175,7 +175,7 @@ typedef struct bSensor { } bSensor; typedef struct bJoystickSensor { - char name[32]; + char name[64]; /* MAX_NAME */ char type; char joyindex; short flag; diff --git a/source/blender/makesdna/DNA_sequence_types.h b/source/blender/makesdna/DNA_sequence_types.h index aab20dbeee1..fa501de8d6d 100644 --- a/source/blender/makesdna/DNA_sequence_types.h +++ b/source/blender/makesdna/DNA_sequence_types.h @@ -127,7 +127,7 @@ typedef struct Sequence { struct Sequence *next, *prev; void *tmp; /* tmp var for copying, and tagging for linked selection */ void *lib; /* needed (to be like ipo), else it will raise libdata warnings, this should never be used */ - char name[24]; /* SEQ_NAME_MAXSTR - name, set by default and needs to be unique, for RNA paths */ + char name[64]; /* SEQ_NAME_MAXSTR - name, set by default and needs to be unique, for RNA paths */ int flag, type; /*flags bitmap (see below) and the type of sequence*/ int len; /* the length of the contense of this strip - before handles are applied */ @@ -255,7 +255,7 @@ typedef struct SpeedControlVars { #define SEQ_SPEED_COMPRESS_IPO_Y 4 /* ***************** SEQUENCE ****************** */ -#define SEQ_NAME_MAXSTR 24 +#define SEQ_NAME_MAXSTR 64 /* seq->flag */ #define SEQ_LEFTSEL (1<<1) diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index d502e56bf10..aa7a84c577b 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -133,8 +133,6 @@ typedef struct SpaceButs { float blockscale DNA_DEPRECATED; short blockhandler[8] DNA_DEPRECATED; - - struct RenderInfo *ri; View2D v2d DNA_DEPRECATED; /* deprecated, copied to region */ @@ -518,6 +516,9 @@ typedef struct SpaceClip { int pad; float stabmat[4][4], unistabmat[4][4]; /* current stabilization matrix and the same matrix in unified space, defined when drawing and used for mouse position calculation */ + + /* movie postprocessing */ + int postproc_flag, pad2; } SpaceClip; /* view3d Now in DNA_view3d_types.h */ diff --git a/source/blender/makesdna/DNA_texture_types.h b/source/blender/makesdna/DNA_texture_types.h index 82ffa82cf60..e711124d39c 100644 --- a/source/blender/makesdna/DNA_texture_types.h +++ b/source/blender/makesdna/DNA_texture_types.h @@ -60,7 +60,7 @@ typedef struct MTex { short texco, mapto, maptoneg, blendtype; struct Object *object; struct Tex *tex; - char uvname[32]; + char uvname[64]; /* MAX_CUSTOMDATA_LAYER_NAME */ char projx, projy, projz, mapping; float ofs[3], size[3], rot; diff --git a/source/blender/makesdna/DNA_tracking_types.h b/source/blender/makesdna/DNA_tracking_types.h index 131c540ac47..a8b3a7183cf 100644 --- a/source/blender/makesdna/DNA_tracking_types.h +++ b/source/blender/makesdna/DNA_tracking_types.h @@ -75,7 +75,7 @@ typedef struct MovieTrackingMarker { typedef struct MovieTrackingTrack { struct MovieTrackingTrack *next, *prev; - char name[24]; + char name[64]; /* MAX_NAME */ /* ** setings ** */ float pat_min[2], pat_max[2]; /* positions of left-bottom and right-top corners of pattern (in unified 0..1 space) */ @@ -178,7 +178,7 @@ typedef struct MovieTrackingReconstruction { typedef struct MovieTrackingObject { struct MovieTrackingObject *next, *prev; - char name[24]; /* Name of tracking object */ + char name[64]; /* Name of tracking object, MAX_NAME */ int flag; float scale; /* scale of object solution in amera space */ diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index 4dce922b56d..5be3799a419 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -414,6 +414,9 @@ typedef struct UserDef { short pad3; char author[80]; /* author name for file formats supporting it */ + + int compute_device_type; + int compute_device_id; } UserDef; extern UserDef U; /* from blenkernel blender.c */ @@ -628,6 +631,10 @@ extern UserDef U; /* from blenkernel blender.c */ #define NDOF_PANY_INVERT_AXIS (1 << 13) #define NDOF_PANZ_INVERT_AXIS (1 << 14) +/* compute_device_type */ +#define USER_COMPUTE_DEVICE_NONE 0 +#define USER_COMPUTE_DEVICE_OPENCL 1 +#define USER_COMPUTE_DEVICE_CUDA 2 #ifdef __cplusplus } diff --git a/source/blender/makesdna/DNA_view3d_types.h b/source/blender/makesdna/DNA_view3d_types.h index ae026b0bcc9..58c3f091d6d 100644 --- a/source/blender/makesdna/DNA_view3d_types.h +++ b/source/blender/makesdna/DNA_view3d_types.h @@ -173,7 +173,7 @@ typedef struct View3D { struct View3D *localvd; /* allocated backup of its self while in localview */ - char ob_centre_bone[32]; /* optional string for armature bone to define center */ + char ob_centre_bone[64]; /* optional string for armature bone to define center, MAXBONENAME */ unsigned int lay; int layact; diff --git a/source/blender/makesdna/DNA_windowmanager_types.h b/source/blender/makesdna/DNA_windowmanager_types.h index 57989424d4a..156d2ebbb20 100644 --- a/source/blender/makesdna/DNA_windowmanager_types.h +++ b/source/blender/makesdna/DNA_windowmanager_types.h @@ -168,7 +168,7 @@ typedef struct wmWindow { struct bScreen *screen; /* active screen */ struct bScreen *newscreen; /* temporary when switching */ - char screenname[32]; /* MAX_ID_NAME for matching window with active screen after file read */ + char screenname[64]; /* MAX_ID_NAME for matching window with active screen after file read */ short posx, posy, sizex, sizey; /* window coords */ short windowstate; /* borderless, full */ diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index a6e3d16a5f5..3996e109b2c 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -136,6 +136,7 @@ extern StructRNA RNA_CompositorNodeGamma; extern StructRNA RNA_CompositorNodeGlare; extern StructRNA RNA_CompositorNodeHueSat; extern StructRNA RNA_CompositorNodeIDMask; +extern StructRNA RNA_CompositorNodeDoubleEdgeMask; extern StructRNA RNA_CompositorNodeImage; extern StructRNA RNA_CompositorNodeInvert; extern StructRNA RNA_CompositorNodeLensdist; @@ -214,6 +215,7 @@ extern StructRNA RNA_ExplodeModifier; extern StructRNA RNA_ExpressionController; extern StructRNA RNA_FCurve; extern StructRNA RNA_FCurveSample; +extern StructRNA RNA_FFmpegSettings; extern StructRNA RNA_FModifier; extern StructRNA RNA_FModifierCycles; extern StructRNA RNA_FModifierEnvelope; @@ -428,6 +430,7 @@ extern StructRNA RNA_PropertyGroupItem; extern StructRNA RNA_PropertySensor; extern StructRNA RNA_PythonConstraint; extern StructRNA RNA_PythonController; +extern StructRNA RNA_QuickTimeSettings; extern StructRNA RNA_RadarSensor; extern StructRNA RNA_RandomSensor; extern StructRNA RNA_RaySensor; @@ -578,6 +581,8 @@ extern StructRNA RNA_ThemeNodeEditor; extern StructRNA RNA_ThemeOutliner; extern StructRNA RNA_ThemeProperties; extern StructRNA RNA_ThemeSequenceEditor; +extern StructRNA RNA_ThemeSpaceGeneric; +extern StructRNA RNA_ThemeSpaceListGeneric; extern StructRNA RNA_ThemeStyle; extern StructRNA RNA_ThemeTextEditor; extern StructRNA RNA_ThemeTimeline; @@ -967,7 +972,8 @@ void RNA_collection_clear(PointerRNA *ptr, const char *name); } /* check if the idproperty exists, for operators */ -int RNA_property_is_set(PointerRNA *ptr, const char *name); +int RNA_property_is_set(PointerRNA *ptr, PropertyRNA *prop); +int RNA_struct_property_is_set(PointerRNA *ptr, const char *identifier); int RNA_property_is_idprop(PropertyRNA *prop); /* python compatible string representation of this property, (must be freed!) */ @@ -1029,7 +1035,7 @@ StructRNA *ID_code_to_RNA_type(short idcode); /* macro which inserts the function name */ -#ifdef __GNUC__ +#if defined __GNUC__ || defined __sun # define RNA_warning(format, args...) _RNA_warning("%s: " format "\n", __func__, ##args) #else # define RNA_warning(format, ...) _RNA_warning("%s: " format "\n", __FUNCTION__, __VA_ARGS__) diff --git a/source/blender/makesrna/SConscript b/source/blender/makesrna/SConscript index 72c2f9a1caf..2df5d29fcae 100644 --- a/source/blender/makesrna/SConscript +++ b/source/blender/makesrna/SConscript @@ -8,7 +8,7 @@ objs += o incs = '#/intern/guardedalloc #/intern/memutil #/intern/audaspace/intern ../blenkernel ../blenlib ../makesdna intern .' incs += ' ../windowmanager ../editors/include ../gpu ../imbuf ../ikplugin ../blenfont ../blenloader' -incs += ' ../render/extern/include' +incs += ' ../render/extern/include #/intern/cycles/blender' incs += ' ../nodes' incs += ' #/extern/glew/include' incs += ' ../freestyle' @@ -37,9 +37,6 @@ if env['WITH_BF_FFMPEG']: defs.append('WITH_FFMPEG') incs += ' ' + env['BF_FFMPEG_INC'] -if env['WITH_BF_OGG']: - defs.append('WITH_OGG') - if env['WITH_BF_QUICKTIME']: defs.append('WITH_QUICKTIME') incs += ' ../quicktime' @@ -59,6 +56,9 @@ if env['WITH_BF_COLLADA']: if env['WITH_BF_OCEANSIM']: defs.append('WITH_OCEANSIM') +if env['WITH_BF_CYCLES']: + defs.append('WITH_CYCLES') + if env['OURPLATFORM'] == 'linux': cflags='-pthread' incs += ' ../../../extern/binreloc/include' diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt index 24db4e80c2b..4aa90bf93ea 100644 --- a/source/blender/makesrna/intern/CMakeLists.txt +++ b/source/blender/makesrna/intern/CMakeLists.txt @@ -144,6 +144,9 @@ set(INC_SYS ) +if(WITH_CYCLES) + add_definitions(-DWITH_CYCLES) +endif() if(WITH_PYTHON) add_definitions(-DWITH_PYTHON) @@ -248,6 +251,7 @@ blender_include_dirs( ../../render/extern/include ../../freestyle ../../../../intern/audaspace/intern + ../../../../intern/cycles/blender ../../../../intern/guardedalloc ../../../../intern/memutil ) diff --git a/source/blender/makesrna/intern/SConscript b/source/blender/makesrna/intern/SConscript index d710dd06a17..b74972b204c 100644 --- a/source/blender/makesrna/intern/SConscript +++ b/source/blender/makesrna/intern/SConscript @@ -33,7 +33,7 @@ incs = '#/intern/guardedalloc ../../blenlib ../../blenkernel ../../blenloader' incs += ' ../../imbuf ../../makesdna ../../makesrna ../../ikplugin' incs += ' ../../windowmanager ../../editors/include ../../blenfont' incs += ' ../../render/extern/include' -incs += ' #/intern/audaspace/intern ' +incs += ' #/intern/audaspace/intern #/intern/cycles/blender' incs += ' #/extern/glew/include ' if env['WITH_BF_OPENEXR']: @@ -60,9 +60,6 @@ if env['WITH_BF_FFMPEG']: defs.append('WITH_FFMPEG') incs += ' ' + env['BF_FFMPEG_INC'] -if env['WITH_BF_OGG']: - defs.append('WITH_OGG') - if env['WITH_BF_QUICKTIME']: defs.append('WITH_QUICKTIME') incs += ' ../../quicktime' @@ -91,6 +88,9 @@ if env['WITH_BF_PYTHON']: if env['WITH_BF_COLLADA']: defs.append('WITH_COLLADA') +if env['WITH_BF_CYCLES']: + defs.append('WITH_CYCLES') + if env['OURPLATFORM'] == 'linux': cflags='-pthread' incs += ' ../../../extern/binreloc/include' diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index c50e233c43f..4eebfc52920 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -226,6 +226,12 @@ void RNA_pointer_recast(PointerRNA *ptr, PointerRNA *r_ptr) /* ID Properties */ +static void rna_idproperty_touch(IDProperty *idprop) +{ + /* so the property is seen as 'set' by rna */ + idprop->flag &= ~IDP_FLAG_GHOST; +} + /* return a UI local ID prop definition for this prop */ IDProperty *rna_idproperty_ui(PropertyRNA *prop) { @@ -1621,8 +1627,10 @@ void RNA_property_boolean_set(PointerRNA *ptr, PropertyRNA *prop, int value) /* just incase other values are passed */ if(value) value= 1; - if((idprop=rna_idproperty_check(&prop, ptr))) + if((idprop=rna_idproperty_check(&prop, ptr))) { IDP_Int(idprop)= value; + rna_idproperty_touch(idprop); + } else if(bprop->set) bprop->set(ptr, value); else if(prop->flag & PROP_EDITABLE) { @@ -1698,6 +1706,8 @@ void RNA_property_boolean_set_array(PointerRNA *ptr, PropertyRNA *prop, const in IDP_Int(idprop)= values[0]; else memcpy(IDP_Array(idprop), values, sizeof(int)*idprop->len); + + rna_idproperty_touch(idprop); } else if(prop->arraydimension == 0) RNA_property_boolean_set(ptr, prop, values[0]); @@ -1818,8 +1828,10 @@ void RNA_property_int_set(PointerRNA *ptr, PropertyRNA *prop, int value) /* useful to check on bad values but set function should clamp */ /* BLI_assert(RNA_property_int_clamp(ptr, prop, &value) == 0); */ - if((idprop=rna_idproperty_check(&prop, ptr))) + if((idprop=rna_idproperty_check(&prop, ptr))) { IDP_Int(idprop)= value; + rna_idproperty_touch(idprop); + } else if(iprop->set) iprop->set(ptr, value); else if(prop->flag & PROP_EDITABLE) { @@ -1931,7 +1943,9 @@ void RNA_property_int_set_array(PointerRNA *ptr, PropertyRNA *prop, const int *v if(prop->arraydimension == 0) IDP_Int(idprop)= values[0]; else - memcpy(IDP_Array(idprop), values, sizeof(int)*idprop->len);\ + memcpy(IDP_Array(idprop), values, sizeof(int)*idprop->len); + + rna_idproperty_touch(idprop); } else if(prop->arraydimension == 0) RNA_property_int_set(ptr, prop, values[0]); @@ -2054,6 +2068,8 @@ void RNA_property_float_set(PointerRNA *ptr, PropertyRNA *prop, float value) IDP_Float(idprop)= value; else IDP_Double(idprop)= value; + + rna_idproperty_touch(idprop); } else if(fprop->set) { fprop->set(ptr, value); @@ -2185,6 +2201,8 @@ void RNA_property_float_set_array(PointerRNA *ptr, PropertyRNA *prop, const floa for(i=0; i<idprop->len; i++) ((double*)IDP_Array(idprop))[i]= values[i]; } + + rna_idproperty_touch(idprop); } else if(prop->arraydimension == 0) RNA_property_float_set(ptr, prop, values[0]); @@ -2372,9 +2390,11 @@ void RNA_property_string_set(PointerRNA *ptr, PropertyRNA *prop, const char *val BLI_assert(RNA_property_type(prop) == PROP_STRING); - if((idprop=rna_idproperty_check(&prop, ptr))) + if((idprop=rna_idproperty_check(&prop, ptr))) { /* both IDP_STRING_SUB_BYTE / IDP_STRING_SUB_UTF8 */ IDP_AssignString(idprop, value, RNA_property_string_maxlength(prop) - 1); + rna_idproperty_touch(idprop); + } else if(sprop->set) sprop->set(ptr, value); /* set function needs to clamp its self */ else if(prop->flag & PROP_EDITABLE) { @@ -2446,8 +2466,10 @@ void RNA_property_enum_set(PointerRNA *ptr, PropertyRNA *prop, int value) BLI_assert(RNA_property_type(prop) == PROP_ENUM); - if((idprop=rna_idproperty_check(&prop, ptr))) + if((idprop=rna_idproperty_check(&prop, ptr))) { IDP_Int(idprop)= value; + rna_idproperty_touch(idprop); + } else if(eprop->set) { eprop->set(ptr, value); } @@ -2516,6 +2538,7 @@ void RNA_property_pointer_set(PointerRNA *ptr, PropertyRNA *prop, PointerRNA ptr if((/*idprop=*/ rna_idproperty_check(&prop, ptr))) { /* not supported */ + /* rna_idproperty_touch(idprop); */ } else { PointerPropertyRNA *pprop= (PointerPropertyRNA*)prop; @@ -4412,15 +4435,23 @@ int RNA_collection_length(PointerRNA *ptr, const char *name) } } -int RNA_property_is_set(PointerRNA *ptr, const char *name) +int RNA_property_is_set(PointerRNA *ptr, PropertyRNA *prop) { - PropertyRNA *prop= RNA_struct_find_property(ptr, name); + if(prop->flag & PROP_IDPROPERTY) { + IDProperty *idprop = rna_idproperty_find(ptr, prop->identifier); + return ((idprop != NULL) && !(idprop->flag & IDP_FLAG_GHOST)); + } + else { + return 1; + } +} + +int RNA_struct_property_is_set(PointerRNA *ptr, const char *identifier) +{ + PropertyRNA *prop= RNA_struct_find_property(ptr, identifier); if(prop) { - if(prop->flag & PROP_IDPROPERTY) - return (rna_idproperty_find(ptr, name) != NULL); - else - return 1; + return RNA_property_is_set(ptr, prop); } else { /* python raises an error */ diff --git a/source/blender/makesrna/intern/rna_actuator.c b/source/blender/makesrna/intern/rna_actuator.c index 612c34d1c92..6098e885df5 100644 --- a/source/blender/makesrna/intern/rna_actuator.c +++ b/source/blender/makesrna/intern/rna_actuator.c @@ -867,8 +867,10 @@ static void rna_def_camera_actuator(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem prop_axis_items[] ={ - {ACT_CAMERA_X, "X", 0, "X", "Camera tries to get behind the X axis"}, - {ACT_CAMERA_Y, "Y", 0, "Y", "Camera tries to get behind the Y axis"}, + {OB_POSX, "POS_X", 0, "+X", "Camera tries to get behind the X axis"}, + {OB_POSY, "POS_Y", 0, "+Y", "Camera tries to get behind the Y axis"}, + {OB_NEGX, "NEG_X", 0, "-X", "Camera tries to get behind the -X axis"}, + {OB_NEGY, "NEG_Y", 0, "-Y", "Camera tries to get behind the -Y axis"}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "CameraActuator", "Actuator"); @@ -905,7 +907,7 @@ static void rna_def_camera_actuator(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Damping", "Strength of the constraint that drives the camera behind the target"); RNA_def_property_update(prop, NC_LOGIC, NULL); - /* x/y */ + /* +x/+y/-x/-y */ prop= RNA_def_property(srna, "axis", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "axis"); RNA_def_property_enum_items(prop, prop_axis_items); diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c index 4fb672fd203..c1f87240e77 100644 --- a/source/blender/makesrna/intern/rna_brush.c +++ b/source/blender/makesrna/intern/rna_brush.c @@ -69,13 +69,13 @@ EnumPropertyItem brush_sculpt_tool_items[] = { EnumPropertyItem brush_vertex_tool_items[] = { - {0, "MIX", ICON_BRUSH_MIX, "Mix", "Use mix blending mode while painting"}, - {1, "ADD", ICON_BRUSH_ADD, "Add", "Use add blending mode while painting"}, - {2, "SUB", ICON_BRUSH_SUBTRACT, "Subtract", "Use subtract blending mode while painting"}, - {3, "MUL", ICON_BRUSH_MULTIPLY, "Multiply", "Use multiply blending mode while painting"}, - {4, "BLUR", ICON_BRUSH_BLUR, "Blur", "Blur the color with surrounding values"}, - {5, "LIGHTEN", ICON_BRUSH_LIGHTEN, "Lighten", "Use lighten blending mode while painting"}, - {6, "DARKEN", ICON_BRUSH_DARKEN, "Darken", "Use darken blending mode while painting"}, + {PAINT_BLEND_MIX, "MIX", ICON_BRUSH_MIX, "Mix", "Use mix blending mode while painting"}, + {PAINT_BLEND_ADD, "ADD", ICON_BRUSH_ADD, "Add", "Use add blending mode while painting"}, + {PAINT_BLEND_SUB, "SUB", ICON_BRUSH_SUBTRACT, "Subtract", "Use subtract blending mode while painting"}, + {PAINT_BLEND_MUL, "MUL", ICON_BRUSH_MULTIPLY, "Multiply", "Use multiply blending mode while painting"}, + {PAINT_BLEND_BLUR, "BLUR", ICON_BRUSH_BLUR, "Blur", "Blur the color with surrounding values"}, + {PAINT_BLEND_LIGHTEN, "LIGHTEN", ICON_BRUSH_LIGHTEN, "Lighten", "Use lighten blending mode while painting"}, + {PAINT_BLEND_DARKEN, "DARKEN", ICON_BRUSH_DARKEN, "Darken", "Use darken blending mode while painting"}, {0, NULL, 0, NULL, NULL}}; EnumPropertyItem brush_image_tool_items[] = { @@ -164,96 +164,21 @@ static void rna_Brush_icon_update(Main *UNUSED(bmain), Scene *UNUSED(scene), Poi static void rna_Brush_set_size(PointerRNA *ptr, int value) { - Brush* me = (Brush*)(ptr->data); + Brush* brush = ptr->data; - float size= (float)brush_size(me); - float unprojected_radius; - - // paranoia: previous checks should make sure we don't divide by zero - assert(size != 0); - - // set unprojected radius, so it remains consistent with size - unprojected_radius= (float)(brush_unprojected_radius(me) * value / size); - brush_set_unprojected_radius(me, unprojected_radius); - - brush_set_size(me, value); -} - -static int rna_Brush_get_size(PointerRNA *ptr) -{ - Brush* me = (Brush*)(ptr->data); - return brush_size(me); -} - -static void rna_Brush_set_use_locked_size(PointerRNA *ptr, int value) -{ - Brush* me = (Brush*)(ptr->data); - brush_set_use_locked_size(me, value); -} - -static int rna_Brush_get_use_locked_size(PointerRNA *ptr) -{ - Brush* me = (Brush*)(ptr->data); - return brush_use_locked_size(me); -} - -static void rna_Brush_set_use_size_pressure(PointerRNA *ptr, int value) -{ - Brush* me = (Brush*)(ptr->data); - brush_set_use_size_pressure(me, value); -} - -static int rna_Brush_get_use_size_pressure(PointerRNA *ptr) -{ - Brush* me = (Brush*)(ptr->data); - return brush_use_size_pressure(me); -} - -static void rna_Brush_set_use_alpha_pressure(PointerRNA *ptr, int value) -{ - Brush* me = (Brush*)(ptr->data); - brush_set_use_alpha_pressure(me, value); -} - -static int rna_Brush_get_use_alpha_pressure(PointerRNA *ptr) -{ - Brush* me = (Brush*)(ptr->data); - return brush_use_alpha_pressure(me); + /* scale unprojected radius so it stays consistent with brush size */ + brush_scale_unprojected_radius(&brush->unprojected_radius, + value, brush->size); + brush->size= value; } static void rna_Brush_set_unprojected_radius(PointerRNA *ptr, float value) { - Brush* me = (Brush*)(ptr->data); - - float unprojected_radius= brush_unprojected_radius(me); - int size; - - // paranoia: previous checks should make sure we don't divide by zero - assert(unprojected_radius != 0.0f); - - // set size, so that it is consistent with unprojected_radius - size= (int)((float)brush_size(me) * value / unprojected_radius); - brush_set_size(me, size); - - brush_set_unprojected_radius(me, value); -} - -static float rna_Brush_get_unprojected_radius(PointerRNA *ptr) -{ - Brush* me = (Brush*)(ptr->data); - return brush_unprojected_radius(me); -} + Brush* brush = ptr->data; -static void rna_Brush_set_alpha(PointerRNA *ptr, float value) -{ - Brush* me = (Brush*)(ptr->data); - brush_set_alpha(me, value); -} - -static float rna_Brush_get_alpha(PointerRNA *ptr) -{ - Brush* me = (Brush*)(ptr->data); - return brush_alpha(me); + /* scale brush size so it stays consistent with unprojected_radius */ + brush_scale_size(&brush->size, value, brush->unprojected_radius); + brush->unprojected_radius= value; } static EnumPropertyItem *rna_Brush_direction_itemf(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *UNUSED(free)) @@ -448,14 +373,14 @@ static void rna_def_brush(BlenderRNA *brna) /* number values */ prop= RNA_def_property(srna, "size", PROP_INT, PROP_DISTANCE); - RNA_def_property_int_funcs(prop, "rna_Brush_get_size", "rna_Brush_set_size", NULL); + RNA_def_property_int_funcs(prop, NULL, "rna_Brush_set_size", NULL); RNA_def_property_range(prop, 1, MAX_BRUSH_PIXEL_RADIUS*10); RNA_def_property_ui_range(prop, 1, MAX_BRUSH_PIXEL_RADIUS, 1, 0); RNA_def_property_ui_text(prop, "Radius", "Radius of the brush in pixels"); RNA_def_property_update(prop, 0, "rna_Brush_update"); prop= RNA_def_property(srna, "unprojected_radius", PROP_FLOAT, PROP_DISTANCE); - RNA_def_property_float_funcs(prop, "rna_Brush_get_unprojected_radius", "rna_Brush_set_unprojected_radius", NULL); + RNA_def_property_float_funcs(prop, NULL, "rna_Brush_set_unprojected_radius", NULL); RNA_def_property_range(prop, 0.001, FLT_MAX); RNA_def_property_ui_range(prop, 0.001, 1, 0, 0); RNA_def_property_ui_text(prop, "Unprojected Radius", "Radius of brush in Blender units"); @@ -499,7 +424,6 @@ static void rna_def_brush(BlenderRNA *brna) prop= RNA_def_property(srna, "strength", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "alpha"); - RNA_def_property_float_funcs(prop, "rna_Brush_get_alpha", "rna_Brush_set_alpha", NULL); RNA_def_property_float_default(prop, 0.5f); RNA_def_property_range(prop, 0.0f, 10.0f); RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 0.001); @@ -575,7 +499,6 @@ static void rna_def_brush(BlenderRNA *brna) prop= RNA_def_property(srna, "use_pressure_strength", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_ALPHA_PRESSURE); - RNA_def_property_boolean_funcs(prop, "rna_Brush_get_use_alpha_pressure", "rna_Brush_set_use_alpha_pressure"); RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0); RNA_def_property_ui_text(prop, "Strength Pressure", "Enable tablet pressure sensitivity for strength"); RNA_def_property_update(prop, 0, "rna_Brush_update"); @@ -588,7 +511,6 @@ static void rna_def_brush(BlenderRNA *brna) prop= RNA_def_property(srna, "use_pressure_size", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_SIZE_PRESSURE); - RNA_def_property_boolean_funcs(prop, "rna_Brush_get_use_size_pressure", "rna_Brush_set_use_size_pressure"); RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0); RNA_def_property_ui_text(prop, "Size Pressure", "Enable tablet pressure sensitivity for size"); RNA_def_property_update(prop, 0, "rna_Brush_update"); @@ -668,7 +590,6 @@ static void rna_def_brush(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_Brush_update"); prop= RNA_def_property(srna, "use_locked_size", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_funcs(prop, "rna_Brush_get_use_locked_size", "rna_Brush_set_use_locked_size"); RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_LOCK_SIZE); RNA_def_property_ui_text(prop, "Use Blender Units", "When locked brush stays same size relative to object; when unlocked brush size is given in pixels"); RNA_def_property_update(prop, 0, "rna_Brush_update"); diff --git a/source/blender/makesrna/intern/rna_image.c b/source/blender/makesrna/intern/rna_image.c index 9e7f4a349e7..7059c001283 100644 --- a/source/blender/makesrna/intern/rna_image.c +++ b/source/blender/makesrna/intern/rna_image.c @@ -107,6 +107,15 @@ static void rna_Image_fields_update(Main *UNUSED(bmain), Scene *UNUSED(scene), P BKE_image_release_ibuf(ima, lock); } +static void rna_Image_free_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) +{ + Image *ima= ptr->id.data; + BKE_image_signal(ima, NULL, IMA_SIGNAL_FREE); + WM_main_add_notifier(NC_IMAGE|NA_EDITED, &ima->id); + DAG_id_tag_update(&ima->id, 0); +} + + static void rna_Image_reload_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { Image *ima= ptr->id.data; @@ -476,12 +485,12 @@ static void rna_def_image(BlenderRNA *brna) prop= RNA_def_property(srna, "use_premultiply", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", IMA_DO_PREMUL); RNA_def_property_ui_text(prop, "Premultiply", "Convert RGB from key alpha to premultiplied alpha"); - RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_reload_update"); + RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_free_update"); prop= RNA_def_property(srna, "use_color_unpremultiply", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", IMA_CM_PREDIVIDE); RNA_def_property_ui_text(prop, "Color Unpremultiply", "For premultiplied alpha images, do color space conversion on colors without alpha, to avoid fringing for images with light backgrounds"); - RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_reload_update"); + RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_free_update"); prop= RNA_def_property(srna, "is_dirty", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_Image_dirty_get", NULL); diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index 3a7d453fa79..3f3ac6ce906 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -1969,7 +1969,7 @@ static void rna_def_modifier_explode(BlenderRNA *brna) prop= RNA_def_property(srna, "particle_uv", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "uvname"); - RNA_def_property_string_maxlength(prop, 32); + RNA_def_property_string_maxlength(prop, MAX_CUSTOMDATA_LAYER_NAME); RNA_def_property_ui_text(prop, "Particle UV", "UV map to change with particle age"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); } diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index c15758eed1f..a04ddec2098 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -369,6 +369,15 @@ static void rna_Node_update(Main *bmain, Scene *scene, PointerRNA *ptr) node_update(bmain, scene, ntree, node); } +static void rna_Node_image_update(Main *bmain, Scene *scene, PointerRNA *ptr) +{ + bNodeTree *ntree= (bNodeTree*)ptr->id.data; + bNode *node= (bNode*)ptr->data; + + node_update(bmain, scene, ntree, node); + WM_main_add_notifier(NC_IMAGE, NULL); +} + static void rna_Node_material_update(Main *bmain, Scene *scene, PointerRNA *ptr) { bNodeTree *ntree= (bNodeTree*)ptr->id.data; @@ -1268,7 +1277,7 @@ static void def_sh_tex_environment(StructRNA *srna) RNA_def_property_struct_type(prop, "Image"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Image", ""); - RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); + RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_image_update"); RNA_def_struct_sdna_from(srna, "NodeTexImage", "storage"); def_sh_tex(srna); @@ -1293,7 +1302,7 @@ static void def_sh_tex_image(StructRNA *srna) RNA_def_property_struct_type(prop, "Image"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Image", ""); - RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); + RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_image_update"); RNA_def_struct_sdna_from(srna, "NodeTexImage", "storage"); def_sh_tex(srna); @@ -1333,6 +1342,12 @@ static void def_sh_tex_noise(StructRNA *srna) def_sh_tex(srna); } +static void def_sh_tex_checker(StructRNA *srna) +{ + RNA_def_struct_sdna_from(srna, "NodeTexChecker", "storage"); + def_sh_tex(srna); +} + static void def_sh_tex_magic(StructRNA *srna) { PropertyRNA *prop; @@ -2119,6 +2134,35 @@ static void def_cmp_id_mask(StructRNA *srna) RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); } +static void def_cmp_double_edge_mask(StructRNA * srna) +{ + PropertyRNA *prop; + + static EnumPropertyItem BufEdgeMode_items[] = { + {0, "BLEED_OUT", 0, "Bleed Out", "Allow mask pixels to bleed along edges"}, + {1, "KEEP_IN", 0, "Keep In", "Restrict mask pixels from touching edges"}, + {0, NULL, 0, NULL, NULL} + }; + + static EnumPropertyItem InnerEdgeMode_items[] = { + {0, "ALL", 0, "All", "All pixels on inner mask edge are considered during mask calculation"}, + {1, "ADJACENT_ONLY", 0, "Adjacent Only", "Only inner mask pixels adjacent to outer mask pixels are considered during mask calculation"}, + {0, NULL, 0, NULL, NULL} + }; + + prop = RNA_def_property(srna, "inner_mode", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "custom2"); + RNA_def_property_enum_items(prop, InnerEdgeMode_items); + RNA_def_property_ui_text(prop, "Inner Edge Mode", ""); + RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); + + prop = RNA_def_property(srna, "edge_mode", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "custom1"); + RNA_def_property_enum_items(prop, BufEdgeMode_items); + RNA_def_property_ui_text(prop, "Buffer Edge Mode", ""); + RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); +} + static void def_cmp_map_uv(StructRNA *srna) { PropertyRNA *prop; @@ -3199,7 +3243,7 @@ static void rna_def_group_sockets_api(BlenderRNA *brna, PropertyRNA *cprop, int func= RNA_def_function(srna, "new", (in_out==SOCK_IN ? "rna_NodeTree_input_new" : "rna_NodeTree_output_new")); RNA_def_function_ui_description(func, "Add a socket to the group tree"); RNA_def_function_flag(func, FUNC_USE_REPORTS); - RNA_def_string(func, "name", "Socket", 32, "Name", "Name of the socket"); + RNA_def_string(func, "name", "Socket", MAX_NAME, "Name", "Name of the socket"); RNA_def_enum(func, "type", node_socket_type_items, SOCK_FLOAT, "Type", "Type of socket"); /* return value */ parm= RNA_def_pointer(func, "socket", "NodeSocket", "", "New socket"); @@ -3369,4 +3413,3 @@ void RNA_def_nodetree(BlenderRNA *brna) #undef NODE_DEFINE_SUBTYPES #endif - diff --git a/source/blender/makesrna/intern/rna_nodetree_types.h b/source/blender/makesrna/intern/rna_nodetree_types.h index 19082ea4689..5ab907c87dc 100644 --- a/source/blender/makesrna/intern/rna_nodetree_types.h +++ b/source/blender/makesrna/intern/rna_nodetree_types.h @@ -85,6 +85,7 @@ DefNode( ShaderNode, SH_NODE_TEX_MAGIC, def_sh_tex_magic, "TE DefNode( ShaderNode, SH_NODE_TEX_WAVE, def_sh_tex_wave, "TEX_WAVE", TexWave, "Wave Texture", "" ) DefNode( ShaderNode, SH_NODE_TEX_MUSGRAVE, def_sh_tex_musgrave, "TEX_MUSGRAVE", TexMusgrave, "Musgrave Texture", "" ) DefNode( ShaderNode, SH_NODE_TEX_VORONOI, def_sh_tex_voronoi, "TEX_VORONOI", TexVoronoi, "Voronoi Texture", "" ) +DefNode( ShaderNode, SH_NODE_TEX_CHECKER, def_sh_tex_checker, "TEX_CHECKER", TexChecker, "Checker Texture", "" ) DefNode( ShaderNode, SH_NODE_TEX_COORD, 0, "TEX_COORD", TexCoord, "Texture Coordinate","") DefNode( CompositorNode, CMP_NODE_VIEWER, 0, "VIEWER", Viewer, "Viewer", "" ) @@ -129,6 +130,7 @@ DefNode( CompositorNode, CMP_NODE_FLIP, def_cmp_flip, "FLIP" DefNode( CompositorNode, CMP_NODE_SPLITVIEWER, def_cmp_splitviewer, "SPLITVIEWER", SplitViewer, "Split Viewer", "" ) DefNode( CompositorNode, CMP_NODE_MAP_UV, def_cmp_map_uv, "MAP_UV", MapUV, "Map UV", "" ) DefNode( CompositorNode, CMP_NODE_ID_MASK, def_cmp_id_mask, "ID_MASK", IDMask, "ID Mask", "" ) +DefNode( CompositorNode, CMP_NODE_DOUBLEEDGEMASK, def_cmp_double_edge_mask,"DOUBLEEDGEMASK", DoubleEdgeMask, "Double Edge Mask", "" ) DefNode( CompositorNode, CMP_NODE_DEFOCUS, def_cmp_defocus, "DEFOCUS", Defocus, "Defocus", "" ) DefNode( CompositorNode, CMP_NODE_DISPLACE, 0, "DISPLACE", Displace, "Displace", "" ) DefNode( CompositorNode, CMP_NODE_COMBHSVA, 0, "COMBHSVA", CombHSVA, "Combine HSVA", "" ) diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index f9bb0b36a3f..3ec01e56ab3 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -2447,15 +2447,20 @@ static void rna_def_dupli_object(BlenderRNA *brna) prop= RNA_def_property(srna, "matrix_original", PROP_FLOAT, PROP_MATRIX); RNA_def_property_float_sdna(prop, NULL, "omat"); RNA_def_property_multi_array(prop, 2, rna_matrix_dimsize_4x4); - RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE|PROP_EDITABLE); RNA_def_property_ui_text(prop, "Object Matrix", "The original matrix of this object before it was duplicated"); prop= RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX); RNA_def_property_float_sdna(prop, NULL, "mat"); RNA_def_property_multi_array(prop, 2, rna_matrix_dimsize_4x4); - RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE|PROP_EDITABLE); RNA_def_property_ui_text(prop, "Object Duplicate Matrix", "Object duplicate transformation matrix"); + prop= RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "no_draw", 0); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE|PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Hide", "Don't show dupli object in viewport or render"); + /* TODO: DupliObject has more properties that can be wrapped */ } diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 0d7a7195b44..e8b6e9e05d3 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -24,7 +24,6 @@ * \ingroup RNA */ - #include <stdlib.h> #include "RNA_define.h" @@ -32,6 +31,7 @@ #include "rna_internal.h" +#include "DNA_brush_types.h" #include "DNA_group_types.h" #include "DNA_modifier_types.h" #include "DNA_particle_types.h" @@ -137,7 +137,7 @@ EnumPropertyItem snap_element_items[] = { #endif #ifdef WITH_OPENEXR -# define R_IMF_ENUM_EXR_MULTI {R_IMF_IMTYPE_MULTILAYER, "MULTILAYER", ICON_FILE_IMAGE, "MultiLayer", "Output image in multilayer OpenEXR format"}, +# define R_IMF_ENUM_EXR_MULTI {R_IMF_IMTYPE_MULTILAYER, "OPEN_EXR_MULTILAYER", ICON_FILE_IMAGE, "OpenEXR MultiLayer", "Output image in multilayer OpenEXR format"}, # define R_IMF_ENUM_EXR {R_IMF_IMTYPE_OPENEXR, "OPEN_EXR", ICON_FILE_IMAGE, "OpenEXR", "Output image in OpenEXR format"}, #else # define R_IMF_ENUM_EXR_MULTI @@ -245,6 +245,7 @@ EnumPropertyItem image_color_depth_items[] = { #include "BLI_threads.h" #include "BLI_editVert.h" +#include "BKE_brush.h" #include "BKE_context.h" #include "BKE_global.h" #include "BKE_image.h" @@ -871,6 +872,20 @@ static EnumPropertyItem *rna_RenderSettings_qtcodecsettings_audiocodecType_itemf #endif #endif +static void rna_FFmpegSettings_lossless_output_set(PointerRNA *ptr, int value) +{ + Scene *scene = (Scene *) ptr->id.data; + RenderData *rd = &scene->r; + + if (value) + rd->ffcodecdata.flags |= FFMPEG_LOSSLESS_OUTPUT; + else + rd->ffcodecdata.flags &= ~FFMPEG_LOSSLESS_OUTPUT; +#ifdef WITH_FFMPEG + ffmpeg_verify_lossless_format(rd, &rd->im_format); +#endif +} + static int rna_RenderSettings_active_layer_index_get(PointerRNA *ptr) { RenderData *rd= (RenderData*)ptr->data; @@ -1002,7 +1017,7 @@ static void rna_RenderSettings_color_management_update(Main *bmain, Scene *UNUSE WM_main_add_notifier(NC_NODE|NA_EDITED, node); if (node->type == CMP_NODE_IMAGE) - BKE_image_signal((Image *)node->id, NULL, IMA_SIGNAL_RELOAD); + BKE_image_signal((Image *)node->id, NULL, IMA_SIGNAL_FREE); } } } @@ -1277,7 +1292,24 @@ static KeyingSet *rna_Scene_keying_set_new(Scene *sce, ReportList *reports, cons } } +static void rna_UnifiedPaintSettings_size_set(PointerRNA *ptr, int value) +{ + UnifiedPaintSettings* ups = ptr->data; + + /* scale unprojected radius so it stays consistent with brush size */ + brush_scale_unprojected_radius(&ups->unprojected_radius, + value, ups->size); + ups->size= value; +} +static void rna_UnifiedPaintSettings_unprojected_radius_set(PointerRNA *ptr, float value) +{ + UnifiedPaintSettings* ups = ptr->data; + + /* scale brush size so it stays consistent with unprojected_radius */ + brush_scale_size(&ups->size, value, ups->unprojected_radius); + ups->unprojected_radius= value; +} /* note: without this, when Multi-Paint is activated/deactivated, the colors * will not change right away when multiple bones are selected, this function @@ -1660,20 +1692,68 @@ static void rna_def_tool_settings(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Stroke conversion method", "Method used to convert stroke to bones"); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); - /* Sculpt/Paint Unified Size and Strength */ + /* Unified Paint Settings */ + prop= RNA_def_property(srna, "unified_paint_settings", PROP_POINTER, PROP_NONE); + RNA_def_property_flag(prop, PROP_NEVER_NULL); + RNA_def_property_struct_type(prop, "UnifiedPaintSettings"); + RNA_def_property_ui_text(prop, "Unified Paint Settings", NULL); +} - prop= RNA_def_property(srna, "sculpt_paint_use_unified_size", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "sculpt_paint_settings", SCULPT_PAINT_USE_UNIFIED_SIZE); - RNA_def_property_ui_text(prop, "Sculpt/Paint Use Unified Radius", - "Instead of per brush radius, the radius is shared across brushes"); +static void rna_def_unified_paint_settings(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; - prop= RNA_def_property(srna, "sculpt_paint_use_unified_strength", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "sculpt_paint_settings", SCULPT_PAINT_USE_UNIFIED_ALPHA); - RNA_def_property_ui_text(prop, "Sculpt/Paint Use Unified Strength", - "Instead of per brush strength, the strength is shared across brushes"); + srna= RNA_def_struct(brna, "UnifiedPaintSettings", NULL); + RNA_def_struct_ui_text(srna, "Unified Paint Settings", "Overrides for some of the active brush's settings"); + + /* high-level flags to enable or disable unified paint settings */ + prop= RNA_def_property(srna, "use_unified_size", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", UNIFIED_PAINT_SIZE); + RNA_def_property_ui_text(prop, "Use Unified Radius", + "Instead of per-brush radius, the radius is shared across brushes"); + + prop= RNA_def_property(srna, "use_unified_strength", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", UNIFIED_PAINT_ALPHA); + RNA_def_property_ui_text(prop, "Use Unified Strength", + "Instead of per-brush strength, the strength is shared across brushes"); + + /* unified paint settings that override the equivalent settings + from the active brush */ + prop= RNA_def_property(srna, "size", PROP_INT, PROP_DISTANCE); + RNA_def_property_int_funcs(prop, NULL, "rna_UnifiedPaintSettings_size_set", NULL); + RNA_def_property_range(prop, 1, MAX_BRUSH_PIXEL_RADIUS*10); + RNA_def_property_ui_range(prop, 1, MAX_BRUSH_PIXEL_RADIUS, 1, 0); + RNA_def_property_ui_text(prop, "Radius", "Radius of the brush in pixels"); + + prop= RNA_def_property(srna, "unprojected_radius", PROP_FLOAT, PROP_DISTANCE); + RNA_def_property_float_funcs(prop, NULL, "rna_UnifiedPaintSettings_unprojected_radius_set", NULL); + RNA_def_property_range(prop, 0.001, FLT_MAX); + RNA_def_property_ui_range(prop, 0.001, 1, 0, 0); + RNA_def_property_ui_text(prop, "Unprojected Radius", "Radius of brush in Blender units"); + + prop= RNA_def_property(srna, "strength", PROP_FLOAT, PROP_FACTOR); + RNA_def_property_float_sdna(prop, NULL, "alpha"); + RNA_def_property_float_default(prop, 0.5f); + RNA_def_property_range(prop, 0.0f, 10.0f); + RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 0.001); + RNA_def_property_ui_text(prop, "Strength", "How powerful the effect of the brush is when applied"); + + prop= RNA_def_property(srna, "use_pressure_size", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", UNIFIED_PAINT_BRUSH_SIZE_PRESSURE); + RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0); + RNA_def_property_ui_text(prop, "Size Pressure", "Enable tablet pressure sensitivity for size"); + + prop= RNA_def_property(srna, "use_pressure_strength", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", UNIFIED_PAINT_BRUSH_ALPHA_PRESSURE); + RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0); + RNA_def_property_ui_text(prop, "Strength Pressure", "Enable tablet pressure sensitivity for strength"); + + prop= RNA_def_property(srna, "use_locked_size", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", UNIFIED_PAINT_BRUSH_LOCK_SIZE); + RNA_def_property_ui_text(prop, "Use Blender Units", "When locked brush stays same size relative to object; when unlocked brush size is given in pixels"); } - static void rna_def_unit_settings(BlenderRNA *brna) { StructRNA *srna; @@ -2463,6 +2543,14 @@ static void rna_def_scene_game_data(BlenderRNA *brna) StructRNA *srna; PropertyRNA *prop; + static EnumPropertyItem aasamples_items[] ={ + {0, "SAMPLES_0", 0, "Off", ""}, + {2, "SAMPLES_2", 0, "2x", ""}, + {4, "SAMPLES_4", 0, "4x", ""}, + {8, "SAMPLES_8", 0, "8x", ""}, + {16, "SAMPLES_16", 0, "16x", ""}, + {0, NULL, 0, NULL, NULL}}; + static EnumPropertyItem framing_types_items[] ={ {SCE_GAMEFRAMING_BARS, "LETTERBOX", 0, "Letterbox", "Show the entire viewport in the display window, using bar horizontally or vertically"}, @@ -2532,6 +2620,11 @@ static void rna_def_scene_game_data(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Resolution Y", "Number of vertical pixels in the screen"); RNA_def_property_update(prop, NC_SCENE, NULL); + prop= RNA_def_property(srna, "samples", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "aasamples"); + RNA_def_property_enum_items(prop, aasamples_items); + RNA_def_property_ui_text(prop, "AA Samples", "The number of AA Samples to use for MSAA"); + prop= RNA_def_property(srna, "depth", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "depth"); RNA_def_property_range(prop, 8, 32); @@ -2553,10 +2646,15 @@ static void rna_def_scene_game_data(BlenderRNA *brna) RNA_def_property_update(prop, NC_SCENE, NULL); prop= RNA_def_property(srna, "show_fullscreen", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "fullscreen", 1.0); + RNA_def_property_boolean_sdna(prop, NULL, "playerflag", GAME_PLAYER_FULLSCREEN); RNA_def_property_ui_text(prop, "Fullscreen", "Start player in a new fullscreen display"); RNA_def_property_update(prop, NC_SCENE, NULL); + prop= RNA_def_property(srna, "use_desktop", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "playerflag", GAME_PLAYER_DESKTOP_RESOLUTION); + RNA_def_property_ui_text(prop, "Desktop", "Uses the current desktop resultion in fullscreen mode"); + RNA_def_property_update(prop, NC_SCENE, NULL); + /* Framing */ prop= RNA_def_property(srna, "frame_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "framing.type"); @@ -3016,6 +3114,269 @@ static void rna_def_scene_image_format_data(BlenderRNA *brna) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); } +static void rna_def_scene_ffmpeg_settings(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + +#ifdef WITH_FFMPEG + static EnumPropertyItem ffmpeg_format_items[] = { + {FFMPEG_MPEG1, "MPEG1", 0, "MPEG-1", ""}, + {FFMPEG_MPEG2, "MPEG2", 0, "MPEG-2", ""}, + {FFMPEG_MPEG4, "MPEG4", 0, "MPEG-4", ""}, + {FFMPEG_AVI, "AVI", 0, "AVI", ""}, + {FFMPEG_MOV, "QUICKTIME", 0, "Quicktime", ""}, + {FFMPEG_DV, "DV", 0, "DV", ""}, + {FFMPEG_H264, "H264", 0, "H.264", ""}, + {FFMPEG_XVID, "XVID", 0, "Xvid", ""}, + {FFMPEG_OGG, "OGG", 0, "Ogg", ""}, + {FFMPEG_MKV, "MKV", 0, "Matroska", ""}, + {FFMPEG_FLV, "FLASH", 0, "Flash", ""}, + {FFMPEG_WAV, "WAV", 0, "Wav", ""}, + {FFMPEG_MP3, "MP3", 0, "Mp3", ""}, + {0, NULL, 0, NULL, NULL}}; + + static EnumPropertyItem ffmpeg_codec_items[] = { + {CODEC_ID_NONE, "NONE", 0, "None", ""}, + {CODEC_ID_MPEG1VIDEO, "MPEG1", 0, "MPEG-1", ""}, + {CODEC_ID_MPEG2VIDEO, "MPEG2", 0, "MPEG-2", ""}, + {CODEC_ID_MPEG4, "MPEG4", 0, "MPEG-4(divx)", ""}, + {CODEC_ID_HUFFYUV, "HUFFYUV", 0, "HuffYUV", ""}, + {CODEC_ID_DVVIDEO, "DV", 0, "DV", ""}, + {CODEC_ID_H264, "H264", 0, "H.264", ""}, + {CODEC_ID_THEORA, "THEORA", 0, "Theora", ""}, + {CODEC_ID_FLV1, "FLASH", 0, "Flash Video", ""}, + {CODEC_ID_FFV1, "FFV1", 0, "FFmpeg video codec #1", ""}, + {0, NULL, 0, NULL, NULL}}; + + static EnumPropertyItem ffmpeg_audio_codec_items[] = { + {CODEC_ID_NONE, "NONE", 0, "None", ""}, + {CODEC_ID_MP2, "MP2", 0, "MP2", ""}, + {CODEC_ID_MP3, "MP3", 0, "MP3", ""}, + {CODEC_ID_AC3, "AC3", 0, "AC3", ""}, + {CODEC_ID_AAC, "AAC", 0, "AAC", ""}, + {CODEC_ID_VORBIS, "VORBIS", 0, "Vorbis", ""}, + {CODEC_ID_FLAC, "FLAC", 0, "FLAC", ""}, + {CODEC_ID_PCM_S16LE, "PCM", 0, "PCM", ""}, + {0, NULL, 0, NULL, NULL}}; +#endif + + static EnumPropertyItem audio_channel_items[] = { + {1, "MONO", 0, "Mono", "Set audio channels to mono"}, + {2, "STEREO", 0, "Stereo", "Set audio channels to stereo"}, + {4, "SURROUND4", 0, "4 Channels", "Set audio channels to 4 channels"}, + {6, "SURROUND51", 0, "5.1 Surround", "Set audio channels to 5.1 surround sound"}, + {8, "SURROUND71", 0, "7.1 Surround", "Set audio channels to 7.1 surround sound"}, + {0, NULL, 0, NULL, NULL}}; + + srna = RNA_def_struct(brna, "FFmpegSettings", NULL); + RNA_def_struct_sdna(srna, "FFMpegCodecData"); + RNA_def_struct_ui_text(srna, "FFmpeg Settings", "FFmpeg related settings for the scene"); + +#ifdef WITH_FFMPEG + prop = RNA_def_property(srna, "format", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_bitflag_sdna(prop, NULL, "type"); + RNA_def_property_enum_items(prop, ffmpeg_format_items); + RNA_def_property_ui_text(prop, "Format", "Output file format"); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + + prop = RNA_def_property(srna, "codec", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_bitflag_sdna(prop, NULL, "codec"); + RNA_def_property_enum_items(prop, ffmpeg_codec_items); + RNA_def_property_ui_text(prop, "Codec", "FFmpeg codec to use"); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + + prop = RNA_def_property(srna, "video_bitrate", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "video_bitrate"); + RNA_def_property_range(prop, 1, 14000); + RNA_def_property_ui_text(prop, "Bitrate", "Video bitrate (kb/s)"); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + + prop = RNA_def_property(srna, "minrate", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "rc_min_rate"); + RNA_def_property_range(prop, 0, 9000); + RNA_def_property_ui_text(prop, "Min Rate", "Rate control: min rate (kb/s)"); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + + prop = RNA_def_property(srna, "maxrate", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "rc_max_rate"); + RNA_def_property_range(prop, 1, 14000); + RNA_def_property_ui_text(prop, "Max Rate", "Rate control: max rate (kb/s)"); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + + prop= RNA_def_property(srna, "muxrate", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "mux_rate"); + RNA_def_property_range(prop, 0, 100000000); + RNA_def_property_ui_text(prop, "Mux Rate", "Mux rate (bits/s(!))"); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + + prop = RNA_def_property(srna, "gopsize", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "gop_size"); + RNA_def_property_range(prop, 0, 100); + RNA_def_property_ui_text(prop, "GOP Size", "Distance between key frames"); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + + prop = RNA_def_property(srna, "buffersize", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "rc_buffer_size"); + RNA_def_property_range(prop, 0, 2000); + RNA_def_property_ui_text(prop, "Buffersize", "Rate control: buffer size (kb)"); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + + prop = RNA_def_property(srna, "packetsize", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "mux_packet_size"); + RNA_def_property_range(prop, 0, 16384); + RNA_def_property_ui_text(prop, "Mux Packet Size", "Mux packet size (byte)"); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + + prop= RNA_def_property(srna, "use_autosplit", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flags", FFMPEG_AUTOSPLIT_OUTPUT); + RNA_def_property_ui_text(prop, "Autosplit Output", "Autosplit output at 2GB boundary"); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + + prop = RNA_def_property(srna, "use_lossless_output", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flags", FFMPEG_LOSSLESS_OUTPUT); + RNA_def_property_boolean_funcs(prop, NULL, "rna_FFmpegSettings_lossless_output_set"); + RNA_def_property_ui_text(prop, "Lossless Output", "Use lossless output for video streams"); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + + /* FFMPEG Audio*/ + prop = RNA_def_property(srna, "audio_codec", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_bitflag_sdna(prop, NULL, "audio_codec"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_enum_items(prop, ffmpeg_audio_codec_items); + RNA_def_property_ui_text(prop, "Audio Codec", "FFmpeg audio codec to use"); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + + prop = RNA_def_property(srna, "audio_bitrate", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "audio_bitrate"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_range(prop, 32, 384); + RNA_def_property_ui_text(prop, "Bitrate", "Audio bitrate (kb/s)"); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + + prop= RNA_def_property(srna, "audio_volume", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "audio_volume"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_range(prop, 0.0f, 1.0f); + RNA_def_property_ui_text(prop, "Volume", "Audio volume"); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); +#endif + + // the following two "ffmpeg" settings are general audio settings + prop= RNA_def_property(srna, "audio_mixrate", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "audio_mixrate"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_range(prop, 8000, 192000); + RNA_def_property_ui_text(prop, "Samplerate", "Audio samplerate(samples/s)"); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + + prop= RNA_def_property(srna, "audio_channels", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "audio_channels"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_enum_items(prop, audio_channel_items); + RNA_def_property_ui_text(prop, "Audio Channels", "Audio channel count"); +} + +#ifdef WITH_QUICKTIME +static void rna_def_scene_quicktime_settings(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + static EnumPropertyItem quicktime_codec_type_items[] = { + {0, "codec", 0, "codec", ""}, + {0, NULL, 0, NULL, NULL}}; + +#ifdef USE_QTKIT + static EnumPropertyItem quicktime_audio_samplerate_items[] = { + {22050, "22050", 0, "22kHz", ""}, + {44100, "44100", 0, "44.1kHz", ""}, + {48000, "48000", 0, "48kHz", ""}, + {88200, "88200", 0, "88.2kHz", ""}, + {96000, "96000", 0, "96kHz", ""}, + {192000, "192000", 0, "192kHz", ""}, + {0, NULL, 0, NULL, NULL}}; + + static EnumPropertyItem quicktime_audio_bitdepth_items[] = { + {AUD_FORMAT_U8, "8BIT", 0, "8bit", ""}, + {AUD_FORMAT_S16, "16BIT", 0, "16bit", ""}, + {AUD_FORMAT_S24, "24BIT", 0, "24bit", ""}, + {AUD_FORMAT_S32, "32BIT", 0, "32bit", ""}, + {AUD_FORMAT_FLOAT32, "FLOAT32", 0, "float32", ""}, + {AUD_FORMAT_FLOAT64, "FLOAT64", 0, "float64", ""}, + {0, NULL, 0, NULL, NULL}}; + + static EnumPropertyItem quicktime_audio_bitrate_items[] = { + {64000, "64000", 0, "64kbps", ""}, + {112000, "112000", 0, "112kpbs", ""}, + {128000, "128000", 0, "128kbps", ""}, + {192000, "192000", 0, "192kbps", ""}, + {256000, "256000", 0, "256kbps", ""}, + {320000, "320000", 0, "320kbps", ""}, + {0, NULL, 0, NULL, NULL}}; +#endif + + /* QuickTime */ + srna = RNA_def_struct(brna, "QuickTimeSettings", NULL); + RNA_def_struct_sdna(srna, "QuicktimeCodecSettings"); + RNA_def_struct_ui_text(srna, "QuickTime Settings", "QuickTime related settings for the scene"); + + prop = RNA_def_property(srna, "codec_type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_bitflag_sdna(prop, NULL, "codecType"); + RNA_def_property_enum_items(prop, quicktime_codec_type_items); + RNA_def_property_enum_funcs(prop, "rna_RenderSettings_qtcodecsettings_codecType_get", + "rna_RenderSettings_qtcodecsettings_codecType_set", + "rna_RenderSettings_qtcodecsettings_codecType_itemf"); + RNA_def_property_ui_text(prop, "Codec", "QuickTime codec type"); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + + prop = RNA_def_property(srna, "codec_spatial_quality", PROP_INT, PROP_PERCENTAGE); + RNA_def_property_int_sdna(prop, NULL, "codecSpatialQuality"); + RNA_def_property_range(prop, 0, 100); + RNA_def_property_ui_text(prop, "Spatial quality", "Intra-frame spatial quality level"); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + +#ifdef USE_QTKIT + prop = RNA_def_property(srna, "audiocodec_type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_bitflag_sdna(prop, NULL, "audiocodecType"); + RNA_def_property_enum_items(prop, quicktime_codec_type_items); + RNA_def_property_enum_funcs(prop, "rna_RenderSettings_qtcodecsettings_audiocodecType_get", + "rna_RenderSettings_qtcodecsettings_audiocodecType_set", + "rna_RenderSettings_qtcodecsettings_audiocodecType_itemf"); + RNA_def_property_ui_text(prop, "Audio Codec", "QuickTime audio codec type"); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + + prop = RNA_def_property(srna, "audio_samplerate", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_bitflag_sdna(prop, NULL, "audioSampleRate"); + RNA_def_property_enum_items(prop, quicktime_audio_samplerate_items); + RNA_def_property_ui_text(prop, "Smp Rate", "Sample Rate"); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + + prop = RNA_def_property(srna, "audio_bitdepth", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_bitflag_sdna(prop, NULL, "audioBitDepth"); + RNA_def_property_enum_items(prop, quicktime_audio_bitdepth_items); + RNA_def_property_ui_text(prop, "Bit Depth", "Bit Depth"); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + + prop = RNA_def_property(srna, "audio_resampling_hq", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "audioCodecFlags", QTAUDIO_FLAG_RESAMPLE_NOHQ); + RNA_def_property_ui_text(prop, "HQ", "Use High Quality resampling algorithm"); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + + prop= RNA_def_property(srna, "audio_codec_isvbr", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "audioCodecFlags", QTAUDIO_FLAG_CODEC_ISCBR); + RNA_def_property_ui_text(prop, "VBR", "Use Variable Bit Rate compression (improves quality at same bitrate)"); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + + prop= RNA_def_property(srna, "audio_bitrate", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_bitflag_sdna(prop, NULL, "audioBitRate"); + RNA_def_property_enum_items(prop, quicktime_audio_bitrate_items); + RNA_def_property_ui_text(prop, "Bitrate", "Compressed audio bitrate"); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); +#endif +} +#endif + static void rna_def_scene_render_data(BlenderRNA *brna) { StructRNA *srna; @@ -3106,96 +3467,16 @@ static void rna_def_scene_render_data(BlenderRNA *brna) {0, "AUTO", 0, "Auto-detect", "Automatically determine the number of threads, based on CPUs"}, {R_FIXED_THREADS, "FIXED", 0, "Fixed", "Manually determine the number of threads"}, {0, NULL, 0, NULL, NULL}}; - -#ifdef WITH_QUICKTIME - static EnumPropertyItem quicktime_codec_type_items[] = { - {0, "codec", 0, "codec", ""}, - {0, NULL, 0, NULL, NULL}}; - -#ifdef USE_QTKIT - static EnumPropertyItem quicktime_audio_samplerate_items[] = { - {22050, "22050", 0, "22kHz", ""}, - {44100, "44100", 0, "44.1kHz", ""}, - {48000, "48000", 0, "48kHz", ""}, - {88200, "88200", 0, "88.2kHz", ""}, - {96000, "96000", 0, "96kHz", ""}, - {192000, "192000", 0, "192kHz", ""}, - {0, NULL, 0, NULL, NULL}}; - - static EnumPropertyItem quicktime_audio_bitdepth_items[] = { - {AUD_FORMAT_U8, "8BIT", 0, "8bit", ""}, - {AUD_FORMAT_S16, "16BIT", 0, "16bit", ""}, - {AUD_FORMAT_S24, "24BIT", 0, "24bit", ""}, - {AUD_FORMAT_S32, "32BIT", 0, "32bit", ""}, - {AUD_FORMAT_FLOAT32, "FLOAT32", 0, "float32", ""}, - {AUD_FORMAT_FLOAT64, "FLOAT64", 0, "float64", ""}, - {0, NULL, 0, NULL, NULL}}; - - static EnumPropertyItem quicktime_audio_bitrate_items[] = { - {64000, "64000", 0, "64kbps", ""}, - {112000, "112000", 0, "112kpbs", ""}, - {128000, "128000", 0, "128kbps", ""}, - {192000, "192000", 0, "192kbps", ""}, - {256000, "256000", 0, "256kbps", ""}, - {320000, "320000", 0, "320kbps", ""}, - {0, NULL, 0, NULL, NULL}}; -#endif -#endif - -#ifdef WITH_FFMPEG - static EnumPropertyItem ffmpeg_format_items[] = { - {FFMPEG_MPEG1, "MPEG1", 0, "MPEG-1", ""}, - {FFMPEG_MPEG2, "MPEG2", 0, "MPEG-2", ""}, - {FFMPEG_MPEG4, "MPEG4", 0, "MPEG-4", ""}, - {FFMPEG_AVI, "AVI", 0, "AVI", ""}, - {FFMPEG_MOV, "QUICKTIME", 0, "Quicktime", ""}, - {FFMPEG_DV, "DV", 0, "DV", ""}, - {FFMPEG_H264, "H264", 0, "H.264", ""}, - {FFMPEG_XVID, "XVID", 0, "Xvid", ""}, - {FFMPEG_OGG, "OGG", 0, "Ogg", ""}, - {FFMPEG_MKV, "MKV", 0, "Matroska", ""}, - {FFMPEG_FLV, "FLASH", 0, "Flash", ""}, - {FFMPEG_WAV, "WAV", 0, "Wav", ""}, - {FFMPEG_MP3, "MP3", 0, "Mp3", ""}, - {0, NULL, 0, NULL, NULL}}; - - static EnumPropertyItem ffmpeg_codec_items[] = { - {CODEC_ID_NONE, "NONE", 0, "None", ""}, - {CODEC_ID_MPEG1VIDEO, "MPEG1", 0, "MPEG-1", ""}, - {CODEC_ID_MPEG2VIDEO, "MPEG2", 0, "MPEG-2", ""}, - {CODEC_ID_MPEG4, "MPEG4", 0, "MPEG-4(divx)", ""}, - {CODEC_ID_HUFFYUV, "HUFFYUV", 0, "HuffYUV", ""}, - {CODEC_ID_DVVIDEO, "DV", 0, "DV", ""}, - {CODEC_ID_H264, "H264", 0, "H.264", ""}, - {CODEC_ID_THEORA, "THEORA", 0, "Theora", ""}, - {CODEC_ID_FLV1, "FLASH", 0, "Flash Video", ""}, - {CODEC_ID_FFV1, "FFV1", 0, "FFmpeg video codec #1", ""}, - {0, NULL, 0, NULL, NULL}}; - - static EnumPropertyItem ffmpeg_audio_codec_items[] = { - {CODEC_ID_NONE, "NONE", 0, "None", ""}, - {CODEC_ID_MP2, "MP2", 0, "MP2", ""}, - {CODEC_ID_MP3, "MP3", 0, "MP3", ""}, - {CODEC_ID_AC3, "AC3", 0, "AC3", ""}, - {CODEC_ID_AAC, "AAC", 0, "AAC", ""}, - {CODEC_ID_VORBIS, "VORBIS", 0, "Vorbis", ""}, - {CODEC_ID_FLAC, "FLAC", 0, "FLAC", ""}, - {CODEC_ID_PCM_S16LE, "PCM", 0, "PCM", ""}, - {0, NULL, 0, NULL, NULL}}; -#endif - - static EnumPropertyItem audio_channel_items[] = { - {1, "MONO", 0, "Mono", "Set audio channels to mono"}, - {2, "STEREO", 0, "Stereo", "Set audio channels to stereo"}, - {4, "SURROUND4", 0, "4 Channels", "Set audio channels to 4 channels"}, - {6, "SURROUND51", 0, "5.1 Surround", "Set audio channels to 5.1 surround sound"}, - {8, "SURROUND71", 0, "7.1 Surround", "Set audio channels to 7.1 surround sound"}, - {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem engine_items[] = { {0, "BLENDER_RENDER", 0, "Blender Render", "Use the Blender internal rendering engine for rendering"}, {0, NULL, 0, NULL, NULL}}; + rna_def_scene_ffmpeg_settings(brna); +#ifdef WITH_QUICKTIME + rna_def_scene_quicktime_settings(brna); +#endif + srna= RNA_def_struct(brna, "RenderSettings", NULL); RNA_def_struct_sdna(srna, "RenderData"); RNA_def_struct_nested(brna, srna, "Scene"); @@ -3253,161 +3534,18 @@ static void rna_def_scene_render_data(BlenderRNA *brna) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneCamera_update"); #ifdef WITH_QUICKTIME - /* QuickTime */ - - prop= RNA_def_property(srna, "quicktime_codec_type", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_bitflag_sdna(prop, NULL, "qtcodecsettings.codecType"); - RNA_def_property_enum_items(prop, quicktime_codec_type_items); - RNA_def_property_enum_funcs(prop, "rna_RenderSettings_qtcodecsettings_codecType_get", - "rna_RenderSettings_qtcodecsettings_codecType_set", - "rna_RenderSettings_qtcodecsettings_codecType_itemf"); - RNA_def_property_ui_text(prop, "Codec", "QuickTime codec type"); - RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); - - prop= RNA_def_property(srna, "quicktime_codec_spatial_quality", PROP_INT, PROP_PERCENTAGE); - RNA_def_property_int_sdna(prop, NULL, "qtcodecsettings.codecSpatialQuality"); - RNA_def_property_range(prop, 0, 100); - RNA_def_property_ui_text(prop, "Spatial quality", "Intra-frame spatial quality level"); - RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); - -#ifdef USE_QTKIT - prop= RNA_def_property(srna, "quicktime_audiocodec_type", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_bitflag_sdna(prop, NULL, "qtcodecsettings.audiocodecType"); - RNA_def_property_enum_items(prop, quicktime_codec_type_items); - RNA_def_property_enum_funcs(prop, "rna_RenderSettings_qtcodecsettings_audiocodecType_get", - "rna_RenderSettings_qtcodecsettings_audiocodecType_set", - "rna_RenderSettings_qtcodecsettings_audiocodecType_itemf"); - RNA_def_property_ui_text(prop, "Audio Codec", "QuickTime audio codec type"); - RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); - - prop= RNA_def_property(srna, "quicktime_audio_samplerate", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_bitflag_sdna(prop, NULL, "qtcodecsettings.audioSampleRate"); - RNA_def_property_enum_items(prop, quicktime_audio_samplerate_items); - RNA_def_property_ui_text(prop, "Smp Rate", "Sample Rate"); - RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); - - prop= RNA_def_property(srna, "quicktime_audio_bitdepth", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_bitflag_sdna(prop, NULL, "qtcodecsettings.audioBitDepth"); - RNA_def_property_enum_items(prop, quicktime_audio_bitdepth_items); - RNA_def_property_ui_text(prop, "Bit Depth", "Bit Depth"); - RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); - - prop= RNA_def_property(srna, "quicktime_audio_resampling_hq", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_negative_sdna(prop, NULL, "qtcodecsettings.audioCodecFlags", QTAUDIO_FLAG_RESAMPLE_NOHQ); - RNA_def_property_ui_text(prop, "HQ", "Use High Quality resampling algorithm"); - RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); - - prop= RNA_def_property(srna, "quicktime_audio_codec_isvbr", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_negative_sdna(prop, NULL, "qtcodecsettings.audioCodecFlags", QTAUDIO_FLAG_CODEC_ISCBR); - RNA_def_property_ui_text(prop, "VBR", "Use Variable Bit Rate compression (improves quality at same bitrate)"); - RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); - - prop= RNA_def_property(srna, "quicktime_audio_bitrate", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_bitflag_sdna(prop, NULL, "qtcodecsettings.audioBitRate"); - RNA_def_property_enum_items(prop, quicktime_audio_bitrate_items); - RNA_def_property_ui_text(prop, "Bitrate", "Compressed audio bitrate"); - RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); -#endif -#endif - -#ifdef WITH_FFMPEG - /* FFMPEG Video*/ - - prop= RNA_def_property(srna, "ffmpeg_format", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_bitflag_sdna(prop, NULL, "ffcodecdata.type"); - RNA_def_property_enum_items(prop, ffmpeg_format_items); - RNA_def_property_ui_text(prop, "Format", "Output file format"); - RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); - - prop= RNA_def_property(srna, "ffmpeg_codec", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_bitflag_sdna(prop, NULL, "ffcodecdata.codec"); - RNA_def_property_enum_items(prop, ffmpeg_codec_items); - RNA_def_property_ui_text(prop, "Codec", "FFMpeg codec to use"); - RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); - - prop= RNA_def_property(srna, "ffmpeg_video_bitrate", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.video_bitrate"); - RNA_def_property_range(prop, 1, 14000); - RNA_def_property_ui_text(prop, "Bitrate", "Video bitrate (kb/s)"); - RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); - - prop= RNA_def_property(srna, "ffmpeg_minrate", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.rc_min_rate"); - RNA_def_property_range(prop, 0, 9000); - RNA_def_property_ui_text(prop, "Min Rate", "Rate control: min rate (kb/s)"); - RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); - - prop= RNA_def_property(srna, "ffmpeg_maxrate", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.rc_max_rate"); - RNA_def_property_range(prop, 1, 14000); - RNA_def_property_ui_text(prop, "Max Rate", "Rate control: max rate (kb/s)"); - RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); - - prop= RNA_def_property(srna, "ffmpeg_muxrate", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.mux_rate"); - RNA_def_property_range(prop, 0, 100000000); - RNA_def_property_ui_text(prop, "Mux Rate", "Mux rate (bits/s(!))"); - RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); - - prop= RNA_def_property(srna, "ffmpeg_gopsize", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.gop_size"); - RNA_def_property_range(prop, 0, 100); - RNA_def_property_ui_text(prop, "GOP Size", "Distance between key frames"); - RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); - - prop= RNA_def_property(srna, "ffmpeg_buffersize", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.rc_buffer_size"); - RNA_def_property_range(prop, 0, 2000); - RNA_def_property_ui_text(prop, "Buffersize", "Rate control: buffer size (kb)"); - RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); - - prop= RNA_def_property(srna, "ffmpeg_packetsize", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.mux_packet_size"); - RNA_def_property_range(prop, 0, 16384); - RNA_def_property_ui_text(prop, "Mux Packet Size", "Mux packet size (byte)"); - RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); - - prop= RNA_def_property(srna, "ffmpeg_autosplit", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "ffcodecdata.flags", FFMPEG_AUTOSPLIT_OUTPUT); - RNA_def_property_ui_text(prop, "Autosplit Output", "Autosplit output at 2GB boundary"); - RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); - - /* FFMPEG Audio*/ - prop= RNA_def_property(srna, "ffmpeg_audio_codec", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_bitflag_sdna(prop, NULL, "ffcodecdata.audio_codec"); - RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); - RNA_def_property_enum_items(prop, ffmpeg_audio_codec_items); - RNA_def_property_ui_text(prop, "Audio Codec", "FFMpeg audio codec to use"); - RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); - - prop= RNA_def_property(srna, "ffmpeg_audio_bitrate", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.audio_bitrate"); - RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); - RNA_def_property_range(prop, 32, 384); - RNA_def_property_ui_text(prop, "Bitrate", "Audio bitrate (kb/s)"); - RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); - - prop= RNA_def_property(srna, "ffmpeg_audio_volume", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "ffcodecdata.audio_volume"); - RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); - RNA_def_property_range(prop, 0.0f, 1.0f); - RNA_def_property_ui_text(prop, "Volume", "Audio volume"); - RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + prop= RNA_def_property(srna, "quicktime", PROP_POINTER, PROP_NONE); + RNA_def_property_struct_type(prop, "QuickTimeSettings"); + RNA_def_property_pointer_sdna(prop, NULL, "qtcodecsettings"); + RNA_def_property_flag(prop, PROP_NEVER_UNLINK); + RNA_def_property_ui_text(prop, "QuickTime Settings", "QuickTime related settings for the scene"); #endif - // the following two "ffmpeg" settings are general audio settings - prop= RNA_def_property(srna, "ffmpeg_audio_mixrate", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.audio_mixrate"); - RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); - RNA_def_property_range(prop, 8000, 192000); - RNA_def_property_ui_text(prop, "Samplerate", "Audio samplerate(samples/s)"); - RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); - - prop= RNA_def_property(srna, "ffmpeg_audio_channels", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "ffcodecdata.audio_channels"); - RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); - RNA_def_property_enum_items(prop, audio_channel_items); - RNA_def_property_ui_text(prop, "Audio Channels", "Audio channel count"); + prop= RNA_def_property(srna, "ffmpeg", PROP_POINTER, PROP_NONE); + RNA_def_property_struct_type(prop, "FFmpegSettings"); + RNA_def_property_pointer_sdna(prop, NULL, "ffcodecdata"); + RNA_def_property_flag(prop, PROP_NEVER_UNLINK); + RNA_def_property_ui_text(prop, "FFmpeg Settings", "FFmpeg related settings for the scene"); prop= RNA_def_property(srna, "fps", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "frs_sec"); @@ -4473,6 +4611,7 @@ void RNA_def_scene(BlenderRNA *brna) /* Nestled Data */ rna_def_tool_settings(brna); + rna_def_unified_paint_settings(brna); rna_def_unit_settings(brna); rna_def_scene_image_format_data(brna); rna_def_scene_render_data(brna); diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c index a15ca5de5c1..cd929d3aeda 100644 --- a/source/blender/makesrna/intern/rna_sculpt_paint.c +++ b/source/blender/makesrna/intern/rna_sculpt_paint.c @@ -289,6 +289,7 @@ static void rna_def_sculpt(BlenderRNA *brna) RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Sculpt_update"); } +/* use for weight paint too */ static void rna_def_vertex_paint(BlenderRNA *brna) { StructRNA *srna; @@ -297,7 +298,8 @@ static void rna_def_vertex_paint(BlenderRNA *brna) srna= RNA_def_struct(brna, "VertexPaint", "Paint"); RNA_def_struct_sdna(srna, "VPaint"); RNA_def_struct_ui_text(srna, "Vertex Paint", "Properties of vertex and weight paint mode"); - + + /* vertex paint only */ prop= RNA_def_property(srna, "use_all_faces", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", VP_AREA); RNA_def_property_ui_text(prop, "All Faces", "Paint on all faces inside brush"); @@ -309,6 +311,11 @@ static void rna_def_vertex_paint(BlenderRNA *brna) prop= RNA_def_property(srna, "use_spray", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", VP_SPRAY); RNA_def_property_ui_text(prop, "Spray", "Keep applying paint effect while holding mouse"); + + /* weight paint only */ + prop= RNA_def_property(srna, "use_group_restrict", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", VP_ONLYVGROUP); + RNA_def_property_ui_text(prop, "Restrict", "Restrict painting to verts already apart of the vertex group"); } static void rna_def_image_paint(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index a7f45d867dd..d7f1c375a21 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -35,6 +35,7 @@ #include "rna_internal.h" #include "BKE_key.h" +#include "BKE_movieclip.h" #include "DNA_action_types.h" #include "DNA_key_types.h" @@ -2139,7 +2140,6 @@ static void rna_def_space_dopesheet(BlenderRNA *brna) /* 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); @@ -2224,7 +2224,6 @@ static void rna_def_space_graph(BlenderRNA *brna) /* 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); @@ -2322,7 +2321,6 @@ static void rna_def_space_nla(BlenderRNA *brna) /* display */ prop= RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE); 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); @@ -2987,6 +2985,32 @@ static void rna_def_space_clip(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_SHOW_GRAPH_TRACKS); RNA_def_property_ui_text(prop, "Show Tracks", "Display the speed curves (in \"x\" direction red, in \"y\" direction green) for the selected tracks"); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL); + + /* ** channels ** */ + + /* show_red_channel */ + prop= RNA_def_property(srna, "show_red_channel", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "postproc_flag", MOVIECLIP_DISABLE_RED); + RNA_def_property_ui_text(prop, "Show Red Channel", "Show red channel in the frame"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL); + + /* show_green_channel */ + prop= RNA_def_property(srna, "show_green_channel", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "postproc_flag", MOVIECLIP_DISABLE_GREEN); + RNA_def_property_ui_text(prop, "Show Green Channel", "Show green channel in the frame"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL); + + /* show_blue_channel */ + prop= RNA_def_property(srna, "show_blue_channel", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "postproc_flag", MOVIECLIP_DISABLE_BLUE); + RNA_def_property_ui_text(prop, "Show Blue Channel", "Show blue channel in the frame"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL); + + /* preview_grayscale */ + prop= RNA_def_property(srna, "use_grayscale_preview", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "postproc_flag", MOVIECLIP_PREVIEW_GRAYSCALE); + RNA_def_property_ui_text(prop, "Grayscale", "Display frame in grayscale mode"); + RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL); } diff --git a/source/blender/makesrna/intern/rna_tracking.c b/source/blender/makesrna/intern/rna_tracking.c index c29d655feb2..01f3889d684 100644 --- a/source/blender/makesrna/intern/rna_tracking.c +++ b/source/blender/makesrna/intern/rna_tracking.c @@ -31,6 +31,7 @@ #include "MEM_guardedalloc.h" +#include "BLI_math.h" #include "BKE_movieclip.h" #include "BKE_tracking.h" @@ -87,14 +88,14 @@ static void rna_tracking_defaultSettings_searchUpdate(Main *UNUSED(bmain), Scene settings->default_pattern_size= settings->default_search_size; } -static void rna_tracking_tracks_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) +static void rna_trackingTracks_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { MovieClip *clip= (MovieClip*)ptr->id.data; rna_iterator_listbase_begin(iter, &clip->tracking.tracks, NULL); } -static void rna_tracking_objects_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) +static void rna_trackingObjects_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { MovieClip *clip= (MovieClip*)ptr->id.data; @@ -351,6 +352,31 @@ static void rna_trackingObject_flushUpdate(Main *UNUSED(bmain), Scene *scene, Po DAG_id_tag_update(&clip->id, 0); } +static void rna_trackingMarker_frame_set(PointerRNA *ptr, int value) +{ + MovieClip *clip = (MovieClip *) ptr->id.data; + MovieTracking *tracking = &clip->tracking; + MovieTrackingTrack *track; + MovieTrackingMarker *marker = (MovieTrackingMarker *) ptr->data; + + track = tracking->tracks.first; + while (track) { + if (marker >= track->markers && marker < track->markers+track->markersnr) { + break; + } + + track = track->next; + } + + if (track) { + MovieTrackingMarker new_marker = *marker; + new_marker.framenr = value; + + BKE_tracking_delete_marker(track, marker->framenr); + BKE_tracking_insert_marker(track, &new_marker); + } +} + /* API */ static void add_tracks_to_base(MovieClip *clip, MovieTracking *tracking, ListBase *tracksbase, int frame, int number) @@ -366,13 +392,13 @@ static void add_tracks_to_base(MovieClip *clip, MovieTracking *tracking, ListBas BKE_tracking_add_track(tracking, tracksbase, 0, 0, frame, width, height); } -static void rna_tracking_tracks_add(ID *id, MovieTracking *tracking, int frame, int number) +static void rna_trackingTracks_add(ID *id, MovieTracking *tracking, int frame, int number) { MovieClip *clip= (MovieClip *) id; add_tracks_to_base(clip, tracking, &tracking->tracks, frame, number); - WM_main_add_notifier(NC_MOVIECLIP|NA_EDITED, NULL); + WM_main_add_notifier(NC_MOVIECLIP|NA_EDITED, clip); } static void rna_trackingObject_tracks_add(ID *id, MovieTrackingObject *object, int frame, int number) @@ -388,7 +414,7 @@ static void rna_trackingObject_tracks_add(ID *id, MovieTrackingObject *object, i WM_main_add_notifier(NC_MOVIECLIP|NA_EDITED, NULL); } -static MovieTrackingObject *rna_tracking_object_new(MovieTracking *tracking, const char *name) +static MovieTrackingObject *rna_trackingObject_new(MovieTracking *tracking, const char *name) { MovieTrackingObject *object= BKE_tracking_new_object(tracking, name); @@ -397,16 +423,41 @@ static MovieTrackingObject *rna_tracking_object_new(MovieTracking *tracking, con return object; } -void rna_tracking_object_remove(MovieTracking *tracking, MovieTrackingObject *object) +void rna_trackingObject_remove(MovieTracking *tracking, MovieTrackingObject *object) { BKE_tracking_remove_object(tracking, object); WM_main_add_notifier(NC_MOVIECLIP|NA_EDITED, NULL); } -static MovieTrackingMarker *rna_trackingTrack_marker_find_frame(MovieTrackingTrack *track, int framenr) +static MovieTrackingMarker *rna_trackingMarkers_find_frame(MovieTrackingTrack *track, int framenr) { - return BKE_tracking_get_marker(track, framenr); + return BKE_tracking_exact_marker(track, framenr); +} + +static MovieTrackingMarker* rna_trackingMarkers_insert_frame(MovieTrackingTrack *track, int framenr, float *co) +{ + MovieTrackingMarker marker, *new_marker; + + memset(&marker, 0, sizeof(marker)); + marker.framenr = framenr; + copy_v2_v2(marker.pos, co); + + new_marker = BKE_tracking_insert_marker(track, &marker); + + WM_main_add_notifier(NC_MOVIECLIP|NA_EDITED, NULL); + + return new_marker; +} + +void rna_trackingMarkers_delete_frame(MovieTrackingTrack *track, int framenr) +{ + if(track->markersnr==1) + return; + + BKE_tracking_delete_marker(track, framenr); + + WM_main_add_notifier(NC_MOVIECLIP|NA_EDITED, NULL); } #else @@ -692,10 +743,10 @@ static void rna_def_trackingMarker(BlenderRNA *brna) /* frame */ prop= RNA_def_property(srna, "frame", PROP_INT, PROP_NONE); - RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* can't be safty edited for now, need to re-sort markers array after change */ RNA_def_property_int_sdna(prop, NULL, "framenr"); RNA_def_property_ui_text(prop, "Frame", "Frame number marker is keyframed on"); - RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, NULL); + RNA_def_property_int_funcs(prop, NULL, "rna_trackingMarker_frame_set", NULL); + RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, 0); /* enable */ prop= RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE); @@ -704,14 +755,48 @@ static void rna_def_trackingMarker(BlenderRNA *brna) RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, NULL); } -static void rna_def_trackingTrack(BlenderRNA *brna) +static void rna_def_trackingMarkers(BlenderRNA *brna, PropertyRNA *cprop) { StructRNA *srna; - PropertyRNA *prop; - FunctionRNA *func; PropertyRNA *parm; + RNA_def_property_srna(cprop, "MovieTrackingMarkers"); + srna= RNA_def_struct(brna, "MovieTrackingMarkers", NULL); + RNA_def_struct_sdna(srna, "MovieTrackingTrack"); + RNA_def_struct_ui_text(srna, "Movie Tracking Markers", "Collection of markers for movie tracking track"); + + func= RNA_def_function(srna, "find_frame", "rna_trackingMarkers_find_frame"); + RNA_def_function_ui_description(func, "Get marker for specified frame"); + parm= RNA_def_int(func, "frame", 1, MINFRAME, MAXFRAME, "Frame", + "Frame number to find marker for", MINFRAME, MAXFRAME); + RNA_def_property_flag(parm, PROP_REQUIRED); + parm= RNA_def_pointer(func, "marker", "MovieTrackingMarker", "", "Marker for specified frame"); + RNA_def_function_return(func, parm); + + func= RNA_def_function(srna, "insert_frame", "rna_trackingMarkers_insert_frame"); + RNA_def_function_ui_description(func, "Add a number of tracks to this movie clip"); + parm= RNA_def_int(func, "frame", 1, MINFRAME, MAXFRAME, "Frame", + "Frame number to insert marker to", MINFRAME, MAXFRAME); + RNA_def_property_flag(parm, PROP_REQUIRED); + RNA_def_float_vector(func, "co", 2, 0, -1.0, 1.0, "Coordinate", + "Place new marker at the given frame using specified in normalized space coordinates", -1.0, 1.0); + RNA_def_property_flag(parm, PROP_REQUIRED); + parm= RNA_def_pointer(func, "marker", "MovieTrackingMarker", "", "Newly created marker"); + RNA_def_function_return(func, parm); + + func= RNA_def_function(srna, "delete_frame", "rna_trackingMarkers_delete_frame"); + RNA_def_function_ui_description(func, "Delete marker at specified frame"); + parm= RNA_def_int(func, "frame", 1, MINFRAME, MAXFRAME, "Frame", + "Frame number to delete marker from", MINFRAME, MAXFRAME); + RNA_def_property_flag(parm, PROP_REQUIRED); +} + +static void rna_def_trackingTrack(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + rna_def_trackingMarker(brna); srna= RNA_def_struct(brna, "MovieTrackingTrack", NULL); @@ -722,7 +807,7 @@ static void rna_def_trackingTrack(BlenderRNA *brna) prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_property_ui_text(prop, "Name", "Unique name of track"); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_trackingTrack_name_set"); - RNA_def_property_string_maxlength(prop, MAX_ID_NAME); + RNA_def_property_string_maxlength(prop, MAX_ID_NAME-2); RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, NULL); RNA_def_struct_name_property(srna, prop); @@ -805,6 +890,7 @@ static void rna_def_trackingTrack(BlenderRNA *brna) RNA_def_property_struct_type(prop, "MovieTrackingMarker"); RNA_def_property_collection_sdna(prop, NULL, "markers", "markersnr"); RNA_def_property_ui_text(prop, "Markers", "Collection of markers in track"); + rna_def_trackingMarkers(brna, prop); /* ** channels ** */ @@ -899,15 +985,6 @@ static void rna_def_trackingTrack(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "error"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Average Error", "Average error of re-projection"); - - /* ** api ** */ - - func= RNA_def_function(srna, "marker_find_frame", "rna_trackingTrack_marker_find_frame"); - RNA_def_function_ui_description(func, "Get marker for specified frame"); - parm= RNA_def_int(func, "frame", 1, MINFRAME, MAXFRAME, "Frame", "type for the new spline", MINFRAME, MAXFRAME); - RNA_def_property_flag(parm, PROP_REQUIRED); - parm= RNA_def_pointer(func, "marker", "MovieTrackingMarker", "", "Marker for specified frame"); - RNA_def_function_return(func, parm); } static void rna_def_trackingStabilization(BlenderRNA *brna) @@ -1052,7 +1129,7 @@ static void rna_def_trackingTracks(BlenderRNA *brna) RNA_def_struct_sdna(srna, "MovieTracking"); RNA_def_struct_ui_text(srna, "Movie Tracks", "Collection of movie tracking tracks"); - func= RNA_def_function(srna, "add", "rna_tracking_tracks_add"); + func= RNA_def_function(srna, "add", "rna_trackingTracks_add"); RNA_def_function_flag(func, FUNC_USE_SELF_ID); RNA_def_function_ui_description(func, "Add a number of tracks to this movie clip"); RNA_def_int(func, "frame", 1, MINFRAME, MAXFRAME, "Frame", "Frame number to add tracks on", MINFRAME, MAXFRAME); @@ -1102,7 +1179,7 @@ static void rna_def_trackingObject(BlenderRNA *brna) prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_property_ui_text(prop, "Name", "Unique name of object"); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_trackingObject_name_set"); - RNA_def_property_string_maxlength(prop, MAX_ID_NAME); + RNA_def_property_string_maxlength(prop, MAX_ID_NAME-2); RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, NULL); RNA_def_struct_name_property(srna, prop); @@ -1147,13 +1224,13 @@ static void rna_def_trackingObjects(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_struct_sdna(srna, "MovieTracking"); RNA_def_struct_ui_text(srna, "Movie Objects", "Collection of movie trackingobjects"); - func= RNA_def_function(srna, "new", "rna_tracking_object_new"); + func= RNA_def_function(srna, "new", "rna_trackingObject_new"); RNA_def_function_ui_description(func, "Add tracking object to this movie clip"); RNA_def_string(func, "name", "", 0, "", "Name of new object"); parm= RNA_def_pointer(func, "object", "MovieTrackingObject", "", "New motion tracking object"); RNA_def_function_return(func, parm); - func= RNA_def_function(srna, "remove", "rna_tracking_object_remove"); + func= RNA_def_function(srna, "remove", "rna_trackingObject_remove"); RNA_def_function_ui_description(func, "Remove tracking object from this movie clip"); parm= RNA_def_pointer(func, "object", "MovieTrackingObject", "", "Motion tracking object to be removed"); @@ -1192,7 +1269,7 @@ static void rna_def_tracking(BlenderRNA *brna) /* tracks */ prop= RNA_def_property(srna, "tracks", PROP_COLLECTION, PROP_NONE); - RNA_def_property_collection_funcs(prop, "rna_tracking_tracks_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0, 0); + RNA_def_property_collection_funcs(prop, "rna_trackingTracks_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0, 0); RNA_def_property_struct_type(prop, "MovieTrackingTrack"); RNA_def_property_ui_text(prop, "Tracks", "Collection of tracks in this tracking data object"); RNA_def_property_srna(prop, "MovieTrackingTracks"); @@ -1207,7 +1284,7 @@ static void rna_def_tracking(BlenderRNA *brna) /* objects */ prop= RNA_def_property(srna, "objects", PROP_COLLECTION, PROP_NONE); - RNA_def_property_collection_funcs(prop, "rna_tracking_objects_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0, 0); + RNA_def_property_collection_funcs(prop, "rna_trackingObjects_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0, 0); RNA_def_property_struct_type(prop, "MovieTrackingObject"); RNA_def_property_ui_text(prop, "Objects", "Collection of objects in this tracking data object"); rna_def_trackingObjects(brna, prop); diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index d080a7b08dd..160787556ed 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -46,6 +46,14 @@ #include "BKE_sound.h" +#ifdef WITH_CYCLES +static EnumPropertyItem compute_device_type_items[] = { + {USER_COMPUTE_DEVICE_NONE, "NONE", 0, "None", "Don't use compute device"}, + {USER_COMPUTE_DEVICE_CUDA, "CUDA", 0, "CUDA", "Use CUDA for GPU acceleration"}, + {USER_COMPUTE_DEVICE_OPENCL, "OPENCL", 0, "OpenCL", "Use OpenCL for GPU acceleration"}, + { 0, NULL, 0, NULL, NULL}}; +#endif + #ifdef RNA_RUNTIME #include "DNA_object_types.h" @@ -65,6 +73,8 @@ #include "UI_interface.h" +#include "CCL_api.h" + static void rna_userdef_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *UNUSED(ptr)) { WM_main_add_notifier(NC_WINDOW, NULL); @@ -302,6 +312,79 @@ static void rna_userdef_text_update(Main *UNUSED(bmain), Scene *UNUSED(scene), P WM_main_add_notifier(NC_WINDOW, NULL); } +static PointerRNA rna_Theme_space_generic_get(PointerRNA *ptr) +{ + return rna_pointer_inherit_refine(ptr, &RNA_ThemeSpaceGeneric, ptr->data); +} + +static PointerRNA rna_Theme_space_list_generic_get(PointerRNA *ptr) +{ + return rna_pointer_inherit_refine(ptr, &RNA_ThemeSpaceListGeneric, ptr->data); +} + + +#ifdef WITH_CYCLES +static EnumPropertyItem *rna_userdef_compute_device_type_itemf(bContext *UNUSED(C), PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), int *free) +{ + EnumPropertyItem *item= NULL; + int totitem= 0; + + /* add supported device types */ + RNA_enum_items_add_value(&item, &totitem, compute_device_type_items, USER_COMPUTE_DEVICE_NONE); + if(CCL_compute_device_list(0)) + RNA_enum_items_add_value(&item, &totitem, compute_device_type_items, USER_COMPUTE_DEVICE_CUDA); + if(CCL_compute_device_list(1)) + RNA_enum_items_add_value(&item, &totitem, compute_device_type_items, USER_COMPUTE_DEVICE_OPENCL); + + RNA_enum_item_end(&item, &totitem); + *free = 1; + + return item; +} + +static int rna_userdef_compute_device_get(PointerRNA *UNUSED(ptr)) +{ + if(U.compute_device_type == USER_COMPUTE_DEVICE_NONE) + return 0; + + return U.compute_device_id; +} + +static EnumPropertyItem *rna_userdef_compute_device_itemf(bContext *UNUSED(C), PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), int *free) +{ + EnumPropertyItem tmp= {0, "", 0, "", ""}; + EnumPropertyItem *item= NULL; + int totitem= 0; + + if(U.compute_device_type == USER_COMPUTE_DEVICE_NONE) { + /* only add a single CPU device */ + tmp.value = 0; + tmp.name = "CPU"; + tmp.identifier = "CPU"; + RNA_enum_item_add(&item, &totitem, &tmp); + } + else { + /* get device list from cycles. it would be good to make this generic + once we have more subsystems using opencl, for now this is easiest */ + int opencl = (U.compute_device_type == USER_COMPUTE_DEVICE_OPENCL); + CCLDeviceInfo *devices = CCL_compute_device_list(opencl); + int a; + + for(a = 0; devices[a].name; a++) { + tmp.value = devices[a].value; + tmp.identifier = devices[a].identifier; + tmp.name = devices[a].name; + RNA_enum_item_add(&item, &totitem, &tmp); + } + } + + RNA_enum_item_end(&item, &totitem); + *free = 1; + + return item; +} +#endif + #else static void rna_def_userdef_theme_ui_font_style(BlenderRNA *brna) @@ -639,10 +722,15 @@ static void rna_def_userdef_theme_ui(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_userdef_update"); } -static void rna_def_userdef_theme_spaces_main(StructRNA *srna, int spacetype) +static void rna_def_userdef_theme_space_generic(BlenderRNA *brna) { + StructRNA *srna; PropertyRNA *prop; + srna= RNA_def_struct(brna, "ThemeSpaceGeneric", NULL); + RNA_def_struct_sdna(srna, "ThemeSpace"); + RNA_def_struct_ui_text(srna, "Theme Space Settings", ""); + /* window */ prop= RNA_def_property(srna, "back", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_array(prop, 3); @@ -653,7 +741,7 @@ static void rna_def_userdef_theme_spaces_main(StructRNA *srna, int spacetype) RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Title", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop= RNA_def_property(srna, "text", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Text", ""); @@ -674,57 +762,87 @@ static void rna_def_userdef_theme_spaces_main(StructRNA *srna, int spacetype) RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Header Text", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop= RNA_def_property(srna, "header_text_hi", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Header Text Highlight", ""); 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_GAMMA); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Region Background", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop= RNA_def_property(srna, "button_title", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Region Text Titles", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop= RNA_def_property(srna, "button_text", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Region Text", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop= RNA_def_property(srna, "button_text_hi", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Region Text Highlight", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); // } - - /* list/channels */ - if(ELEM5(spacetype, SPACE_IPO, SPACE_ACTION, SPACE_NLA, SPACE_NODE, SPACE_FILE)) { - prop= RNA_def_property(srna, "list", PROP_FLOAT, PROP_COLOR_GAMMA); - RNA_def_property_array(prop, 3); - RNA_def_property_ui_text(prop, "Source List", ""); - RNA_def_property_update(prop, 0, "rna_userdef_update"); - - prop= RNA_def_property(srna, "list_title", PROP_FLOAT, PROP_COLOR_GAMMA); - RNA_def_property_array(prop, 3); - RNA_def_property_ui_text(prop, "Source List Title", ""); - RNA_def_property_update(prop, 0, "rna_userdef_update"); - - prop= RNA_def_property(srna, "list_text", PROP_FLOAT, PROP_COLOR_GAMMA); - RNA_def_property_array(prop, 3); - RNA_def_property_ui_text(prop, "Source List Text", ""); - RNA_def_property_update(prop, 0, "rna_userdef_update"); - - prop= RNA_def_property(srna, "list_text_hi", PROP_FLOAT, PROP_COLOR_GAMMA); - RNA_def_property_array(prop, 3); - RNA_def_property_ui_text(prop, "Source List Text Highlight", ""); - RNA_def_property_update(prop, 0, "rna_userdef_update"); - } +} + +/* list / channels */ +static void rna_def_userdef_theme_space_list_generic(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + srna= RNA_def_struct(brna, "ThemeSpaceListGeneric", NULL); + RNA_def_struct_sdna(srna, "ThemeSpace"); + RNA_def_struct_ui_text(srna, "Theme Space List Settings", ""); + + prop= RNA_def_property(srna, "list", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Source List", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + + prop= RNA_def_property(srna, "list_title", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Source List Title", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + + prop= RNA_def_property(srna, "list_text", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Source List Text", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + + prop= RNA_def_property(srna, "list_text_hi", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Source List Text Highlight", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); +} + +static void rna_def_userdef_theme_spaces_main(StructRNA *srna) +{ + PropertyRNA *prop; + + prop= RNA_def_property(srna, "space", PROP_POINTER, PROP_NONE); + RNA_def_property_flag(prop, PROP_NEVER_NULL); + RNA_def_property_struct_type(prop, "ThemeSpaceGeneric"); + RNA_def_property_pointer_funcs(prop, "rna_Theme_space_generic_get", NULL, NULL, NULL); + RNA_def_property_ui_text(prop, "Theme Space", "Settings for space"); +} + +static void rna_def_userdef_theme_spaces_list_main(StructRNA *srna) +{ + PropertyRNA *prop; + + prop= RNA_def_property(srna, "space_list", PROP_POINTER, PROP_NONE); + RNA_def_property_flag(prop, PROP_NEVER_NULL); + RNA_def_property_struct_type(prop, "ThemeSpaceListGeneric"); + RNA_def_property_pointer_funcs(prop, "rna_Theme_space_list_generic_get", NULL, NULL, NULL); + RNA_def_property_ui_text(prop, "Theme Space List", "Settings for space list"); } static void rna_def_userdef_theme_spaces_vertex(StructRNA *srna) @@ -930,7 +1048,7 @@ static void rna_def_userdef_theme_space_view3d(BlenderRNA *brna) RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Theme 3D View", "Theme settings for the 3D View"); - rna_def_userdef_theme_spaces_main(srna, SPACE_VIEW3D); + rna_def_userdef_theme_spaces_main(srna); prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_array(prop, 3); @@ -1068,7 +1186,8 @@ static void rna_def_userdef_theme_space_graph(BlenderRNA *brna) RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Theme Graph Editor", "Theme settings for the graph editor"); - rna_def_userdef_theme_spaces_main(srna, SPACE_IPO); + rna_def_userdef_theme_spaces_main(srna); + rna_def_userdef_theme_spaces_list_main(srna); prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_array(prop, 3); @@ -1153,7 +1272,8 @@ static void rna_def_userdef_theme_space_file(BlenderRNA *brna) RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Theme File Browser", "Theme settings for the File Browser"); - rna_def_userdef_theme_spaces_main(srna, SPACE_FILE); + rna_def_userdef_theme_spaces_main(srna); + rna_def_userdef_theme_spaces_list_main(srna); prop= RNA_def_property(srna, "selected_file", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "hilite"); @@ -1203,7 +1323,7 @@ static void rna_def_userdef_theme_space_outliner(BlenderRNA *brna) RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Theme Outliner", "Theme settings for the Outliner"); - rna_def_userdef_theme_spaces_main(srna, SPACE_OUTLINER); + rna_def_userdef_theme_spaces_main(srna); } static void rna_def_userdef_theme_space_userpref(BlenderRNA *brna) @@ -1217,7 +1337,7 @@ static void rna_def_userdef_theme_space_userpref(BlenderRNA *brna) RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Theme User Preferences", "Theme settings for the User Preferences"); - rna_def_userdef_theme_spaces_main(srna, SPACE_USERPREF); + rna_def_userdef_theme_spaces_main(srna); } static void rna_def_userdef_theme_space_console(BlenderRNA *brna) @@ -1232,7 +1352,7 @@ static void rna_def_userdef_theme_space_console(BlenderRNA *brna) RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Theme Console", "Theme settings for the Console"); - rna_def_userdef_theme_spaces_main(srna, SPACE_CONSOLE); + rna_def_userdef_theme_spaces_main(srna); prop= RNA_def_property(srna, "line_output", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "console_output"); @@ -1276,7 +1396,7 @@ static void rna_def_userdef_theme_space_info(BlenderRNA *brna) RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Theme Info", "Theme settings for Info"); - rna_def_userdef_theme_spaces_main(srna, SPACE_INFO); + rna_def_userdef_theme_spaces_main(srna); } @@ -1292,7 +1412,7 @@ static void rna_def_userdef_theme_space_text(BlenderRNA *brna) RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Theme Text Editor", "Theme settings for the Text Editor"); - rna_def_userdef_theme_spaces_main(srna, SPACE_TEXT); + rna_def_userdef_theme_spaces_main(srna); prop= RNA_def_property(srna, "line_numbers_background", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "grid"); @@ -1361,7 +1481,8 @@ static void rna_def_userdef_theme_space_node(BlenderRNA *brna) RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Theme Node Editor", "Theme settings for the Node Editor"); - rna_def_userdef_theme_spaces_main(srna, SPACE_NODE); + rna_def_userdef_theme_spaces_main(srna); + rna_def_userdef_theme_spaces_list_main(srna); prop= RNA_def_property(srna, "wire", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "wire"); @@ -1431,7 +1552,7 @@ static void rna_def_userdef_theme_space_logic(BlenderRNA *brna) RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Theme Logic Editor", "Theme settings for the Logic Editor"); - rna_def_userdef_theme_spaces_main(srna, SPACE_LOGIC); + rna_def_userdef_theme_spaces_main(srna); prop= RNA_def_property(srna, "panel", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_array(prop, 3); @@ -1452,7 +1573,7 @@ static void rna_def_userdef_theme_space_buts(BlenderRNA *brna) RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Theme Properties", "Theme settings for the Properties"); - rna_def_userdef_theme_spaces_main(srna, SPACE_BUTS); + rna_def_userdef_theme_spaces_main(srna); prop= RNA_def_property(srna, "panel", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_array(prop, 3); @@ -1472,7 +1593,7 @@ static void rna_def_userdef_theme_space_time(BlenderRNA *brna) RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Theme Timeline", "Theme settings for the Timeline"); - rna_def_userdef_theme_spaces_main(srna, SPACE_TIME); + rna_def_userdef_theme_spaces_main(srna); prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_array(prop, 3); @@ -1498,7 +1619,7 @@ static void rna_def_userdef_theme_space_image(BlenderRNA *brna) RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Theme Image Editor", "Theme settings for the Image Editor"); - rna_def_userdef_theme_spaces_main(srna, SPACE_IMAGE); + rna_def_userdef_theme_spaces_main(srna); rna_def_userdef_theme_spaces_vertex(srna); rna_def_userdef_theme_spaces_face(srna); @@ -1526,7 +1647,7 @@ static void rna_def_userdef_theme_space_seq(BlenderRNA *brna) RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Theme Sequence Editor", "Theme settings for the Sequence Editor"); - rna_def_userdef_theme_spaces_main(srna, SPACE_IMAGE); + rna_def_userdef_theme_spaces_main(srna); prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_array(prop, 3); @@ -1618,7 +1739,8 @@ static void rna_def_userdef_theme_space_action(BlenderRNA *brna) RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Theme DopeSheet", "Theme settings for the DopeSheet"); - rna_def_userdef_theme_spaces_main(srna, SPACE_ACTION); + rna_def_userdef_theme_spaces_main(srna); + rna_def_userdef_theme_spaces_list_main(srna); prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_array(prop, 3); @@ -1704,7 +1826,8 @@ static void rna_def_userdef_theme_space_nla(BlenderRNA *brna) RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Theme NLA Editor", "Theme settings for the NLA Editor"); - rna_def_userdef_theme_spaces_main(srna, SPACE_NLA); + rna_def_userdef_theme_spaces_main(srna); + rna_def_userdef_theme_spaces_list_main(srna); prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_array(prop, 3); @@ -1793,7 +1916,7 @@ static void rna_def_userdef_theme_space_clip(BlenderRNA *brna) RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Theme Clip Editor", "Theme settings for the Movie Clip Editor"); - rna_def_userdef_theme_spaces_main(srna, SPACE_CLIP); + rna_def_userdef_theme_spaces_main(srna); prop= RNA_def_property(srna, "marker_outline", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "marker_outline"); @@ -1908,6 +2031,7 @@ static void rna_def_userdef_themes(BlenderRNA *brna) prop= RNA_def_property(srna, "theme_area", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "active_theme_area"); + RNA_def_property_flag(prop, PROP_SKIP_SAVE); RNA_def_property_enum_items(prop, active_theme_area); RNA_def_property_ui_text(prop, "Active Theme Area", ""); @@ -2047,6 +2171,9 @@ static void rna_def_userdef_dothemes(BlenderRNA *brna) rna_def_userdef_theme_ui_style(brna); rna_def_userdef_theme_ui(brna); + + rna_def_userdef_theme_space_generic(brna); + rna_def_userdef_theme_space_list_generic(brna); rna_def_userdef_theme_space_view3d(brna); rna_def_userdef_theme_space_graph(brna); @@ -2618,7 +2745,7 @@ static void rna_def_userdef_system(BlenderRNA *brna) /* locale according to http://www.roseindia.net/tutorials/I18N/locales-list.shtml */ /* if you edit here, please also edit the source/blender/blenfont/intern/blf_lang.c 's locales */ /* Note: As this list is in alphabetical order, and not defined order, - * here is the highest define currently in use: 28 (serbian latin). */ + * here is the highest define currently in use: 29 (kyrgyz). */ static EnumPropertyItem language_items[] = { { 0, "", 0, "Nearly done", ""}, { 0, "DEFAULT", 0, "Default (Default)", ""}, @@ -2643,6 +2770,7 @@ static void rna_def_userdef_system(BlenderRNA *brna) {23, "GREEK", 0, "Greek (Ελληνικά)", "el_GR"}, {27, "INDONESIAN", 0, "Indonesian (Bahasa indonesia)", "id_ID"}, { 2, "JAPANESE", 0, "Japanese (日本語)", "ja_JP"}, + {29, "KYRGYZ", 0, "Kyrgyz (Kyrgyz tili)", "ki"}, {24, "KOREAN", 0, "Korean (한국 언어)", "ko_KR"}, {25, "NEPALI", 0, "Nepali (नेपाली)", "ne_NP"}, /* using the utf8 flipped form of Persian (فارسی) */ @@ -2655,6 +2783,12 @@ static void rna_def_userdef_system(BlenderRNA *brna) {18, "UKRAINIAN", 0, "Ukrainian (Український)", "uk_UA"}, { 0, NULL, 0, NULL, NULL}}; +#ifdef WITH_CYCLES + static EnumPropertyItem compute_device_items[] = { + {0, "CPU", 0, "CPU", ""}, + { 0, NULL, 0, NULL, NULL}}; +#endif + srna= RNA_def_struct(brna, "UserPreferencesSystem", NULL); RNA_def_struct_sdna(srna, "UserDef"); RNA_def_struct_nested(brna, srna, "UserPreferences"); @@ -2863,14 +2997,20 @@ static void rna_def_userdef_system(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Text Anti-aliasing", "Draw user interface text anti-aliased"); RNA_def_property_update(prop, 0, "rna_userdef_text_update"); -#if 0 - prop= RNA_def_property(srna, "verse_master", PROP_STRING, PROP_NONE); - RNA_def_property_string_sdna(prop, NULL, "versemaster"); - RNA_def_property_ui_text(prop, "Verse Master", "Verse Master-server IP"); - - prop= RNA_def_property(srna, "verse_username", PROP_STRING, PROP_NONE); - RNA_def_property_string_sdna(prop, NULL, "verseuser"); - RNA_def_property_ui_text(prop, "Verse Username", "Verse user name"); +#ifdef WITH_CYCLES + prop= RNA_def_property(srna, "compute_device_type", PROP_ENUM, PROP_NONE); + RNA_def_property_flag(prop, PROP_ENUM_NO_CONTEXT); + RNA_def_property_enum_sdna(prop, NULL, "compute_device_type"); + RNA_def_property_enum_items(prop, compute_device_type_items); + RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_userdef_compute_device_type_itemf"); + RNA_def_property_ui_text(prop, "Compute Device Type", "Device to use for computation (rendering with Cycles)"); + + prop= RNA_def_property(srna, "compute_device", PROP_ENUM, PROP_NONE); + RNA_def_property_flag(prop, PROP_ENUM_NO_CONTEXT); + RNA_def_property_enum_sdna(prop, NULL, "compute_device_id"); + RNA_def_property_enum_items(prop, compute_device_items); + RNA_def_property_enum_funcs(prop, "rna_userdef_compute_device_get", NULL, "rna_userdef_compute_device_itemf"); + RNA_def_property_ui_text(prop, "Compute Device", "Device to use for computation"); #endif } diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c index 8e05e43b48f..52a4a1db36b 100644 --- a/source/blender/makesrna/intern/rna_wm.c +++ b/source/blender/makesrna/intern/rna_wm.c @@ -371,7 +371,7 @@ EnumPropertyItem wm_report_items[] = { {RPT_OPERATOR, "OPERATOR", 0, "Operator", ""}, {RPT_WARNING, "WARNING", 0, "Warning", ""}, {RPT_ERROR, "ERROR", 0, "Error", ""}, - {RPT_ERROR_INVALID_INPUT, "ERROR_INVALID_INPUT", 0, "Invalid Input", ""},\ + {RPT_ERROR_INVALID_INPUT, "ERROR_INVALID_INPUT", 0, "Invalid Input", ""}, {RPT_ERROR_INVALID_CONTEXT, "ERROR_INVALID_CONTEXT", 0, "Invalid Context", ""}, {RPT_ERROR_OUT_OF_MEMORY, "ERROR_OUT_OF_MEMORY", 0, "Out of Memory", ""}, {0, NULL, 0, NULL, NULL}}; diff --git a/source/blender/modifiers/intern/MOD_armature.c b/source/blender/modifiers/intern/MOD_armature.c index d2d875150e8..8c8523f8d2c 100644 --- a/source/blender/modifiers/intern/MOD_armature.c +++ b/source/blender/modifiers/intern/MOD_armature.c @@ -69,7 +69,7 @@ static void copyData(ModifierData *md, ModifierData *target) tamd->object = amd->object; tamd->deformflag = amd->deformflag; tamd->multi = amd->multi; - BLI_strncpy(tamd->defgrp_name, amd->defgrp_name, 32); + BLI_strncpy(tamd->defgrp_name, amd->defgrp_name, sizeof(tamd->defgrp_name)); } static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *UNUSED(md)) diff --git a/source/blender/modifiers/intern/MOD_bevel.c b/source/blender/modifiers/intern/MOD_bevel.c index c746b10755e..160167808fc 100644 --- a/source/blender/modifiers/intern/MOD_bevel.c +++ b/source/blender/modifiers/intern/MOD_bevel.c @@ -71,7 +71,7 @@ static void copyData(ModifierData *md, ModifierData *target) tbmd->lim_flags = bmd->lim_flags; tbmd->e_flags = bmd->e_flags; tbmd->bevel_angle = bmd->bevel_angle; - BLI_strncpy(tbmd->defgrp_name, bmd->defgrp_name, 32); + BLI_strncpy(tbmd->defgrp_name, bmd->defgrp_name, sizeof(tbmd->defgrp_name)); } static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md) diff --git a/source/blender/modifiers/intern/MOD_cast.c b/source/blender/modifiers/intern/MOD_cast.c index 16d57a2400f..78bebc0b5e2 100644 --- a/source/blender/modifiers/intern/MOD_cast.c +++ b/source/blender/modifiers/intern/MOD_cast.c @@ -76,7 +76,7 @@ static void copyData(ModifierData *md, ModifierData *target) tcmd->flag = cmd->flag; tcmd->type = cmd->type; tcmd->object = cmd->object; - BLI_strncpy(tcmd->defgrp_name, cmd->defgrp_name, 32); + BLI_strncpy(tcmd->defgrp_name, cmd->defgrp_name, sizeof(tcmd->defgrp_name)); } static int isDisabled(ModifierData *md, int UNUSED(useRenderParams)) diff --git a/source/blender/modifiers/intern/MOD_curve.c b/source/blender/modifiers/intern/MOD_curve.c index 261d0c6c0d3..9a7dd3fc898 100644 --- a/source/blender/modifiers/intern/MOD_curve.c +++ b/source/blender/modifiers/intern/MOD_curve.c @@ -64,7 +64,7 @@ static void copyData(ModifierData *md, ModifierData *target) tcmd->defaxis = cmd->defaxis; tcmd->object = cmd->object; - BLI_strncpy(tcmd->name, cmd->name, 32); + BLI_strncpy(tcmd->name, cmd->name, sizeof(tcmd->name)); } static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md) diff --git a/source/blender/modifiers/intern/MOD_displace.c b/source/blender/modifiers/intern/MOD_displace.c index da90879ed6d..1ac11da25db 100644 --- a/source/blender/modifiers/intern/MOD_displace.c +++ b/source/blender/modifiers/intern/MOD_displace.c @@ -74,11 +74,11 @@ static void copyData(ModifierData *md, ModifierData *target) tdmd->texture = dmd->texture; tdmd->strength = dmd->strength; tdmd->direction = dmd->direction; - BLI_strncpy(tdmd->defgrp_name, dmd->defgrp_name, 32); + BLI_strncpy(tdmd->defgrp_name, dmd->defgrp_name, sizeof(tdmd->defgrp_name)); tdmd->midlevel = dmd->midlevel; tdmd->texmapping = dmd->texmapping; tdmd->map_object = dmd->map_object; - BLI_strncpy(tdmd->uvlayer_name, dmd->uvlayer_name, 32); + BLI_strncpy(tdmd->uvlayer_name, dmd->uvlayer_name, sizeof(tdmd->uvlayer_name)); } static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md) diff --git a/source/blender/modifiers/intern/MOD_hook.c b/source/blender/modifiers/intern/MOD_hook.c index f5e4ebfd449..9d5bc46810b 100644 --- a/source/blender/modifiers/intern/MOD_hook.c +++ b/source/blender/modifiers/intern/MOD_hook.c @@ -71,8 +71,8 @@ static void copyData(ModifierData *md, ModifierData *target) thmd->totindex = hmd->totindex; thmd->indexar = MEM_dupallocN(hmd->indexar); memcpy(thmd->parentinv, hmd->parentinv, sizeof(hmd->parentinv)); - BLI_strncpy(thmd->name, hmd->name, 32); - BLI_strncpy(thmd->subtarget, hmd->subtarget, 32); + BLI_strncpy(thmd->name, hmd->name, sizeof(thmd->name)); + BLI_strncpy(thmd->subtarget, hmd->subtarget, sizeof(thmd->subtarget)); } static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md) diff --git a/source/blender/modifiers/intern/MOD_lattice.c b/source/blender/modifiers/intern/MOD_lattice.c index 4d5c63986a5..ac0a3a0c052 100644 --- a/source/blender/modifiers/intern/MOD_lattice.c +++ b/source/blender/modifiers/intern/MOD_lattice.c @@ -56,7 +56,7 @@ static void copyData(ModifierData *md, ModifierData *target) LatticeModifierData *tlmd = (LatticeModifierData*) target; tlmd->object = lmd->object; - BLI_strncpy(tlmd->name, lmd->name, 32); + BLI_strncpy(tlmd->name, lmd->name, sizeof(tlmd->name)); } static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md) diff --git a/source/blender/modifiers/intern/MOD_smooth.c b/source/blender/modifiers/intern/MOD_smooth.c index 1bd5b2e78dd..e43304bc4b9 100644 --- a/source/blender/modifiers/intern/MOD_smooth.c +++ b/source/blender/modifiers/intern/MOD_smooth.c @@ -67,7 +67,7 @@ static void copyData(ModifierData *md, ModifierData *target) tsmd->fac = smd->fac; tsmd->repeat = smd->repeat; tsmd->flag = smd->flag; - BLI_strncpy(tsmd->defgrp_name, smd->defgrp_name, 32); + BLI_strncpy(tsmd->defgrp_name, smd->defgrp_name, sizeof(tsmd->defgrp_name)); } static int isDisabled(ModifierData *md, int UNUSED(useRenderParams)) diff --git a/source/blender/modifiers/intern/MOD_solidify.c b/source/blender/modifiers/intern/MOD_solidify.c index ad47e3fe569..99f5117e3cd 100644 --- a/source/blender/modifiers/intern/MOD_solidify.c +++ b/source/blender/modifiers/intern/MOD_solidify.c @@ -554,11 +554,18 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, const unsigned char crease_outer= smd->crease_outer * 255.0f; const unsigned char crease_inner= smd->crease_inner * 255.0f; - const int edge_indices[4][4] = { - {1, 0, 0, 1}, - {2, 1, 1, 2}, - {3, 2, 2, 3}, - {0, 3, 3, 0}}; + const int edge_indices[2][4][4] = { + /* quad */ + {{1, 0, 0, 1}, + {2, 1, 1, 2}, + {3, 2, 2, 3}, + {0, 3, 3, 0}}, + /* tri */ + {{1, 0, 0, 1}, + {2, 1, 1, 2}, + {0, 2, 2, 0}, + {0, 0, 0, 0}} /* unused for tris */ + }; /* add faces & edges */ origindex= result->getEdgeDataArray(result, CD_ORIGINDEX); @@ -581,6 +588,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, int eidx= new_edge_arr[i]; int fidx= edge_users[eidx]; int flip; + int is_tri; if(fidx >= numFaces) { fidx -= numFaces; @@ -595,8 +603,10 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, /* copy most of the face settings */ DM_copy_face_data(dm, result, fidx, (numFaces * 2) + i, 1); + is_tri = (orig_mface[fidx].v4 == 0); + if(flip) { - DM_swap_face_data(result, (numFaces * 2) + i, edge_indices[edge_order[eidx]]); + DM_swap_face_data(result, (numFaces * 2) + i, edge_indices[is_tri][edge_order[eidx]]); mf->v1= ed->v1; mf->v2= ed->v2; @@ -604,7 +614,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, mf->v4= ed->v1 + numVerts; } else { - DM_swap_face_data(result, (numFaces * 2) + i, edge_indices[edge_order[eidx]]); + DM_swap_face_data(result, (numFaces * 2) + i, edge_indices[is_tri][edge_order[eidx]]); mf->v1= ed->v2; mf->v2= ed->v1; diff --git a/source/blender/modifiers/intern/MOD_util.c b/source/blender/modifiers/intern/MOD_util.c index 5be7eb6af3d..aa8f578942c 100644 --- a/source/blender/modifiers/intern/MOD_util.c +++ b/source/blender/modifiers/intern/MOD_util.c @@ -99,7 +99,7 @@ void get_texture_coords(MappingInfoModifierData *dmd, Object *ob, char *done = MEM_callocN(sizeof(*done) * numVerts, "get_texture_coords done"); int numFaces = dm->getNumFaces(dm); - char uvname[32]; + char uvname[MAX_CUSTOMDATA_LAYER_NAME]; MTFace *tf; CustomData_validate_layer_name(&dm->faceData, CD_MTFACE, dmd->uvlayer_name, uvname); diff --git a/source/blender/modifiers/intern/MOD_uvproject.c b/source/blender/modifiers/intern/MOD_uvproject.c index c89fdb3a0ee..77ce879bbf6 100644 --- a/source/blender/modifiers/intern/MOD_uvproject.c +++ b/source/blender/modifiers/intern/MOD_uvproject.c @@ -155,7 +155,7 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd, Projector projectors[MOD_UVPROJECT_MAXPROJECTORS]; int num_projectors = 0; float aspect; - char uvname[32]; + char uvname[MAX_CUSTOMDATA_LAYER_NAME]; float aspx= umd->aspectx ? umd->aspectx : 1.0f; float aspy= umd->aspecty ? umd->aspecty : 1.0f; float scax= umd->scalex ? umd->scalex : 1.0f; diff --git a/source/blender/modifiers/intern/MOD_wave.c b/source/blender/modifiers/intern/MOD_wave.c index e83aa9e3fb9..f4377e82408 100644 --- a/source/blender/modifiers/intern/MOD_wave.c +++ b/source/blender/modifiers/intern/MOD_wave.c @@ -97,7 +97,7 @@ static void copyData(ModifierData *md, ModifierData *target) twmd->texture = wmd->texture; twmd->map_object = wmd->map_object; twmd->texmapping = wmd->texmapping; - BLI_strncpy(twmd->defgrp_name, wmd->defgrp_name, 32); + BLI_strncpy(twmd->defgrp_name, wmd->defgrp_name, sizeof(twmd->defgrp_name)); } static int dependsOnTime(ModifierData *UNUSED(md)) diff --git a/source/blender/modifiers/intern/MOD_weightvg_util.c b/source/blender/modifiers/intern/MOD_weightvg_util.c index 5631b7e716a..9794635e428 100644 --- a/source/blender/modifiers/intern/MOD_weightvg_util.c +++ b/source/blender/modifiers/intern/MOD_weightvg_util.c @@ -112,7 +112,7 @@ void weightvg_do_map(int num, float *new_w, short falloff_type, CurveMapping *cm * XXX The standard “factor” value is assumed in [0.0, 1.0] range. Else, weird results might appear. */ void weightvg_do_mask(int num, const int *indices, float *org_w, const float *new_w, - Object *ob, DerivedMesh *dm, float fact, const char defgrp_name[32], + Object *ob, DerivedMesh *dm, float fact, const char defgrp_name[MAX_VGROUP_NAME], Tex *texture, int tex_use_channel, int tex_mapping, Object *tex_map_object, const char *tex_uvlayer_name) { diff --git a/source/blender/modifiers/intern/MOD_weightvg_util.h b/source/blender/modifiers/intern/MOD_weightvg_util.h index 2f364a2017f..5ae1e991073 100644 --- a/source/blender/modifiers/intern/MOD_weightvg_util.h +++ b/source/blender/modifiers/intern/MOD_weightvg_util.h @@ -73,7 +73,7 @@ void weightvg_do_map(int num, float *new_w, short mode, struct CurveMapping *cma * XXX The standard “factor” value is assumed in [0.0, 1.0] range. Else, weird results might appear. */ void weightvg_do_mask(int num, const int *indices, float *org_w, const float *new_w, Object *ob, - DerivedMesh *dm, float fact, const char defgrp_name[32], Tex *texture, + DerivedMesh *dm, float fact, const char defgrp_name[MAX_VGROUP_NAME], Tex *texture, int tex_use_channel, int tex_mapping, Object *tex_map_object, const char *tex_uvlayer_name); diff --git a/source/blender/nodes/CMakeLists.txt b/source/blender/nodes/CMakeLists.txt index a09aa7a52a3..6d5c282d308 100644 --- a/source/blender/nodes/CMakeLists.txt +++ b/source/blender/nodes/CMakeLists.txt @@ -59,6 +59,7 @@ set(SRC composite/nodes/node_composite_composite.c composite/nodes/node_composite_crop.c composite/nodes/node_composite_curves.c + composite/nodes/node_composite_doubleEdgeMask.c composite/nodes/node_composite_defocus.c composite/nodes/node_composite_diffMatte.c composite/nodes/node_composite_dilate.c @@ -162,6 +163,7 @@ set(SRC shader/nodes/node_shader_tex_sky.c shader/nodes/node_shader_tex_voronoi.c shader/nodes/node_shader_tex_wave.c + shader/nodes/node_shader_tex_checker.c shader/node_shader_tree.c shader/node_shader_util.c diff --git a/source/blender/nodes/NOD_composite.h b/source/blender/nodes/NOD_composite.h index 97a5afec7da..77745a19934 100644 --- a/source/blender/nodes/NOD_composite.h +++ b/source/blender/nodes/NOD_composite.h @@ -103,6 +103,7 @@ void register_node_type_cmp_color_matte(struct bNodeTreeType *ttype); void register_node_type_cmp_channel_matte(struct bNodeTreeType *ttype); void register_node_type_cmp_color_spill(struct bNodeTreeType *ttype); void register_node_type_cmp_luma_matte(struct bNodeTreeType *ttype); +void register_node_type_cmp_doubleedgemask(struct bNodeTreeType *ttype); void register_node_type_cmp_translate(struct bNodeTreeType *ttype); void register_node_type_cmp_rotate(struct bNodeTreeType *ttype); diff --git a/source/blender/nodes/NOD_shader.h b/source/blender/nodes/NOD_shader.h index 2cabdd33971..907efd76786 100644 --- a/source/blender/nodes/NOD_shader.h +++ b/source/blender/nodes/NOD_shader.h @@ -103,6 +103,7 @@ void register_node_type_sh_tex_magic(struct bNodeTreeType *ttype); void register_node_type_sh_tex_wave(struct bNodeTreeType *ttype); void register_node_type_sh_tex_musgrave(struct bNodeTreeType *ttype); void register_node_type_sh_tex_noise(struct bNodeTreeType *ttype); +void register_node_type_sh_tex_checker(struct bNodeTreeType *ttype); #endif diff --git a/source/blender/nodes/composite/node_composite_tree.c b/source/blender/nodes/composite/node_composite_tree.c index d6a1c50162b..93456d39c9c 100644 --- a/source/blender/nodes/composite/node_composite_tree.c +++ b/source/blender/nodes/composite/node_composite_tree.c @@ -604,8 +604,8 @@ void ntreeCompositExecTree(bNodeTree *ntree, RenderData *rd, int do_preview) if(ntree->progress && totnode) ntree->progress(ntree->prh, (1.0f - curnode/(float)totnode)); if(ntree->stats_draw) { - char str[64]; - sprintf(str, "Compositing %d %s", curnode, node->name); + char str[128]; + BLI_snprintf(str, sizeof(str), "Compositing %d %s", curnode, node->name); ntree->stats_draw(ntree->sdh, str); } curnode--; diff --git a/source/blender/nodes/composite/node_composite_util.c b/source/blender/nodes/composite/node_composite_util.c index c99cae7ed7b..45f490729e8 100644 --- a/source/blender/nodes/composite/node_composite_util.c +++ b/source/blender/nodes/composite/node_composite_util.c @@ -402,7 +402,7 @@ CompBuf *typecheck_compbuf(CompBuf *inbuf, int type) return inbuf; } -static float *compbuf_get_pixel(CompBuf *cbuf, float *defcol, float *use, int x, int y, int xrad, int yrad) +float *compbuf_get_pixel(CompBuf *cbuf, float *defcol, float *use, int x, int y, int xrad, int yrad) { if(cbuf) { if(cbuf->rect_procedural) { diff --git a/source/blender/nodes/composite/node_composite_util.h b/source/blender/nodes/composite/node_composite_util.h index bb606f4202e..02487933849 100644 --- a/source/blender/nodes/composite/node_composite_util.h +++ b/source/blender/nodes/composite/node_composite_util.h @@ -133,6 +133,8 @@ void typecheck_compbuf_color(float *out, float *in, int outtype, int intype); /* **************************************************** */ +float *compbuf_get_pixel(CompBuf *cbuf, float *defcol, float *use, int x, int y, int xrad, int yrad); + /* Pixel-to-Pixel operation, 1 Image in, 1 out */ void composit1_pixel_processor(bNode *node, CompBuf *out, CompBuf *src_buf, float *src_col, void (*func)(bNode *, float *, float *), diff --git a/source/blender/nodes/composite/nodes/node_composite_blur.c b/source/blender/nodes/composite/nodes/node_composite_blur.c index 76827f719f5..fad80723ca3 100644 --- a/source/blender/nodes/composite/nodes/node_composite_blur.c +++ b/source/blender/nodes/composite/nodes/node_composite_blur.c @@ -455,14 +455,19 @@ static void blur_with_reference(bNode *node, CompBuf *new, CompBuf *img, CompBuf int x, y, pix= img->type; int i, j; float *src, *dest, *refd, *blurd; + float defcol[4] = {1.0f, 1.0f, 1.0f, 1.0f}; /* default color for compbuf_get_pixel */ + float proccol[4]; /* local color if compbuf is procedural */ + int refradx, refrady; - if(ref->x!=img->x && ref->y!=img->y) + if(ref->x!=img->x || ref->y!=img->y) return; ref_use= typecheck_compbuf(ref, CB_VAL); /* trick is; we blur the reference image... but only works with clipped values*/ blurbuf= alloc_compbuf(imgx, imgy, CB_VAL, 1); + blurbuf->xof= ref_use->xof; + blurbuf->yof= ref_use->yof; blurd= blurbuf->rect; refd= ref_use->rect; for(x= imgx*imgy; x>0; x--, refd++, blurd++) { @@ -492,15 +497,15 @@ static void blur_with_reference(bNode *node, CompBuf *new, CompBuf *img, CompBuf for(i= 0; i<x; i++) maintabs[i]= make_gausstab(nbd->filtertype, i+1); - refd= blurbuf->rect; dest= new->rect; radxf= (float)radx; radyf= (float)rady; for (y = 0; y < imgy; y++) { - for (x = 0; x < imgx ; x++, dest+=pix, refd++) { - int refradx= (int)(refd[0]*radxf); - int refrady= (int)(refd[0]*radyf); + for (x = 0; x < imgx ; x++, dest+=pix) { + refd= compbuf_get_pixel(blurbuf, defcol, proccol, x-blurbuf->xrad, y-blurbuf->yrad, blurbuf->xrad, blurbuf->yrad); + refradx= (int)(refd[0]*radxf); + refrady= (int)(refd[0]*radyf); if(refradx>radx) refradx= radx; else if(refradx<1) refradx= 1; diff --git a/source/blender/nodes/composite/nodes/node_composite_doubleEdgeMask.c b/source/blender/nodes/composite/nodes/node_composite_doubleEdgeMask.c new file mode 100644 index 00000000000..61d30a5ec4a --- /dev/null +++ b/source/blender/nodes/composite/nodes/node_composite_doubleEdgeMask.c @@ -0,0 +1,1184 @@ +/* + * ***** 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * The Original Code is Copyright (C) 2011 Blender Foundation. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): Peter Larabell. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +/** \file blender/nodes/composite/nodes/node_composite_doubleEdgeMask.c + * \ingroup cmpnodes + */ +#include "node_composite_util.h" +/* **************** Double Edge Mask ******************** */ + + +static bNodeSocketTemplate cmp_node_doubleedgemask_in[]= { + { SOCK_FLOAT, 1, "Inner Mask", 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f, PROP_NONE}, // inner mask socket definition + { SOCK_FLOAT, 1, "Outer Mask", 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f, PROP_NONE}, // outer mask socket definition + { -1, 0, "" } // input socket array terminator +}; +static bNodeSocketTemplate cmp_node_doubleedgemask_out[]= { + { SOCK_FLOAT, 0, "Mask"}, // output socket definition + { -1, 0, "" } // output socket array terminator +}; + +static void do_adjacentKeepBorders(unsigned int t, unsigned int rw, unsigned int *limask, unsigned int *lomask, unsigned int *lres, float *res, unsigned int *rsize){ + int x; + unsigned int isz=0; // inner edge size + unsigned int osz=0; // outer edge size + unsigned int gsz=0; // gradient fill area size + /* Test the four corners */ + /* upper left corner */ + x=t-rw+1; + // test if inner mask is filled + if(limask[x]){ + // test if pixel underneath, or to the right, are empty in the inner mask, + // but filled in the outer mask + if((!limask[x-rw] && lomask[x-rw]) || (!limask[x+1] && lomask[x+1])){ + isz++; // increment inner edge size + lres[x]=4; // flag pixel as inner edge + } else { + res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge + } + } else if(lomask[x]){ // inner mask was empty, test if outer mask is filled + osz++; // increment outer edge size + lres[x]=3; // flag pixel as outer edge + } + /* upper right corner */ + x=t; + // test if inner mask is filled + if(limask[x]){ + // test if pixel underneath, or to the left, are empty in the inner mask, + // but filled in the outer mask + if((!limask[x-rw] && lomask[x-rw]) || (!limask[x-1] && lomask[x-1])){ + isz++; // increment inner edge size + lres[x]=4; // flag pixel as inner edge + } else { + res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge + } + } else if(lomask[x]){ // inner mask was empty, test if outer mask is filled + osz++; // increment outer edge size + lres[x]=3; // flag pixel as outer edge + } + /* lower left corner */ + x=0; + // test if inner mask is filled + if(limask[x]){ + // test if pixel above, or to the right, are empty in the inner mask, + // but filled in the outer mask + if((!limask[x+rw] && lomask[x+rw]) || (!limask[x+1] && lomask[x+1])){ + isz++; // increment inner edge size + lres[x]=4; // flag pixel as inner edge + } else { + res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge + } + } else if(lomask[x]){ // inner mask was empty, test if outer mask is filled + osz++; // increment outer edge size + lres[x]=3; // flag pixel as outer edge + } + /* lower right corner */ + x=rw-1; + // test if inner mask is filled + if(limask[x]){ + // test if pixel above, or to the left, are empty in the inner mask, + // but filled in the outer mask + if((!limask[x+rw] && lomask[x+rw]) || (!limask[x-1] && lomask[x-1])){ + isz++; // increment inner edge size + lres[x]=4; // flag pixel as inner edge + } else { + res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge + } + } else if(lomask[x]){ // inner mask was empty, test if outer mask is filled + osz++; // increment outer edge size + lres[x]=3; // flag pixel as outer edge + } + + /* Test the TOP row of pixels in buffer, except corners */ + for(x= t-1; x>=(t-rw)+2; x--) { + // test if inner mask is filled + if(limask[x]) { + // test if pixel to the right, or to the left, are empty in the inner mask, + // but filled in the outer mask + if((!limask[x-1] && lomask[x-1]) || (!limask[x+1] && lomask[x+1])) { + isz++; // increment inner edge size + lres[x]=4; // flag pixel as inner edge + } else { + res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge + } + } else if(lomask[x]) { // inner mask was empty, test if outer mask is filled + osz++; // increment outer edge size + lres[x]=3; // flag pixel as outer edge + } + } + + /* Test the BOTTOM row of pixels in buffer, except corners */ + for(x= rw-2; x; x--) { + // test if inner mask is filled + if(limask[x]) { + // test if pixel to the right, or to the left, are empty in the inner mask, + // but filled in the outer mask + if((!limask[x-1] && lomask[x-1]) || (!limask[x+1] && lomask[x+1])) { + isz++; // increment inner edge size + lres[x]=4; // flag pixel as inner edge + } else { + res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge + } + } else if(lomask[x]) { // inner mask was empty, test if outer mask is filled + osz++; // increment outer edge size + lres[x]=3; // flag pixel as outer edge + } + } + /* Test the LEFT edge of pixels in buffer, except corners */ + for(x= t-(rw<<1)+1; x>=rw; x-=rw) { + // test if inner mask is filled + if(limask[x]) { + // test if pixel underneath, or above, are empty in the inner mask, + // but filled in the outer mask + if((!limask[x-rw] && lomask[x-rw]) || (!limask[x+rw] && lomask[x+rw])) { + isz++; // increment inner edge size + lres[x]=4; // flag pixel as inner edge + } else { + res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge + } + } else if(lomask[x]) { // inner mask was empty, test if outer mask is filled + osz++; // increment outer edge size + lres[x]=3; // flag pixel as outer edge + } + } + + /* Test the RIGHT edge of pixels in buffer, except corners */ + for(x= t-rw; x>rw; x-=rw) { + // test if inner mask is filled + if(limask[x]) { + // test if pixel underneath, or above, are empty in the inner mask, + // but filled in the outer mask + if((!limask[x-rw] && lomask[x-rw]) || (!limask[x+rw] && lomask[x+rw])) { + isz++; // increment inner edge size + lres[x]=4; // flag pixel as inner edge + } else { + res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge + } + } else if(lomask[x]) { // inner mask was empty, test if outer mask is filled + osz++; // increment outer edge size + lres[x]=3; // flag pixel as outer edge + } + } + + rsize[0]=isz; // fill in our return sizes for edges + fill + rsize[1]=osz; + rsize[2]=gsz; +} + +static void do_adjacentBleedBorders(unsigned int t, unsigned int rw, unsigned int *limask, unsigned int *lomask, unsigned int *lres, float *res, unsigned int *rsize){ + int x; + unsigned int isz=0; // inner edge size + unsigned int osz=0; // outer edge size + unsigned int gsz=0; // gradient fill area size + /* Test the four corners */ + /* upper left corner */ + x=t-rw+1; + // test if inner mask is filled + if(limask[x]){ + // test if pixel underneath, or to the right, are empty in the inner mask, + // but filled in the outer mask + if((!limask[x-rw] && lomask[x-rw]) || (!limask[x+1] && lomask[x+1])){ + isz++; // increment inner edge size + lres[x]=4; // flag pixel as inner edge + } else { + res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge + } + } else if(lomask[x]){ // inner mask was empty, test if outer mask is filled + if(!lomask[x-rw] || !lomask[x+1]) { // test if outer mask is empty underneath or to the right + osz++; // increment outer edge size + lres[x]=3; // flag pixel as outer edge + } else { + gsz++; // increment the gradient pixel count + lres[x]=2; // flag pixel as gradient + } + } + /* upper right corner */ + x=t; + // test if inner mask is filled + if(limask[x]){ + // test if pixel underneath, or to the left, are empty in the inner mask, + // but filled in the outer mask + if((!limask[x-rw] && lomask[x-rw]) || (!limask[x-1] && lomask[x-1])){ + isz++; // increment inner edge size + lres[x]=4; // flag pixel as inner edge + } else { + res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge + } + } else if(lomask[x]){ // inner mask was empty, test if outer mask is filled + if(!lomask[x-rw] || !lomask[x-1]) { // test if outer mask is empty underneath or to the left + osz++; // increment outer edge size + lres[x]=3; // flag pixel as outer edge + } else { + gsz++; // increment the gradient pixel count + lres[x]=2; // flag pixel as gradient + } + } + /* lower left corner */ + x=0; + // test if inner mask is filled + if(limask[x]){ + // test if pixel above, or to the right, are empty in the inner mask, + // but filled in the outer mask + if((!limask[x+rw] && lomask[x+rw]) || (!limask[x+1] && lomask[x+1])){ + isz++; // increment inner edge size + lres[x]=4; // flag pixel as inner edge + } else { + res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge + } + } else if(lomask[x]){ // inner mask was empty, test if outer mask is filled + if(!lomask[x+rw] || !lomask[x+1]) { // test if outer mask is empty above or to the right + osz++; // increment outer edge size + lres[x]=3; // flag pixel as outer edge + } else { + gsz++; // increment the gradient pixel count + lres[x]=2; // flag pixel as gradient + } + } + /* lower right corner */ + x=rw-1; + // test if inner mask is filled + if(limask[x]){ + // test if pixel above, or to the left, are empty in the inner mask, + // but filled in the outer mask + if((!limask[x+rw] && lomask[x+rw]) || (!limask[x-1] && lomask[x-1])){ + isz++; // increment inner edge size + lres[x]=4; // flag pixel as inner edge + } else { + res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge + } + } else if(lomask[x]){ // inner mask was empty, test if outer mask is filled + if(!lomask[x+rw] || !lomask[x-1]) { // test if outer mask is empty above or to the left + osz++; // increment outer edge size + lres[x]=3; // flag pixel as outer edge + } else { + gsz++; // increment the gradient pixel count + lres[x]=2; // flag pixel as gradient + } + } + /* Test the TOP row of pixels in buffer, except corners */ + for(x= t-1; x>=(t-rw)+2; x--) { + // test if inner mask is filled + if(limask[x]) { + // test if pixel to the left, or to the right, are empty in the inner mask, + // but filled in the outer mask + if((!limask[x-1] && lomask[x-1]) || (!limask[x+1] && lomask[x+1])) { + isz++; // increment inner edge size + lres[x]=4; // flag pixel as inner edge + } else { + res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge + } + } else if(lomask[x]) { // inner mask was empty, test if outer mask is filled + if(!lomask[x-1] || !lomask[x+1]) { // test if outer mask is empty to the left or to the right + osz++; // increment outer edge size + lres[x]=3; // flag pixel as outer edge + } else { + gsz++; // increment the gradient pixel count + lres[x]=2; // flag pixel as gradient + } + } + } + + /* Test the BOTTOM row of pixels in buffer, except corners */ + for(x= rw-2; x; x--) { + // test if inner mask is filled + if(limask[x]) { + // test if pixel to the left, or to the right, are empty in the inner mask, + // but filled in the outer mask + if((!limask[x-1] && lomask[x-1]) || (!limask[x+1] && lomask[x+1])) { + isz++; // increment inner edge size + lres[x]=4; // flag pixel as inner edge + } else { + res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge + } + } else if(lomask[x]) { // inner mask was empty, test if outer mask is filled + if(!lomask[x-1] || !lomask[x+1]) { // test if outer mask is empty to the left or to the right + osz++; // increment outer edge size + lres[x]=3; // flag pixel as outer edge + } else { + gsz++; // increment the gradient pixel count + lres[x]=2; // flag pixel as gradient + } + } + } + /* Test the LEFT edge of pixels in buffer, except corners */ + for(x= t-(rw<<1)+1; x>=rw; x-=rw) { + // test if inner mask is filled + if(limask[x]) { + // test if pixel underneath, or above, are empty in the inner mask, + // but filled in the outer mask + if((!limask[x-rw] && lomask[x-rw]) || (!limask[x+rw] && lomask[x+rw])) { + isz++; // increment inner edge size + lres[x]=4; // flag pixel as inner edge + } else { + res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge + } + } else if(lomask[x]) { // inner mask was empty, test if outer mask is filled + if(!lomask[x-rw] || !lomask[x+rw]) { // test if outer mask is empty underneath or above + osz++; // increment outer edge size + lres[x]=3; // flag pixel as outer edge + } else { + gsz++; // increment the gradient pixel count + lres[x]=2; // flag pixel as gradient + } + } + } + + /* Test the RIGHT edge of pixels in buffer, except corners */ + for(x= t-rw; x>rw; x-=rw) { + // test if inner mask is filled + if(limask[x]) { + // test if pixel underneath, or above, are empty in the inner mask, + // but filled in the outer mask + if((!limask[x-rw] && lomask[x-rw]) || (!limask[x+rw] && lomask[x+rw])) { + isz++; // increment inner edge size + lres[x]=4; // flag pixel as inner edge + } else { + res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge + } + } else if(lomask[x]) { // inner mask was empty, test if outer mask is filled + if(!lomask[x-rw] || !lomask[x+rw]) { // test if outer mask is empty underneath or above + osz++; // increment outer edge size + lres[x]=3; // flag pixel as outer edge + } else { + gsz++; // increment the gradient pixel count + lres[x]=2; // flag pixel as gradient + } + } + } + + rsize[0]=isz; // fill in our return sizes for edges + fill + rsize[1]=osz; + rsize[2]=gsz; +} + +static void do_allKeepBorders(unsigned int t, unsigned int rw, unsigned int *limask, unsigned int *lomask, unsigned int *lres, float *res, unsigned int *rsize){ + int x; + unsigned int isz=0; // inner edge size + unsigned int osz=0; // outer edge size + unsigned int gsz=0; // gradient fill area size + /* Test the four corners */ + /* upper left corner */ + x=t-rw+1; + // test if inner mask is filled + if(limask[x]){ + // test if the inner mask is empty underneath or to the right + if(!limask[x-rw] || !limask[x+1]){ + isz++; // increment inner edge size + lres[x]=4; // flag pixel as inner edge + } else { + res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge + } + } else if(lomask[x]){ // inner mask was empty, test if outer mask is filled + osz++; // increment outer edge size + lres[x]=3; // flag pixel as outer edge + } + /* upper right corner */ + x=t; + // test if inner mask is filled + if(limask[x]){ + // test if the inner mask is empty underneath or to the left + if(!limask[x-rw] || !limask[x-1]){ + isz++; // increment inner edge size + lres[x]=4; // flag pixel as inner edge + } else { + res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge + } + } else if(lomask[x]){ // inner mask was empty, test if outer mask is filled + osz++; // increment outer edge size + lres[x]=3; // flag pixel as outer edge + } + /* lower left corner */ + x=0; + // test if inner mask is filled + if(limask[x]){ + // test if inner mask is empty above or to the right + if(!limask[x+rw] || !limask[x+1]){ + isz++; // increment inner edge size + lres[x]=4; // flag pixel as inner edge + } else { + res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge + } + } else if(lomask[x]){ // inner mask was empty, test if outer mask is filled + osz++; // increment outer edge size + lres[x]=3; // flag pixel as outer edge + } + /* lower right corner */ + x=rw-1; + // test if inner mask is filled + if(limask[x]){ + // test if inner mask is empty above or to the left + if(!limask[x+rw] || !limask[x-1]){ + isz++; // increment inner edge size + lres[x]=4; // flag pixel as inner edge + } else { + res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge + } + } else if(lomask[x]){ // inner mask was empty, test if outer mask is filled + osz++; // increment outer edge size + lres[x]=3; // flag pixel as outer edge + } + + /* Test the TOP row of pixels in buffer, except corners */ + for(x= t-1; x>=(t-rw)+2; x--) { + // test if inner mask is filled + if(limask[x]) { + // test if inner mask is empty to the left or to the right + if(!limask[x-1] || !limask[x+1]) { + isz++; // increment inner edge size + lres[x]=4; // flag pixel as inner edge + } else { + res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge + } + } else if(lomask[x]) { // inner mask was empty, test if outer mask is filled + osz++; // increment outer edge size + lres[x]=3; // flag pixel as outer edge + } + } + + /* Test the BOTTOM row of pixels in buffer, except corners */ + for(x= rw-2; x; x--) { + // test if inner mask is filled + if(limask[x]) { + // test if inner mask is empty to the left or to the right + if(!limask[x-1] || !limask[x+1]) { + isz++; // increment inner edge size + lres[x]=4; // flag pixel as inner edge + } else { + res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge + } + } else if(lomask[x]) { // inner mask was empty, test if outer mask is filled + osz++; // increment outer edge size + lres[x]=3; // flag pixel as outer edge + } + } + /* Test the LEFT edge of pixels in buffer, except corners */ + for(x= t-(rw<<1)+1; x>=rw; x-=rw) { + // test if inner mask is filled + if(limask[x]) { + // test if inner mask is empty underneath or above + if(!limask[x-rw] || !limask[x+rw]) { + isz++; // increment inner edge size + lres[x]=4; // flag pixel as inner edge + } else { + res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge + } + } else if(lomask[x]) { // inner mask was empty, test if outer mask is filled + osz++; // increment outer edge size + lres[x]=3; // flag pixel as outer edge + } + } + + /* Test the RIGHT edge of pixels in buffer, except corners */ + for(x= t-rw; x>rw; x-=rw) { + // test if inner mask is filled + if(limask[x]) { + // test if inner mask is empty underneath or above + if(!limask[x-rw] || !limask[x+rw]) { + isz++; // increment inner edge size + lres[x]=4; // flag pixel as inner edge + } else { + res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge + } + } else if(lomask[x]) { // inner mask was empty, test if outer mask is filled + osz++; // increment outer edge size + lres[x]=3; // flag pixel as outer edge + } + } + + rsize[0]=isz; // fill in our return sizes for edges + fill + rsize[1]=osz; + rsize[2]=gsz; +} + +static void do_allBleedBorders(unsigned int t, unsigned int rw, unsigned int *limask, unsigned int *lomask, unsigned int *lres, float *res, unsigned int *rsize){ + int x; + unsigned int isz=0; // inner edge size + unsigned int osz=0; // outer edge size + unsigned int gsz=0; // gradient fill area size + /* Test the four corners */ + /* upper left corner */ + x=t-rw+1; + // test if inner mask is filled + if(limask[x]){ + // test if the inner mask is empty underneath or to the right + if(!limask[x-rw] || !limask[x+1]){ + isz++; // increment inner edge size + lres[x]=4; // flag pixel as inner edge + } else { + res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge + } + } else if(lomask[x]){ // inner mask was empty, test if outer mask is filled + if(!lomask[x-rw] || !lomask[x+1]) { // test if outer mask is empty underneath or to the right + osz++; // increment outer edge size + lres[x]=3; // flag pixel as outer edge + } else { + gsz++; // increment the gradient pixel count + lres[x]=2; // flag pixel as gradient + } + } + /* upper right corner */ + x=t; + // test if inner mask is filled + if(limask[x]){ + // test if the inner mask is empty underneath or to the left + if(!limask[x-rw] || !limask[x-1]){ + isz++; // increment inner edge size + lres[x]=4; // flag pixel as inner edge + } else { + res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge + } + } else if(lomask[x]){ // inner mask was empty, test if outer mask is filled + if(!lomask[x-rw] || !lomask[x-1]) { // test if outer mask is empty above or to the left + osz++; // increment outer edge size + lres[x]=3; // flag pixel as outer edge + } else { + gsz++; // increment the gradient pixel count + lres[x]=2; // flag pixel as gradient + } + } + /* lower left corner */ + x=0; + // test if inner mask is filled + if(limask[x]){ + // test if inner mask is empty above or to the right + if(!limask[x+rw] || !limask[x+1]){ + isz++; // increment inner edge size + lres[x]=4; // flag pixel as inner edge + } else { + res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge + } + } else if(lomask[x]){ // inner mask was empty, test if outer mask is filled + if(!lomask[x+rw] || !lomask[x+1]) { // test if outer mask is empty underneath or to the right + osz++; // increment outer edge size + lres[x]=3; // flag pixel as outer edge + } else { + gsz++; // increment the gradient pixel count + lres[x]=2; // flag pixel as gradient + } + } + /* lower right corner */ + x=rw-1; + // test if inner mask is filled + if(limask[x]){ + // test if inner mask is empty above or to the left + if(!limask[x+rw] || !limask[x-1]){ + isz++; // increment inner edge size + lres[x]=4; // flag pixel as inner edge + } else { + res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge + } + } else if(lomask[x]){ // inner mask was empty, test if outer mask is filled + if(!lomask[x+rw] || !lomask[x-1]) { // test if outer mask is empty underneath or to the left + osz++; // increment outer edge size + lres[x]=3; // flag pixel as outer edge + } else { + gsz++; // increment the gradient pixel count + lres[x]=2; // flag pixel as gradient + } + } + /* Test the TOP row of pixels in buffer, except corners */ + for(x= t-1; x>=(t-rw)+2; x--) { + // test if inner mask is filled + if(limask[x]) { + // test if inner mask is empty to the left or to the right + if(!limask[x-1] || !limask[x+1]) { + isz++; // increment inner edge size + lres[x]=4; // flag pixel as inner edge + } else { + res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge + } + } else if(lomask[x]) { // inner mask was empty, test if outer mask is filled + if(!lomask[x-1] || !lomask[x+1]) { // test if outer mask is empty to the left or to the right + osz++; // increment outer edge size + lres[x]=3; // flag pixel as outer edge + } else { + gsz++; // increment the gradient pixel count + lres[x]=2; // flag pixel as gradient + } + } + } + + /* Test the BOTTOM row of pixels in buffer, except corners */ + for(x= rw-2; x; x--) { + // test if inner mask is filled + if(limask[x]) { + // test if inner mask is empty to the left or to the right + if(!limask[x-1] || !limask[x+1]) { + isz++; // increment inner edge size + lres[x]=4; // flag pixel as inner edge + } else { + res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge + } + } else if(lomask[x]) { // inner mask was empty, test if outer mask is filled + if(!lomask[x-1] || !lomask[x+1]) { // test if outer mask is empty to the left or to the right + osz++; // increment outer edge size + lres[x]=3; // flag pixel as outer edge + } else { + gsz++; // increment the gradient pixel count + lres[x]=2; // flag pixel as gradient + } + } + } + /* Test the LEFT edge of pixels in buffer, except corners */ + for(x= t-(rw<<1)+1; x>=rw; x-=rw) { + // test if inner mask is filled + if(limask[x]) { + // test if inner mask is empty underneath or above + if(!limask[x-rw] || !limask[x+rw]) { + isz++; // increment inner edge size + lres[x]=4; // flag pixel as inner edge + } else { + res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge + } + } else if(lomask[x]) { // inner mask was empty, test if outer mask is filled + if(!lomask[x-rw] || !lomask[x+rw]) { // test if outer mask is empty underneath or above + osz++; // increment outer edge size + lres[x]=3; // flag pixel as outer edge + } else { + gsz++; // increment the gradient pixel count + lres[x]=2; // flag pixel as gradient + } + } + } + + /* Test the RIGHT edge of pixels in buffer, except corners */ + for(x= t-rw; x>rw; x-=rw) { + // test if inner mask is filled + if(limask[x]) { + // test if inner mask is empty underneath or above + if(!limask[x-rw] || !limask[x+rw]) { + isz++; // increment inner edge size + lres[x]=4; // flag pixel as inner edge + } else { + res[x]=1.0f; // pixel is just part of inner mask, and it's not an edge + } + } else if(lomask[x]) { // inner mask was empty, test if outer mask is filled + if(!lomask[x-rw] || !lomask[x+rw]) { // test if outer mask is empty underneath or above + osz++; // increment outer edge size + lres[x]=3; // flag pixel as outer edge + } else { + gsz++; // increment the gradient pixel count + lres[x]=2; // flag pixel as gradient + } + } + } + + rsize[0]=isz; // fill in our return sizes for edges + fill + rsize[1]=osz; + rsize[2]=gsz; +} + +static void do_allEdgeDetection(unsigned int t, unsigned int rw, unsigned int *limask, unsigned int *lomask, unsigned int *lres, float *res, unsigned int *rsize, unsigned int in_isz, unsigned int in_osz, unsigned int in_gsz){ + int x; // x = pixel loop counter + int a; // a = pixel loop counter + int dx; // dx = delta x + int pix_prevRow; // pix_prevRow = pixel one row behind the one we are testing in a loop + int pix_nextRow; // pix_nextRow = pixel one row in front of the one we are testing in a loop + int pix_prevCol; // pix_prevCol = pixel one column behind the one we are testing in a loop + int pix_nextCol; // pix_nextCol = pixel one column in front of the one we are testing in a loop + /* Test all rows between the FIRST and LAST rows, excluding left and right edges */ + for(x= (t-rw)+1, dx=x-(rw-2); dx>rw; x-=rw,dx-=rw) { + a=x-2; + pix_prevRow=a+rw; + pix_nextRow=a-rw; + pix_prevCol=a+1; + pix_nextCol=a-1; + while(a>dx-2) { + if(!limask[a]) { // if the inner mask is empty + if(lomask[a]) { // if the outer mask is full + /* + Next we test all 4 directions around the current pixel: next/prev/up/down + The test ensures that the outer mask is empty and that the inner mask + is also empty. If both conditions are true for any one of the 4 adjacent pixels + then the current pixel is counted as being a true outer edge pixel. + */ + if((!lomask[pix_nextCol] && !limask[pix_nextCol]) || + (!lomask[pix_prevCol] && !limask[pix_prevCol]) || + (!lomask[pix_nextRow] && !limask[pix_nextRow]) || + (!lomask[pix_prevRow] && !limask[pix_prevRow])) + { + in_osz++; // increment the outer boundary pixel count + lres[a]=3; // flag pixel as part of outer edge + } else { // it's not a boundary pixel, but it is a gradient pixel + in_gsz++; // increment the gradient pixel count + lres[a]=2; // flag pixel as gradient + } + } + + } else { + if(!limask[pix_nextCol] || !limask[pix_prevCol] || !limask[pix_nextRow] || !limask[pix_prevRow]) { + in_isz++; // increment the inner boundary pixel count + lres[a]=4; // flag pixel as part of inner edge + } else { + res[a]=1.0f; // pixel is part of inner mask, but not at an edge + } + } + a--; + pix_prevRow--; + pix_nextRow--; + pix_prevCol--; + pix_nextCol--; + } + } + + rsize[0]=in_isz; // fill in our return sizes for edges + fill + rsize[1]=in_osz; + rsize[2]=in_gsz; +} + +static void do_adjacentEdgeDetection(unsigned int t, unsigned int rw, unsigned int *limask, unsigned int *lomask, unsigned int *lres, float *res, unsigned int *rsize, unsigned int in_isz, unsigned int in_osz, unsigned int in_gsz){ + int x; // x = pixel loop counter + int a; // a = pixel loop counter + int dx; // dx = delta x + int pix_prevRow; // pix_prevRow = pixel one row behind the one we are testing in a loop + int pix_nextRow; // pix_nextRow = pixel one row in front of the one we are testing in a loop + int pix_prevCol; // pix_prevCol = pixel one column behind the one we are testing in a loop + int pix_nextCol; // pix_nextCol = pixel one column in front of the one we are testing in a loop + /* Test all rows between the FIRST and LAST rows, excluding left and right edges */ + for(x= (t-rw)+1, dx=x-(rw-2); dx>rw; x-=rw,dx-=rw) { + a=x-2; + pix_prevRow=a+rw; + pix_nextRow=a-rw; + pix_prevCol=a+1; + pix_nextCol=a-1; + while(a>dx-2) { + if(!limask[a]) { // if the inner mask is empty + if(lomask[a]) { // if the outer mask is full + /* + Next we test all 4 directions around the current pixel: next/prev/up/down + The test ensures that the outer mask is empty and that the inner mask + is also empty. If both conditions are true for any one of the 4 adjacent pixels + then the current pixel is counted as being a true outer edge pixel. + */ + if((!lomask[pix_nextCol] && !limask[pix_nextCol]) || + (!lomask[pix_prevCol] && !limask[pix_prevCol]) || + (!lomask[pix_nextRow] && !limask[pix_nextRow]) || + (!lomask[pix_prevRow] && !limask[pix_prevRow])) + { + in_osz++; // increment the outer boundary pixel count + lres[a]=3; // flag pixel as part of outer edge + } else { // it's not a boundary pixel, but it is a gradient pixel + in_gsz++; // increment the gradient pixel count + lres[a]=2; // flag pixel as gradient + } + } + + } else { + if((!limask[pix_nextCol] && lomask[pix_nextCol]) || + (!limask[pix_prevCol] && lomask[pix_prevCol]) || + (!limask[pix_nextRow] && lomask[pix_nextRow]) || + (!limask[pix_prevRow] && lomask[pix_prevRow])) + { + in_isz++; // increment the inner boundary pixel count + lres[a]=4; // flag pixel as part of inner edge + } else { + res[a]=1.0f; // pixel is part of inner mask, but not at an edge + } + } + a--; + pix_prevRow--; // advance all four "surrounding" pixel pointers + pix_nextRow--; + pix_prevCol--; + pix_nextCol--; + } + } + + rsize[0]=in_isz; // fill in our return sizes for edges + fill + rsize[1]=in_osz; + rsize[2]=in_gsz; +} + +static void do_createEdgeLocationBuffer(unsigned int t, unsigned int rw, unsigned int *lres, float *res, unsigned short *gbuf, unsigned int *innerEdgeOffset, unsigned int *outerEdgeOffset, unsigned int isz, unsigned int gsz){ + int x; // x = pixel loop counter + int a; // a = temporary pixel index buffer loop counter + unsigned int ud; // ud = unscaled edge distance + unsigned int dmin; // dmin = minimun edge distance + + unsigned int rsl; // long used for finding fast 1.0/sqrt + unsigned int gradientFillOffset; + unsigned int innerAccum=0; // for looping inner edge pixel indexes, represents current position from offset + unsigned int outerAccum=0; // for looping outer edge pixel indexes, represents current position from offset + unsigned int gradientAccum=0; // for looping gradient pixel indexes, represents current position from offset + /* + Here we compute the size of buffer needed to hold (row,col) coordinates + for each pixel previously determined to be either gradient, inner edge, + or outer edge. + + Allocation is done by requesting 4 bytes "sizeof(int)" per pixel, even + though gbuf[] is declared as unsigned short* (2 bytes) because we don't + store the pixel indexes, we only store x,y location of pixel in buffer. + + This does make the assumption that x and y can fit in 16 unsigned bits + so if Blender starts doing renders greater than 65536 in either direction + this will need to allocate gbuf[] as unsigned int* and allocate 8 bytes + per flagged pixel. + + In general, the buffer on-screen: + + Example: 9 by 9 pixel block + + . = pixel non-white in both outer and inner mask + o = pixel white in outer, but not inner mask, adjacent to "." pixel + g = pixel white in outer, but not inner mask, not adjacent to "." pixel + i = pixel white in inner mask, adjacent to "g" or "." pixel + F = pixel white in inner mask, only adjacent to other pixels white in the inner mask + + + ......... <----- pixel #80 + ..oooo... + .oggggo.. + .oggiggo. + .ogiFigo. + .oggiggo. + .oggggo.. + ..oooo... + pixel #00 -----> ......... + + gsz = 18 (18 "g" pixels above) + isz = 4 (4 "i" pixels above) + osz = 18 (18 "o" pixels above) + + + The memory in gbuf[] after filling will look like this: + + gradientFillOffset (0 pixels) innerEdgeOffset (18 pixels) outerEdgeOffset (22 pixels) + / / / + / / / + |X Y X Y X Y X Y > <X Y X Y > <X Y X Y X Y > <X Y X Y | <- (x,y) + +--------------------------------> <----------------> <------------------------> <----------------+ + |0 2 4 6 8 10 12 14 > ... <68 70 72 74 > ... <80 82 84 86 88 90 > ... <152 154 156 158 | <- bytes + +--------------------------------> <----------------> <------------------------> <----------------+ + |g0 g0 g1 g1 g2 g2 g3 g3 > <g17 g17 i0 i0 > <i2 i2 i3 i3 o0 o0 > <o16 o16 o17 o17 | <- pixel + / / / + / / / + / / / + +---------- gradientAccum (18) ---------+ +--- innerAccum (22) ---+ +--- outerAccum (40) ---+ + + + Ultimately we do need the pixel's memory buffer index to set the output + pixel color, but it's faster to reconstruct the memory buffer location + each iteration of the final gradient calculation than it is to deconstruct + a memory location into x,y pairs each round. +*/ + + + gradientFillOffset=0; // since there are likely "more" of these, put it first. :) + *innerEdgeOffset=gradientFillOffset+gsz; // set start of inner edge indexes + *outerEdgeOffset=(*innerEdgeOffset)+isz; // set start of outer edge indexes + /* set the accumulators to correct positions */ // set up some accumulator variables for loops + gradientAccum = gradientFillOffset; // each accumulator variable starts at its respective + innerAccum = *innerEdgeOffset; // section's offset so when we start filling, each + outerAccum = *outerEdgeOffset; // section fills up it's allocated space in gbuf + //uses dmin=row, rsl=col + for(x=0,dmin=0; x<t; x+=rw,dmin++) { + for(rsl=0; rsl<rw; rsl++) { + a=x+rsl; + if(lres[a]==2) { // it is a gradient pixel flagged by 2 + ud=gradientAccum<<1; // double the index to reach correct unsigned short location + gbuf[ud]=dmin; // insert pixel's row into gradient pixel location buffer + gbuf[ud+1]=rsl; // insert pixel's column into gradient pixel location buffer + gradientAccum++; // increment gradient index buffer pointer + } else if(lres[a]==3) { // it is an outer edge pixel flagged by 3 + ud=outerAccum<<1; // double the index to reach correct unsigned short location + gbuf[ud]=dmin; // insert pixel's row into outer edge pixel location buffer + gbuf[ud+1]=rsl; // insert pixel's column into outer edge pixel location buffer + outerAccum++; // increment outer edge index buffer pointer + res[a]=0.0f; // set output pixel intensity now since it won't change later + } else if(lres[a]==4) { // it is an inner edge pixel flagged by 4 + ud=innerAccum<<1; // double int index to reach correct unsigned short location + gbuf[ud]=dmin; // insert pixel's row into inner edge pixel location buffer + gbuf[ud+1]=rsl; // insert pixel's column into inner edge pixel location buffer + innerAccum++; // increment inner edge index buffer pointer + res[a]=1.0f; // set output pixel intensity now since it won't change later + } + } + } + +} + +static void do_fillGradientBuffer(unsigned int rw, float *res, unsigned short *gbuf, unsigned int isz, unsigned int osz, unsigned int gsz, unsigned int innerEdgeOffset, unsigned int outerEdgeOffset){ + int x; // x = pixel loop counter + int a; // a = temporary pixel index buffer loop counter + int fsz; // size of the frame + unsigned int rsl; // long used for finding fast 1.0/sqrt + float rsf; // float used for finding fast 1.0/sqrt + const float rsopf = 1.5f; // constant float used for finding fast 1.0/sqrt + + unsigned int gradientFillOffset; + unsigned int t; + unsigned int ud; // ud = unscaled edge distance + unsigned int dmin; // dmin = minimun edge distance + float odist; // odist = current outer edge distance + float idist; // idist = current inner edge distance + int dx; // dx = X-delta (used for distance proportion calculation) + int dy; // dy = Y-delta (used for distance proportion calculation) + + /* + The general algorithm used to color each gradient pixel is: + + 1.) Loop through all gradient pixels. + A.) For each gradient pixel: + a.) Loop though all outside edge pixels, looking for closest one + to the gradient pixel we are in. + b.) Loop through all inside edge pixels, looking for closest one + to the gradient pixel we are in. + c.) Find proportion of distance from gradient pixel to inside edge + pixel compared to sum of distance to inside edge and distance to + outside edge. + + In an image where: + . = blank (black) pixels, not covered by inner mask or outer mask + + = desired gradient pixels, covered only by outer mask + * = white full mask pixels, covered by at least inner mask + + ............................... + ...............+++++++++++..... + ...+O++++++..++++++++++++++.... + ..+++\++++++++++++++++++++..... + .+++++G+++++++++*******+++..... + .+++++|+++++++*********+++..... + .++***I****************+++..... + .++*******************+++...... + .+++*****************+++....... + ..+++***************+++........ + ....+++**********+++........... + ......++++++++++++............. + ............................... + + O = outside edge pixel + \ + G = gradient pixel + | + I = inside edge pixel + + __ + *note that IO does not need to be a straight line, in fact + many cases can arise where straight lines do not work + correctly. + + __ __ __ + d.) Pixel color is assigned as |GO| / ( |GI| + |GO| ) + + The implementation does not compute distance, but the reciprocal of the + distance. This is done to avoid having to compute a square root, as a + reciprocal square root can be computed faster. Therefore, the code computes + pixel color as |GI| / (|GI| + |GO|). Since these are reciprocals, GI serves the + purpose of GO for the proportion calculation. + + For the purposes of the minimun distance comparisons, we only check + the sums-of-squares against eachother, since they are in the same + mathematical sort-order as if we did go ahead and take square roots + + Loop through all gradient pixels. + */ + + for(x= gsz-1; x>=0; x--) { + gradientFillOffset=x<<1; + t=gbuf[gradientFillOffset]; // calculate column of pixel indexed by gbuf[x] + fsz=gbuf[gradientFillOffset+1]; // calculate row of pixel indexed by gbuf[x] + dmin=0xffffffff; // reset min distance to edge pixel + for(a=outerEdgeOffset+osz-1; a>=outerEdgeOffset; a--) { // loop through all outer edge buffer pixels + ud=a<<1; + dy=t-gbuf[ud]; // set dx to gradient pixel column - outer edge pixel row + dx=fsz-gbuf[ud+1]; // set dy to gradient pixel row - outer edge pixel column + ud=dx*dx+dy*dy; // compute sum of squares + if(ud<dmin) { // if our new sum of squares is less than the current minimum + dmin=ud; // set a new minimum equal to the new lower value + } + } + odist=(float)(dmin); // cast outer min to a float + rsf=odist*0.5f; // + rsl=*(unsigned int*)&odist; // use some peculiar properties of the way bits are stored + rsl=0x5f3759df-(rsl>>1); // in floats vs. unsigned ints to compute an approximate + odist=*(float*)&rsl; // reciprocal square root + odist=odist*(rsopf-(rsf*odist*odist)); // -- ** this line can be iterated for more accuracy ** -- + dmin=0xffffffff; // reset min distance to edge pixel + for(a= innerEdgeOffset+isz-1; a>=innerEdgeOffset; a--) { // loop through all inside edge pixels + ud=a<<1; + dy=t-gbuf[ud]; // compute delta in Y from gradient pixel to inside edge pixel + dx=fsz-gbuf[ud+1]; // compute delta in X from gradient pixel to inside edge pixel + ud=dx*dx+dy*dy; // compute sum of squares + if(ud<dmin) { // if our new sum of squares is less than the current minimum we've found + dmin=ud; // set a new minimum equal to the new lower value + } + } + idist=(float)(dmin); // cast inner min to a float + rsf=idist*0.5f; // + rsl=*(unsigned int*)&idist; // + rsl=0x5f3759df-(rsl>>1); // see notes above + idist=*(float*)&rsl; // + idist=idist*(rsopf-(rsf*idist*idist)); // + /* + Note once again that since we are using reciprocals of distance values our + proportion is already the correct intensity, and does not need to be + subracted from 1.0 like it would have if we used real distances. + */ + + /* + Here we reconstruct the pixel's memory location in the CompBuf by + Pixel Index = Pixel Column + ( Pixel Row * Row Width ) + */ + res[gbuf[gradientFillOffset+1]+(gbuf[gradientFillOffset]*rw)]=(idist/(idist+odist)); //set intensity + } + +} + + +static void node_composit_exec_doubleedgemask(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out) { + + float *imask; // imask = pointer to inner mask pixel buffer + float *omask; // omask = pointer to outer mask pixel buffer + float *res; // res = pointer to output mask + + unsigned int *lres; // lres = unsigned int pointer to output pixel buffer (for bit operations) + unsigned int *limask; // limask = unsigned int pointer to inner mask (for bit operations) + unsigned int *lomask; // lomask = unsigned int pointer to outer mask (for bit operations) + + int rw; // rw = pixel row width + int t; // t = total number of pixels in buffer - 1 (used for loop starts) + int fsz; // size of the frame + + unsigned int isz=0; // size (in pixels) of inside edge pixel index buffer + unsigned int osz=0; // size (in pixels) of outside edge pixel index buffer + unsigned int gsz=0; // size (in pixels) of gradient pixel index buffer + unsigned int rsize[3]; // size storage to pass to helper functions + unsigned int innerEdgeOffset=0; // offset into final buffer where inner edge pixel indexes start + unsigned int outerEdgeOffset=0; // offset into final buffer where outer edge pixel indexes start + + unsigned short *gbuf; // gradient/inner/outer pixel location index buffer + + CompBuf *cbuf; // pointer, will be set to inner mask data + CompBuf *dbuf; // pointer, will be set to outer mask data + CompBuf *stackbuf; // pointer, will get allocated as output buffer + + if(out[0]->hasoutput==0) { // if the node's output socket is not connected to anything... + return; // do not execute any further, just exit the node immediately + } + + if(in[0]->data && in[1]->data) { // if both input sockets have some data coming in... + cbuf= in[0]->data; // get a pointer to the inner mask data + dbuf= in[1]->data; // get a pointer to the outer mask data + if(cbuf->type!=CB_VAL || dbuf->type!=CB_VAL) { // if either input socket has an incorrect data type coming in + return; // exit the node immediately + } + + t=(cbuf->x*cbuf->y)-1; // determine size of the frame + + stackbuf= alloc_compbuf(cbuf->x, cbuf->y, CB_VAL, 1); // allocate the output buffer + + imask= cbuf->rect; // set the inner mask + omask= dbuf->rect; // set the outer mask + res= stackbuf->rect; // set output pointer + lres= (unsigned int*)res; // unsigned int pointer to output buffer (for bit level ops) + limask=(unsigned int*)imask; // unsigned int pointer to input mask (for bit level ops) + lomask=(unsigned int*)omask; // unsigned int pointer to output mask (for bit level ops) + rw= cbuf->x; // width of a row of pixels + + + /* + The whole buffer is broken up into 4 parts. The four CORNERS, the FIRST and LAST rows, the + LEFT and RIGHT edges (excluding the corner pixels), and all OTHER rows. + This allows for quick computation of outer edge pixels where + a screen edge pixel is marked to be gradient. + + The pixel type (gradient vs inner-edge vs outer-edge) tests change + depending on the user selected "Inner Edge Mode" and the user selected + "Buffer Edge Mode" on the node's GUI. There are 4 sets of basically the + same algorithm: + + 1.) Inner Edge -> Adjacent Only + Buffer Edge -> Keep Inside + + 2.) Inner Edge -> Adjacent Only + Buffer Edge -> Bleed Out + + 3.) Inner Edge -> All + Buffer Edge -> Keep Inside + + 4.) Inner Edge -> All + Buffer Edge -> Bleed Out + + Each version has slightly different criteria for detecting an edge pixel. + */ + if(node->custom2) { // if "adjacent only" inner edge mode is turned on + if(node->custom1) { // if "keep inside" buffer edge mode is turned on + do_adjacentKeepBorders(t,rw,limask,lomask,lres,res,rsize); + }else{ // "bleed out" buffer edge mode is turned on + do_adjacentBleedBorders(t,rw,limask,lomask,lres,res,rsize); + } + isz=rsize[0]; // set up inner edge, outer edge, and gradient buffer sizes after border pass + osz=rsize[1]; + gsz=rsize[2]; + // detect edges in all non-border pixels in the buffer + do_adjacentEdgeDetection(t,rw,limask,lomask,lres,res,rsize,isz,osz,gsz); + }else{ // "all" inner edge mode is turned on + if(node->custom1) { // if "keep inside" buffer edge mode is turned on + do_allKeepBorders(t,rw,limask,lomask,lres,res,rsize); + }else{ // "bleed out" buffer edge mode is turned on + do_allBleedBorders(t,rw,limask,lomask,lres,res,rsize); + } + isz=rsize[0]; // set up inner edge, outer edge, and gradient buffer sizes after border pass + osz=rsize[1]; + gsz=rsize[2]; + // detect edges in all non-border pixels in the buffer + do_allEdgeDetection(t,rw,limask,lomask,lres,res,rsize,isz,osz,gsz); + } + + isz=rsize[0]; // set edge and gradient buffer sizes once again... + osz=rsize[1]; // the sizes in rsize[] may have been modified + gsz=rsize[2]; // by the do_*EdgeDetection() function. + + // quick check for existance of edges in the buffer... + // if we don't have any one of the three sizes, the other two make no difference visually, + // so we can just pass the inner input buffer back as output. + if(!gsz || !isz || !osz) { + out[0]->data= stackbuf; // point the node output buffer to our filled buffer + return; + } + + + fsz=gsz+isz+osz; // calculate size of pixel index buffer needed + gbuf= MEM_mallocN(fsz*sizeof(int), "grd buf"); // allocate edge/gradient pixel index buffer + + do_createEdgeLocationBuffer(t,rw,lres,res,gbuf,&innerEdgeOffset,&outerEdgeOffset,isz,gsz); + do_fillGradientBuffer(rw,res,gbuf,isz,osz,gsz,innerEdgeOffset,outerEdgeOffset); + + MEM_freeN(gbuf); // free the gradient index buffer + out[0]->data= stackbuf; // point the node output buffer to our filled buffer + } +} + +void register_node_type_cmp_doubleedgemask(bNodeTreeType *ttype) { + static bNodeType ntype; // allocate a node type data structure + + node_type_base(ttype, &ntype, CMP_NODE_DOUBLEEDGEMASK, "Double Edge Mask", NODE_CLASS_MATTE, NODE_OPTIONS); + node_type_socket_templates(&ntype, cmp_node_doubleedgemask_in, cmp_node_doubleedgemask_out); + node_type_size(&ntype, 210, 210, 210); + node_type_exec(&ntype, node_composit_exec_doubleedgemask); + + nodeRegisterType(ttype, &ntype); +} diff --git a/source/blender/nodes/intern/node_common.c b/source/blender/nodes/intern/node_common.c index fdce1f92948..5a6cebb51ce 100644 --- a/source/blender/nodes/intern/node_common.c +++ b/source/blender/nodes/intern/node_common.c @@ -530,7 +530,8 @@ int node_group_ungroup(bNodeTree *ntree, bNode *gnode) BLI_addtail(&ntree->links, link); } - /* and copy across the animation */ + /* and copy across the animation, + * note that the animation data's action can be NULL here */ if (wgroup->adt) { LinkData *ld, *ldn=NULL; bAction *waction; @@ -550,7 +551,9 @@ int node_group_ungroup(bNodeTree *ntree, bNode *gnode) } /* free temp action too */ - free_libblock(&G.main->action, waction); + if (waction) { + free_libblock(&G.main->action, waction); + } } /* delete the group instance. this also removes old input links! */ diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_checker.c b/source/blender/nodes/shader/nodes/node_shader_tex_checker.c new file mode 100644 index 00000000000..551b70d9b8a --- /dev/null +++ b/source/blender/nodes/shader/nodes/node_shader_tex_checker.c @@ -0,0 +1,80 @@ +/* + * ***** 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * The Original Code is Copyright (C) 2005 Blender Foundation. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include "../node_shader_util.h" + +/* **************** OUTPUT ******************** */ + +static bNodeSocketTemplate sh_node_tex_checker_in[]= { + { SOCK_VECTOR, 1, "Vector", 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_NONE, SOCK_HIDE_VALUE}, + { SOCK_RGBA, 1, "Color1", 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f}, + { SOCK_RGBA, 1, "Color2", 0.2f, 0.2f, 0.2f, 1.0f, 0.0f, 1.0f}, + { SOCK_FLOAT, 1, "Scale", 5.0f, 0.0f, 0.0f, 0.0f, -1000.0f, 1000.0f}, + { -1, 0, "" } +}; + +static bNodeSocketTemplate sh_node_tex_checker_out[]= { + { SOCK_RGBA, 0, "Color", 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, + { SOCK_FLOAT, 0, "Fac", 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, + { -1, 0, "" } +}; + +static void node_shader_init_tex_checker(bNodeTree *UNUSED(ntree), bNode* node, bNodeTemplate *UNUSED(ntemp)) +{ + NodeTexChecker *tex = MEM_callocN(sizeof(NodeTexChecker), "NodeTexChecker"); + default_tex_mapping(&tex->base.tex_mapping); + default_color_mapping(&tex->base.color_mapping); + + node->storage = tex; +} + +static int node_shader_gpu_tex_checker(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *out) +{ + if(!in[0].link) + in[0].link = GPU_attribute(CD_ORCO, ""); + + node_shader_gpu_tex_mapping(mat, node, in, out); + + return GPU_stack_link(mat, "node_tex_checker", in, out); +} + +/* node type definition */ +void register_node_type_sh_tex_checker(bNodeTreeType *ttype) +{ + static bNodeType ntype; + + node_type_base(ttype, &ntype, SH_NODE_TEX_CHECKER, "Checker Texture", NODE_CLASS_TEXTURE, 0); + node_type_compatibility(&ntype, NODE_NEW_SHADING); + node_type_socket_templates(&ntype, sh_node_tex_checker_in, sh_node_tex_checker_out); + node_type_size(&ntype, 150, 60, 200); + node_type_init(&ntype, node_shader_init_tex_checker); + node_type_storage(&ntype, "NodeTexChecker", node_free_standard_storage, node_copy_standard_storage); + node_type_exec(&ntype, NULL); + node_type_gpu(&ntype, node_shader_gpu_tex_checker); + + nodeRegisterType(ttype, &ntype); +} diff --git a/source/blender/nodes/texture/nodes/node_texture_output.c b/source/blender/nodes/texture/nodes/node_texture_output.c index 0ed6d232b81..829cd06dfc0 100644 --- a/source/blender/nodes/texture/nodes/node_texture_output.c +++ b/source/blender/nodes/texture/nodes/node_texture_output.c @@ -103,8 +103,8 @@ static void unique_name(bNode *node) } else { suffix = 0; new_len = len + 4; - if(new_len > 31) - new_len = 31; + if(new_len > (sizeof(tno->name) - 1)) + new_len = (sizeof(tno->name) - 1); } new_name = MEM_mallocN(new_len + 1, "new_name"); diff --git a/source/blender/python/SConscript b/source/blender/python/SConscript index c98f347d5af..e9c8d50ef85 100644 --- a/source/blender/python/SConscript +++ b/source/blender/python/SConscript @@ -7,7 +7,7 @@ Import ('env') incs = '. ../editors/include ../makesdna ../makesrna ../blenfont ../blenlib ../blenkernel ../nodes' incs += ' ../imbuf ../blenloader ../gpu ../render/extern/include ../windowmanager' incs += ' ../freestyle/intern/python' -incs += ' #intern/guardedalloc #intern/memutil #extern/glew/include' +incs += ' #intern/guardedalloc #intern/memutil #extern/glew/include #intern/cycles/blender' incs += ' #intern/audaspace/intern ' + env['BF_PYTHON_INC'] is_debug = (env['OURPLATFORM'] in ('win32-mingw', 'win32-vc','win64-vc') and env['BF_DEBUG']) diff --git a/source/blender/python/generic/bpy_internal_import.c b/source/blender/python/generic/bpy_internal_import.c index db3519a3056..ecf65275483 100644 --- a/source/blender/python/generic/bpy_internal_import.c +++ b/source/blender/python/generic/bpy_internal_import.c @@ -101,7 +101,7 @@ void bpy_text_filename_get(char *fn, size_t fn_len, Text *text) PyObject *bpy_text_import(Text *text) { char *buf = NULL; - char modulename[24]; + char modulename[MAX_ID_NAME+2]; int len; if (!text->compiled) { diff --git a/source/blender/python/generic/idprop_py_api.c b/source/blender/python/generic/idprop_py_api.c index c058ee1d4f0..516c0afa883 100644 --- a/source/blender/python/generic/idprop_py_api.c +++ b/source/blender/python/generic/idprop_py_api.c @@ -249,7 +249,7 @@ static int BPy_IDGroup_SetName(BPy_IDProperty *self, PyObject *value, void *UNUS name = _PyUnicode_AsStringAndSize(value, &name_size); if (name_size > MAX_IDPROP_NAME) { - PyErr_SetString(PyExc_TypeError, "string length cannot exceed 31 characters!"); + PyErr_SetString(PyExc_TypeError, "string length cannot exceed 63 characters!"); return -1; } @@ -359,7 +359,7 @@ const char *BPy_IDProperty_Map_ValidateAndCreate(PyObject *name_obj, IDProperty Py_ssize_t name_size; name = _PyUnicode_AsStringAndSize(name_obj, &name_size); if (name_size > MAX_IDPROP_NAME) { - return "the length of IDProperty names is limited to 31 characters"; + return "the length of IDProperty names is limited to 63 characters"; } } diff --git a/source/blender/python/intern/CMakeLists.txt b/source/blender/python/intern/CMakeLists.txt index 76fe439027f..4b397ee1870 100644 --- a/source/blender/python/intern/CMakeLists.txt +++ b/source/blender/python/intern/CMakeLists.txt @@ -36,6 +36,7 @@ set(INC ../../gpu ../../freestyle/intern/python ../../../../intern/guardedalloc + ../../../../intern/cycles/blender ) set(INC_SYS diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index 7d91438e4f7..6c961d8e6a8 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -57,12 +57,13 @@ #include "BLI_string_utf8.h" #include "BLI_utildefines.h" - #include "BKE_context.h" #include "BKE_text.h" #include "BKE_main.h" #include "BKE_global.h" /* only for script checking */ +#include "CCL_api.h" + #include "BPY_extern.h" #include "../generic/bpy_internal_import.h" // our own imports @@ -176,8 +177,14 @@ void BPY_context_set(bContext *C) /* defined in AUD_C-API.cpp */ extern PyObject *AUD_initPython(void); -/* defined in cycles/blender */ -extern PyObject *CYCLES_initPython(void); + +#ifdef WITH_CYCLES +/* defined in cycles module */ +static PyObject *CCL_initPython(void) +{ + return (PyObject*)CCL_python_module_init(); +} +#endif static struct _inittab bpy_internal_modules[] = { {(char *)"mathutils", PyInit_mathutils}, @@ -189,7 +196,7 @@ static struct _inittab bpy_internal_modules[] = { {(char *)"aud", AUD_initPython}, #endif #ifdef WITH_CYCLES - {(char *)"_cycles", CYCLES_initPython}, + {(char *)"_cycles", CCL_initPython}, #endif {(char *)"gpu", GPU_initPython}, {NULL, NULL} diff --git a/source/blender/python/intern/bpy_props.c b/source/blender/python/intern/bpy_props.c index 81eb81e90fa..d94ba8b9441 100644 --- a/source/blender/python/intern/bpy_props.c +++ b/source/blender/python/intern/bpy_props.c @@ -1423,7 +1423,7 @@ static PyObject *BPy_RemoveProperty(PyObject *self, PyObject *args, PyObject *kw return ret; } else if (PyTuple_GET_SIZE(args) > 1) { - PyErr_SetString(PyExc_ValueError, "all args must be keywords"); \ + PyErr_SetString(PyExc_ValueError, "all args must be keywords"); return NULL; } diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 9dfbe64e905..4940c53551e 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -743,14 +743,28 @@ int pyrna_enum_value_from_id(EnumPropertyItem *item, const char *identifier, int return 0; } +/* note on __cmp__: + * checking the 'ptr->data' matches works in almost all cases, + * however there are a few RNA properties that are fake sub-structs and + * share the pointer with the parent, in those cases this happens 'a.b == a' + * see: r43352 for example. + * + * So compare the 'ptr->type' as well to avoid this problem. + * It's highly unlikely this would happen that 'ptr->data' and 'ptr->prop' would match, + * but _not_ 'ptr->type' but include this check for completeness. + * - campbell */ + static int pyrna_struct_compare(BPy_StructRNA *a, BPy_StructRNA *b) { - return (a->ptr.data == b->ptr.data) ? 0 : -1; + return ( (a->ptr.data == b->ptr.data) && + (a->ptr.type == b->ptr.type)) ? 0 : -1; } static int pyrna_prop_compare(BPy_PropertyRNA *a, BPy_PropertyRNA *b) { - return (a->prop == b->prop && a->ptr.data == b->ptr.data) ? 0 : -1; + return ( (a->prop == b->prop) && + (a->ptr.data == b->ptr.data) && + (a->ptr.type == b->ptr.type) ) ? 0 : -1; } static PyObject *pyrna_struct_richcmp(PyObject *a, PyObject *b, int op) @@ -3055,7 +3069,6 @@ static PyObject *pyrna_struct_is_property_set(BPy_StructRNA *self, PyObject *arg { PropertyRNA *prop; const char *name; - int ret; PYRNA_STRUCT_CHECK_OBJ(self); @@ -3069,22 +3082,7 @@ static PyObject *pyrna_struct_is_property_set(BPy_StructRNA *self, PyObject *arg return NULL; } - /* double property lookup, could speed up */ - /* return PyBool_FromLong(RNA_property_is_set(&self->ptr, name)); */ - if (RNA_property_flag(prop) & PROP_IDPROPERTY) { - IDProperty *group = RNA_struct_idprops(&self->ptr, 0); - if (group) { - ret = IDP_GetPropertyFromGroup(group, name) ? 1:0; - } - else { - ret = 0; - } - } - else { - ret = 1; - } - - return PyBool_FromLong(ret); + return PyBool_FromLong(RNA_property_is_set(&self->ptr, prop)); } PyDoc_STRVAR(pyrna_struct_is_property_hidden_doc, diff --git a/source/blender/quicktime/apple/qtkit_export.m b/source/blender/quicktime/apple/qtkit_export.m index 365a06c7cd8..045ef973e91 100644 --- a/source/blender/quicktime/apple/qtkit_export.m +++ b/source/blender/quicktime/apple/qtkit_export.m @@ -604,13 +604,14 @@ int append_qt(struct RenderData *rd, int frame, int *pixels, int rectx, int rect OSStatus err = noErr; unsigned char *from_Ptr,*to_Ptr; int y,from_i,to_i; + BOOL alpha = (rd->im_format.planes == R_IMF_PLANES_RGBA)? YES: NO; /* Create bitmap image rep in blender format (32bit RGBA) */ blBitmapFormatImage = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL pixelsWide:rectx pixelsHigh:recty - bitsPerSample:8 samplesPerPixel:4 hasAlpha:YES isPlanar:NO + bitsPerSample:8 samplesPerPixel:4 hasAlpha:alpha isPlanar:NO colorSpaceName:NSCalibratedRGBColorSpace bitmapFormat:NSAlphaNonpremultipliedBitmapFormat bytesPerRow:rectx*4 diff --git a/source/blender/render/intern/include/render_types.h b/source/blender/render/intern/include/render_types.h index f016b0860d7..c2a069cc601 100644 --- a/source/blender/render/intern/include/render_types.h +++ b/source/blender/render/intern/include/render_types.h @@ -36,6 +36,7 @@ /* ------------------------------------------------------------------------- */ #include "DNA_color_types.h" +#include "DNA_customdata_types.h" #include "DNA_scene_types.h" #include "DNA_world_types.h" #include "DNA_object_types.h" @@ -308,8 +309,8 @@ typedef struct ObjectRen { struct HaloRen **bloha; struct StrandBuffer *strandbuf; - char (*mtface)[32]; - char (*mcol)[32]; + char (*mtface)[MAX_CUSTOMDATA_LAYER_NAME]; + char (*mcol)[MAX_CUSTOMDATA_LAYER_NAME]; int actmtface, actmcol, bakemtface; float obmat[4][4]; /* only used in convertblender.c, for instancing */ diff --git a/source/blender/render/intern/raytrace/rayobject.cpp b/source/blender/render/intern/raytrace/rayobject.cpp index 289d28cc214..ef31e730785 100644 --- a/source/blender/render/intern/raytrace/rayobject.cpp +++ b/source/blender/render/intern/raytrace/rayobject.cpp @@ -50,7 +50,8 @@ because function is too long. Since this is code that is called billions of times we really do want to inline. */ -MALWAYS_INLINE RayObject* rayface_from_coords(RayFace *rayface, void *ob, void *face, float *v1, float *v2, float *v3, float *v4) +MALWAYS_INLINE RayObject* rayface_from_coords(RayFace *rayface, void *ob, void *face, + float *v1, float *v2, float *v3, float *v4) { rayface->ob = ob; rayface->face = face; @@ -118,7 +119,7 @@ MALWAYS_INLINE int vlr_check_intersect(Isect *is, ObjectInstanceRen *obi, VlakRe return (is->lay & obi->lay); } -MALWAYS_INLINE int vlr_check_intersect_solid(Isect *is, ObjectInstanceRen* obi, VlakRen *vlr) +MALWAYS_INLINE int vlr_check_intersect_solid(Isect *UNUSED(is), ObjectInstanceRen* UNUSED(obi), VlakRen *vlr) { /* solid material types only */ if (vlr->mat->material_type == MA_TYPE_SURFACE) @@ -127,7 +128,7 @@ MALWAYS_INLINE int vlr_check_intersect_solid(Isect *is, ObjectInstanceRen* obi, return 0; } -MALWAYS_INLINE int vlr_check_bake(Isect *is, ObjectInstanceRen* obi, VlakRen *vlr) +MALWAYS_INLINE int vlr_check_bake(Isect *is, ObjectInstanceRen* obi, VlakRen *UNUSED(vlr)) { return (obi->obr->ob != is->userdata); } diff --git a/source/blender/render/intern/raytrace/rayobject_blibvh.cpp b/source/blender/render/intern/raytrace/rayobject_blibvh.cpp index 4e012831da3..f5a60308561 100644 --- a/source/blender/render/intern/raytrace/rayobject_blibvh.cpp +++ b/source/blender/render/intern/raytrace/rayobject_blibvh.cpp @@ -46,13 +46,14 @@ static void RE_rayobject_blibvh_done(RayObject *o); static void RE_rayobject_blibvh_free(RayObject *o); static void RE_rayobject_blibvh_bb(RayObject *o, float *min, float *max); -static float RE_rayobject_blibvh_cost(RayObject *o) +static float RE_rayobject_blibvh_cost(RayObject *UNUSED(o)) { //TODO calculate the expected cost to raycast on this structure return 1.0; } -static void RE_rayobject_blibvh_hint_bb(RayObject *o, RayHint *hint, float *min, float *max) +static void RE_rayobject_blibvh_hint_bb(RayObject *UNUSED(o), RayHint *UNUSED(hint), + float *UNUSED(min), float *UNUSED(max)) { return; } @@ -95,7 +96,7 @@ struct BVHCallbackUserData RayObject **leafs; }; -static void bvh_callback(void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit) +static void bvh_callback(void *userdata, int index, const BVHTreeRay *UNUSED(ray), BVHTreeRayHit *hit) { struct BVHCallbackUserData *data = (struct BVHCallbackUserData*)userdata; Isect *isec = data->isec; diff --git a/source/blender/render/intern/raytrace/rayobject_empty.cpp b/source/blender/render/intern/raytrace/rayobject_empty.cpp index ddb2c124674..55696b5b827 100644 --- a/source/blender/render/intern/raytrace/rayobject_empty.cpp +++ b/source/blender/render/intern/raytrace/rayobject_empty.cpp @@ -32,30 +32,33 @@ #include "rayobject.h" +#include "BLI_utildefines.h" + /* * Empty raytree */ -static int RE_rayobject_empty_intersect(RayObject *o, Isect *is) +static int RE_rayobject_empty_intersect(RayObject *UNUSED(o), Isect *UNUSED(is)) { return 0; } -static void RE_rayobject_empty_free(RayObject *o) +static void RE_rayobject_empty_free(RayObject *UNUSED(o)) { } -static void RE_rayobject_empty_bb(RayObject *o, float *min, float *max) +static void RE_rayobject_empty_bb(RayObject *UNUSED(o), float *UNUSED(min), float *UNUSED(max)) { return; } -static float RE_rayobject_empty_cost(RayObject *o) +static float RE_rayobject_empty_cost(RayObject *UNUSED(o)) { return 0.0; } -static void RE_rayobject_empty_hint_bb(RayObject *o, RayHint *hint, float *min, float *max) +static void RE_rayobject_empty_hint_bb(RayObject *UNUSED(o), RayHint *UNUSED(hint), + float *UNUSED(min), float *UNUSED(max)) {} static RayObjectAPI empty_api = diff --git a/source/blender/render/intern/raytrace/rayobject_instance.cpp b/source/blender/render/intern/raytrace/rayobject_instance.cpp index a356a7a04e7..c7af501a808 100644 --- a/source/blender/render/intern/raytrace/rayobject_instance.cpp +++ b/source/blender/render/intern/raytrace/rayobject_instance.cpp @@ -47,7 +47,8 @@ static void RE_rayobject_instance_free(RayObject *o); static void RE_rayobject_instance_bb(RayObject *o, float *min, float *max); static float RE_rayobject_instance_cost(RayObject *o); -static void RE_rayobject_instance_hint_bb(RayObject *o, RayHint *hint, float *min, float *max) +static void RE_rayobject_instance_hint_bb(RayObject *UNUSED(o), RayHint *UNUSED(hint), + float *UNUSED(min), float *UNUSED(max)) {} static RayObjectAPI instance_api = diff --git a/source/blender/render/intern/raytrace/rayobject_octree.cpp b/source/blender/render/intern/raytrace/rayobject_octree.cpp index 14b4a7bcf9f..20121b0e51e 100644 --- a/source/blender/render/intern/raytrace/rayobject_octree.cpp +++ b/source/blender/render/intern/raytrace/rayobject_octree.cpp @@ -96,12 +96,13 @@ static void RE_rayobject_octree_bb(RayObject *o, float *min, float *max); /* * This function is not expected to be called by current code state. */ -static float RE_rayobject_octree_cost(RayObject *o) +static float RE_rayobject_octree_cost(RayObject *UNUSED(o)) { return 1.0; } -static void RE_rayobject_octree_hint_bb(RayObject *o, RayHint *hint, float *min, float *max) +static void RE_rayobject_octree_hint_bb(RayObject *UNUSED(o), RayHint *UNUSED(hint), + float *UNUSED(min), float *UNUSED(max)) { return; } @@ -671,7 +672,7 @@ static void RE_rayobject_octree_bb(RayObject *tree, float *min, float *max) } /* check all faces in this node */ -static int testnode(Octree *oc, Isect *is, Node *no, OcVal ocval) +static int testnode(Octree *UNUSED(oc), Isect *is, Node *no, OcVal ocval) { short nr=0; diff --git a/source/blender/render/intern/raytrace/rayobject_qbvh.cpp b/source/blender/render/intern/raytrace/rayobject_qbvh.cpp index 76981632397..f7d38bf0fa3 100644 --- a/source/blender/render/intern/raytrace/rayobject_qbvh.cpp +++ b/source/blender/render/intern/raytrace/rayobject_qbvh.cpp @@ -110,7 +110,7 @@ int intersect(QBVHTree *obj, Isect* isec) } template<class Tree> -void bvh_hint_bb(Tree *tree, LCTSHint *hint, float *min, float *max) +void bvh_hint_bb(Tree *tree, LCTSHint *hint, float *UNUSED(min), float *UNUSED(max)) { //TODO renable hint support { diff --git a/source/blender/render/intern/raytrace/rayobject_svbvh.cpp b/source/blender/render/intern/raytrace/rayobject_svbvh.cpp index 5bd4fc23981..7ce444a2e99 100644 --- a/source/blender/render/intern/raytrace/rayobject_svbvh.cpp +++ b/source/blender/render/intern/raytrace/rayobject_svbvh.cpp @@ -146,7 +146,7 @@ int intersect(SVBVHTree *obj, Isect* isec) } template<class Tree> -void bvh_hint_bb(Tree *tree, LCTSHint *hint, float *min, float *max) +void bvh_hint_bb(Tree *tree, LCTSHint *hint, float *UNUSED(min), float *UNUSED(max)) { //TODO renable hint support { diff --git a/source/blender/render/intern/raytrace/rayobject_vbvh.cpp b/source/blender/render/intern/raytrace/rayobject_vbvh.cpp index be98be24255..75323cfe56a 100644 --- a/source/blender/render/intern/raytrace/rayobject_vbvh.cpp +++ b/source/blender/render/intern/raytrace/rayobject_vbvh.cpp @@ -148,7 +148,7 @@ int intersect(VBVHTree *obj, Isect* isec) } template<class Tree> -void bvh_hint_bb(Tree *tree, LCTSHint *hint, float *min, float *max) +void bvh_hint_bb(Tree *tree, LCTSHint *hint, float *UNUSED(min), float *UNUSED(max)) { //TODO renable hint support { diff --git a/source/blender/render/intern/raytrace/vbvh.h b/source/blender/render/intern/raytrace/vbvh.h index 71e862eccb8..ab6a1bbfd33 100644 --- a/source/blender/render/intern/raytrace/vbvh.h +++ b/source/blender/render/intern/raytrace/vbvh.h @@ -53,7 +53,7 @@ struct VBVHNode * Push nodes (used on dfs) */ template<class Node> -inline static void bvh_node_push_childs(Node *node, Isect *isec, Node **stack, int &stack_pos) +inline static void bvh_node_push_childs(Node *node, Isect *UNUSED(isec), Node **stack, int &stack_pos) { Node *child = node->child; diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index 8dc37dc209f..7cb5e50a029 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -2284,7 +2284,18 @@ static void displace_render_vert(Render *re, ObjectRen *obr, ShadeInput *shi, Ve if(texco & TEXCO_REFL) { /* not (yet?) */ } - + if(texco & TEXCO_STRESS) { + float *s= RE_vertren_get_stress(obr, vr, 0); + + if(s) { + shi->stress= *s; + if(shi->stress<1.0f) shi->stress-= 1.0f; + else shi->stress= (shi->stress-1.0f)/shi->stress; + } + else + shi->stress= 0.0f; + } + shi->displace[0]= shi->displace[1]= shi->displace[2]= 0.0; do_material_tex(shi, re); @@ -3580,6 +3591,9 @@ static void init_render_mesh(Render *re, ObjectRen *obr, int timeoffset) } if(!timeoffset) { + if(need_stress) + calc_edge_stress(re, obr, me); + if (test_for_displace(re, ob ) ) { recalc_normals= 1; calc_vertexnormals(re, obr, 0, 0); @@ -3596,9 +3610,6 @@ static void init_render_mesh(Render *re, ObjectRen *obr, int timeoffset) if(recalc_normals!=0 || need_tangent!=0) calc_vertexnormals(re, obr, need_tangent, need_nmap_tangent); - - if(need_stress) - calc_edge_stress(re, obr, me); } dm->release(dm); diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index edf8e9aeebf..f55a47e1f42 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -2129,7 +2129,8 @@ static int do_write_image_or_movie(Render *re, Main *bmain, Scene *scene, bMovie dofree = 1; } - ok= mh->append_movie(&re->r, scene->r.cfra, (int *)rect32, rres.rectx, rres.recty, re->reports); + ok= mh->append_movie(&re->r, scene->r.sfra, scene->r.cfra, (int *)rect32, + rres.rectx, rres.recty, re->reports); if(dofree) { MEM_freeN(rect32); } diff --git a/source/blender/render/intern/source/shadeoutput.c b/source/blender/render/intern/source/shadeoutput.c index a9f851abd0b..619a16ae6b5 100644 --- a/source/blender/render/intern/source/shadeoutput.c +++ b/source/blender/render/intern/source/shadeoutput.c @@ -900,7 +900,7 @@ static void ramp_diffuse_result(float *diff, ShadeInput *shi) if(ma->ramp_col) { if(ma->rampin_col==MA_RAMP_IN_RESULT) { - float fac= 0.3f*diff[0] + 0.58f*diff[1] + 0.12f*diff[2]; + float fac = rgb_to_grayscale(diff); do_colorband(ma->ramp_col, fac, col); /* blending method */ @@ -932,6 +932,7 @@ static void add_to_diffuse(float *diff, ShadeInput *shi, float is, float r, floa /* input */ switch(ma->rampin_col) { case MA_RAMP_IN_ENERGY: + /* should use 'rgb_to_grayscale' but we only have a vector version */ fac= 0.3f*r + 0.58f*g + 0.12f*b; break; case MA_RAMP_IN_SHADER: @@ -974,7 +975,7 @@ static void ramp_spec_result(float spec_col[3], ShadeInput *shi) if(ma->ramp_spec && (ma->rampin_spec==MA_RAMP_IN_RESULT)) { float col[4]; - float fac= 0.3f*spec_col[0] + 0.58f*spec_col[1] + 0.12f*spec_col[2]; + float fac = rgb_to_grayscale(spec_col); do_colorband(ma->ramp_spec, fac, col); diff --git a/source/blender/render/intern/source/zbuf.c b/source/blender/render/intern/source/zbuf.c index c77a1309743..a46b3791693 100644 --- a/source/blender/render/intern/source/zbuf.c +++ b/source/blender/render/intern/source/zbuf.c @@ -1036,6 +1036,9 @@ void zbufsinglewire(ZSpan *zspan, int obi, int zvlnr, const float ho1[4], const * @param v2 [4 floats, world coordinates] second vertex * @param v3 [4 floats, world coordinates] third vertex */ + +/* WATCH IT: zbuffillGLinv4 and zbuffillGL4 are identical except for a 2 lines, + * commented below */ static void zbuffillGLinv4(ZSpan *zspan, int obi, int zvlnr, float *v1, float *v2, float *v3, float *v4) { double zxd, zyd, zy0, zverg; @@ -1047,10 +1050,10 @@ static void zbuffillGLinv4(ZSpan *zspan, int obi, int zvlnr, float *v1, float *v int *rectmaskofs, *rm; int *rz, x, y; int sn1, sn2, rectx, *rectzofs, my0, my2; - + /* init */ zbuf_init_span(zspan); - + /* set spans */ zbuf_add_to_span(zspan, v1, v2); zbuf_add_to_span(zspan, v2, v3); @@ -1058,19 +1061,19 @@ static void zbuffillGLinv4(ZSpan *zspan, int obi, int zvlnr, float *v1, float *v zbuf_add_to_span(zspan, v3, v4); zbuf_add_to_span(zspan, v4, v1); } - else + else zbuf_add_to_span(zspan, v3, v1); - + /* clipped */ if(zspan->minp2==NULL || zspan->maxp2==NULL) return; - + if(zspan->miny1 < zspan->miny2) my0= zspan->miny2; else my0= zspan->miny1; if(zspan->maxy1 > zspan->maxy2) my2= zspan->maxy2; else my2= zspan->maxy1; - + // printf("my %d %d\n", my0, my2); if(my2<my0) return; - - + + /* ZBUF DX DY, in floats still */ x1= v1[0]- v2[0]; x2= v2[0]- v3[0]; @@ -1081,22 +1084,22 @@ static void zbuffillGLinv4(ZSpan *zspan, int obi, int zvlnr, float *v1, float *v x0= y1*z2-z1*y2; y0= z1*x2-x1*z2; z0= x1*y2-y1*x2; - + if(z0==0.0f) return; - + xx1= (x0*v1[0] + y0*v1[1])/z0 + v1[2]; - + zxd= -(double)x0/(double)z0; zyd= -(double)y0/(double)z0; zy0= ((double)my2)*zyd + (double)xx1; - + /* start-offset in rect */ rectx= zspan->rectx; rectzofs= (zspan->rectz+rectx*my2); rectpofs= (zspan->rectp+rectx*my2); rectoofs= (zspan->recto+rectx*my2); rectmaskofs= (zspan->rectmask+rectx*my2); - + /* correct span */ sn1= (my0 + my2)/2; if(zspan->span1[sn1] < zspan->span2[sn1]) { @@ -1107,45 +1110,45 @@ static void zbuffillGLinv4(ZSpan *zspan, int obi, int zvlnr, float *v1, float *v span1= zspan->span2+my2; span2= zspan->span1+my2; } - + for(y=my2; y>=my0; y--, span1--, span2--) { - + sn1= floor(*span1); sn2= floor(*span2); - sn1++; - + sn1++; + if(sn2>=rectx) sn2= rectx-1; if(sn1<0) sn1= 0; - + if(sn2>=sn1) { int intzverg; - + zverg= (double)sn1*zxd + zy0; rz= rectzofs+sn1; rp= rectpofs+sn1; ro= rectoofs+sn1; rm= rectmaskofs+sn1; x= sn2-sn1; - + while(x>=0) { intzverg= (int)CLAMPIS(zverg, INT_MIN, INT_MAX); - if( intzverg > *rz || *rz==0x7FFFFFFF) { + if( intzverg > *rz || *rz==0x7FFFFFFF) { /* UNIQUE LINE: see comment above */ if(!zspan->rectmask || intzverg > *rm) { - *ro= obi; + *ro= obi; /* UNIQUE LINE: see comment above (order differs) */ *rz= intzverg; *rp= zvlnr; } } zverg+= zxd; - rz++; - rp++; + rz++; + rp++; ro++; rm++; x--; } } - + zy0-=zyd; rectzofs-= rectx; rectpofs-= rectx; @@ -1156,6 +1159,8 @@ static void zbuffillGLinv4(ZSpan *zspan, int obi, int zvlnr, float *v1, float *v /* uses spanbuffers */ +/* WATCH IT: zbuffillGLinv4 and zbuffillGL4 are identical except for a 2 lines, + * commented below */ static void zbuffillGL4(ZSpan *zspan, int obi, int zvlnr, float *v1, float *v2, float *v3, float *v4) { double zxd, zyd, zy0, zverg; @@ -1167,10 +1172,10 @@ static void zbuffillGL4(ZSpan *zspan, int obi, int zvlnr, float *v1, float *v2, int *rectmaskofs, *rm; int *rz, x, y; int sn1, sn2, rectx, *rectzofs, my0, my2; - + /* init */ zbuf_init_span(zspan); - + /* set spans */ zbuf_add_to_span(zspan, v1, v2); zbuf_add_to_span(zspan, v2, v3); @@ -1178,19 +1183,19 @@ static void zbuffillGL4(ZSpan *zspan, int obi, int zvlnr, float *v1, float *v2, zbuf_add_to_span(zspan, v3, v4); zbuf_add_to_span(zspan, v4, v1); } - else + else zbuf_add_to_span(zspan, v3, v1); - + /* clipped */ if(zspan->minp2==NULL || zspan->maxp2==NULL) return; - + if(zspan->miny1 < zspan->miny2) my0= zspan->miny2; else my0= zspan->miny1; if(zspan->maxy1 > zspan->maxy2) my2= zspan->maxy2; else my2= zspan->maxy1; - -// printf("my %d %d\n", my0, my2); + + // printf("my %d %d\n", my0, my2); if(my2<my0) return; - - + + /* ZBUF DX DY, in floats still */ x1= v1[0]- v2[0]; x2= v2[0]- v3[0]; @@ -1201,7 +1206,7 @@ static void zbuffillGL4(ZSpan *zspan, int obi, int zvlnr, float *v1, float *v2, x0= y1*z2-z1*y2; y0= z1*x2-x1*z2; z0= x1*y2-y1*x2; - + if(z0==0.0f) return; xx1= (x0*v1[0] + y0*v1[1])/z0 + v1[2]; @@ -1227,45 +1232,45 @@ static void zbuffillGL4(ZSpan *zspan, int obi, int zvlnr, float *v1, float *v2, span1= zspan->span2+my2; span2= zspan->span1+my2; } - + for(y=my2; y>=my0; y--, span1--, span2--) { - + sn1= floor(*span1); sn2= floor(*span2); - sn1++; - + sn1++; + if(sn2>=rectx) sn2= rectx-1; if(sn1<0) sn1= 0; - + if(sn2>=sn1) { int intzverg; - + zverg= (double)sn1*zxd + zy0; rz= rectzofs+sn1; rp= rectpofs+sn1; ro= rectoofs+sn1; rm= rectmaskofs+sn1; x= sn2-sn1; - + while(x>=0) { intzverg= (int)CLAMPIS(zverg, INT_MIN, INT_MAX); - - if(intzverg < *rz) { + + if(intzverg < *rz) { /* ONLY UNIQUE LINE: see comment above */ if(!zspan->rectmask || intzverg > *rm) { *rz= intzverg; *rp= zvlnr; - *ro= obi; + *ro= obi; /* UNIQUE LINE: see comment above (order differs) */ } } zverg+= zxd; - rz++; - rp++; - ro++; + rz++; + rp++; + ro++; rm++; x--; } } - + zy0-=zyd; rectzofs-= rectx; rectpofs-= rectx; diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h index 61c3da36203..11ac56090a3 100644 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@ -199,6 +199,7 @@ int WM_operator_call_py(struct bContext *C, struct wmOperatorType *ot, int con void WM_operator_properties_alloc(struct PointerRNA **ptr, struct IDProperty **properties, const char *opstring); /* used for keymap and macro items */ void WM_operator_properties_sanitize(struct PointerRNA *ptr, const short no_context); /* make props context sensitive or not */ +void WM_operator_properties_reset(struct wmOperator *op); void WM_operator_properties_create(struct PointerRNA *ptr, const char *opstring); void WM_operator_properties_create_ptr(struct PointerRNA *ptr, struct wmOperatorType *ot); void WM_operator_properties_free(struct PointerRNA *ptr); diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 43ed2b3b2b9..079833f693f 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -282,7 +282,7 @@ void wm_event_do_notifiers(bContext *C) /* combine datamasks so 1 win doesn't disable UV's in another [#26448] */ for(win= wm->windows.first; win; win= win->next) { - win_combine_v3d_datamask |= ED_viewedit_datamask(win->screen); + win_combine_v3d_datamask |= ED_view3d_screen_datamask(win->screen); } /* cached: editor refresh callbacks now, they get context */ @@ -729,6 +729,47 @@ static void wm_region_mouse_co(bContext *C, wmEvent *event) } } +static int wm_operator_init_from_last(wmWindowManager *wm, wmOperator *op) +{ + int change= FALSE; + wmOperator *lastop; + + for(lastop= wm->operators.last; lastop; lastop= lastop->prev) { + /* equality check is a bit paranoid but just incase */ + if((op != lastop) && (op->type == (lastop->type))) { + break; + } + } + + if (lastop && op != lastop) { + PropertyRNA *iterprop; + iterprop= RNA_struct_iterator_property(op->type->srna); + + RNA_PROP_BEGIN(op->ptr, itemptr, iterprop) { + PropertyRNA *prop= itemptr.data; + if((RNA_property_flag(prop) & PROP_SKIP_SAVE) == 0) { + if (!RNA_property_is_set(op->ptr, prop)) { /* don't override a setting already set */ + const char *identifier= RNA_property_identifier(prop); + IDProperty *idp_src= IDP_GetPropertyFromGroup(lastop->properties, identifier); + if(idp_src) { + IDProperty *idp_dst = IDP_CopyProperty(idp_src); + + /* note - in the future this may need to be done recursively, + * but for now RNA doesn't access nested operators */ + idp_dst->flag |= IDP_FLAG_GHOST; + + IDP_ReplaceInGroup(op->properties, idp_dst); + change= TRUE; + } + } + } + } + RNA_PROP_END; + } + + return change; +} + static int wm_operator_invoke(bContext *C, wmOperatorType *ot, wmEvent *event, PointerRNA *properties, ReportList *reports, short poll_only) { wmWindowManager *wm= CTX_wm_manager(C); @@ -741,6 +782,11 @@ static int wm_operator_invoke(bContext *C, wmOperatorType *ot, wmEvent *event, P if(WM_operator_poll(C, ot)) { wmOperator *op= wm_operator_create(wm, ot, properties, reports); /* if reports==NULL, theyll be initialized */ + /* initialize setting from previous run */ + if(wm->op_undo_depth == 0 && (ot->flag & OPTYPE_REGISTER)) { /* not called by py script */ + wm_operator_init_from_last(wm, op); + } + 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); diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c index 2695f3d680d..e36d9c0b0ab 100644 --- a/source/blender/windowmanager/intern/wm_init_exit.c +++ b/source/blender/windowmanager/intern/wm_init_exit.c @@ -60,6 +60,7 @@ #include "BKE_packedFile.h" #include "BKE_sequencer.h" /* free seq clipboard */ #include "BKE_material.h" /* clear_matcopybuf */ +#include "BKE_tracking.h" /* free tracking clipboard */ #include "BLI_listbase.h" #include "BLI_string.h" @@ -263,7 +264,7 @@ int WM_init_game(bContext *C) } /* Fullscreen */ - if(scene->gm.fullscreen) { + if((scene->gm.playerflag & GAME_PLAYER_FULLSCREEN)) { WM_operator_name_call(C, "WM_OT_window_fullscreen_toggle", WM_OP_EXEC_DEFAULT, NULL); wm_get_screensize(&ar->winrct.xmax, &ar->winrct.ymax); ar->winx = ar->winrct.xmax + 1; @@ -375,6 +376,7 @@ void WM_exit_ext(bContext *C, const short do_python) wm_free_reports(C); /* before free_blender! - since the ListBases get freed there */ seq_free_clipboard(); /* sequencer.c */ + BKE_tracking_free_clipboard(); free_blender(); /* blender.c, does entire library and spacetypes */ // free_matcopybuf(); diff --git a/source/blender/windowmanager/intern/wm_jobs.c b/source/blender/windowmanager/intern/wm_jobs.c index 2d0d0f92a44..f2ee5a328d6 100644 --- a/source/blender/windowmanager/intern/wm_jobs.c +++ b/source/blender/windowmanager/intern/wm_jobs.c @@ -491,6 +491,13 @@ void wm_jobs_timer(const bContext *C, wmWindowManager *wm, wmTimer *wt) WM_jobs_start(wm, steve); } } + else if(steve->threads.first && !steve->ready) { + if(steve->flag & WM_JOB_PROGRESS) { + /* accumulate global progress for running jobs */ + jobs_progress++; + total_progress += steve->progress; + } + } } /* on file load 'winactive' can be NULL, possibly it should not happen but for now do a NULL check - campbell */ diff --git a/source/blender/windowmanager/intern/wm_keymap.c b/source/blender/windowmanager/intern/wm_keymap.c index c75395456dd..24af3ffedc1 100644 --- a/source/blender/windowmanager/intern/wm_keymap.c +++ b/source/blender/windowmanager/intern/wm_keymap.c @@ -981,6 +981,8 @@ void WM_keyconfig_update(wmWindowManager *wm) wmKeyMapDiffItem *kmdi; int compat_update = 0; + if(G.background) + return; if(!WM_KEYMAP_UPDATE) return; diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 2ab876b2165..edd822bd2da 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -638,6 +638,25 @@ void WM_operator_properties_sanitize(PointerRNA *ptr, const short no_context) RNA_STRUCT_END; } +/* remove all props without PROP_SKIP_SAVE */ +void WM_operator_properties_reset(wmOperator *op) +{ + if (op->ptr->data) { + PropertyRNA *iterprop; + iterprop= RNA_struct_iterator_property(op->type->srna); + + RNA_PROP_BEGIN(op->ptr, itemptr, iterprop) { + PropertyRNA *prop= itemptr.data; + + if((RNA_property_flag(prop) & PROP_SKIP_SAVE) == 0) { + const char *identifier = RNA_property_identifier(prop); + RNA_struct_idprops_unset(op->ptr, identifier); + } + } + RNA_PROP_END; + } +} + void WM_operator_properties_free(PointerRNA *ptr) { IDProperty *properties= ptr->data; @@ -665,7 +684,7 @@ int WM_menu_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) printf("%s: %s \"%s\" is not an enum property\n", __func__, op->type->idname, RNA_property_identifier(prop)); } - else if (RNA_property_is_set(op->ptr, RNA_property_identifier(prop))) { + else if (RNA_property_is_set(op->ptr, prop)) { const int retval= op->type->exec(C, op); OPERATOR_RETVAL_CHECK(retval); return retval; @@ -747,7 +766,7 @@ static uiBlock *wm_enum_search_menu(bContext *C, ARegion *ar, void *arg_op) uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_RET_1|UI_BLOCK_MOVEMOUSE_QUIT); //uiDefBut(block, LABEL, 0, op->type->name, 10, 10, 180, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, ""); // ok, this isnt so easy... - but= uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, 256, 10, 10, 9*UI_UNIT_X, UI_UNIT_Y, 0, 0, ""); + but= uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, sizeof(search), 10, 10, 9*UI_UNIT_X, UI_UNIT_Y, 0, 0, ""); uiButSetSearchFunc(but, operator_enum_search_cb, op->type, operator_enum_call_cb, NULL); /* fake button, it holds space for search items */ @@ -802,7 +821,7 @@ int WM_operator_confirm(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) /* op->invoke, opens fileselect if path property not set, otherwise executes */ int WM_operator_filesel(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { - if (RNA_property_is_set(op->ptr, "filepath")) { + if (RNA_struct_property_is_set(op->ptr, "filepath")) { return WM_operator_call_notest(C, op); /* call exec direct */ } else { @@ -939,7 +958,7 @@ static uiBlock *wm_block_create_redo(bContext *C, ARegion *ar, void *arg_op) int width= 300; - block= uiBeginBlock(C, ar, "redo_popup", UI_EMBOSS); + block= uiBeginBlock(C, ar, __func__, UI_EMBOSS); uiBlockClearFlag(block, UI_BLOCK_LOOP); uiBlockSetFlag(block, UI_BLOCK_KEEP_OPEN|UI_BLOCK_RET_1|UI_BLOCK_MOVEMOUSE_QUIT); @@ -1015,7 +1034,7 @@ static uiBlock *wm_block_dialog_create(bContext *C, ARegion *ar, void *userData) uiLayout *layout; uiStyle *style= UI_GetStyle(); - block = uiBeginBlock(C, ar, "operator dialog", UI_EMBOSS); + block = uiBeginBlock(C, ar, __func__, UI_EMBOSS); uiBlockClearFlag(block, UI_BLOCK_LOOP); uiBlockSetFlag(block, UI_BLOCK_KEEP_OPEN|UI_BLOCK_RET_1|UI_BLOCK_MOVEMOUSE_QUIT); @@ -1056,7 +1075,7 @@ static uiBlock *wm_operator_ui_create(bContext *C, ARegion *ar, void *userData) uiLayout *layout; uiStyle *style= UI_GetStyle(); - block= uiBeginBlock(C, ar, "opui_popup", UI_EMBOSS); + block= uiBeginBlock(C, ar, __func__, UI_EMBOSS); uiBlockClearFlag(block, UI_BLOCK_LOOP); uiBlockSetFlag(block, UI_BLOCK_KEEP_OPEN|UI_BLOCK_RET_1|UI_BLOCK_MOVEMOUSE_QUIT); @@ -1257,8 +1276,9 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(ar version_str = &version_buf[0]; revision_str = &revision_buf[0]; - sprintf(version_str, "%d.%02d.%d", BLENDER_VERSION/100, BLENDER_VERSION%100, BLENDER_SUBVERSION); - sprintf(revision_str, "r%s", build_rev); + BLI_snprintf(version_str, sizeof(version_str), + "%d.%02d.%d", BLENDER_VERSION/100, BLENDER_VERSION%100, BLENDER_SUBVERSION); + BLI_snprintf(revision_str, sizeof(revision_str), "r%s", build_rev); BLF_size(style->widgetlabel.uifont_id, style->widgetlabel.points, U.dpi); ver_width = (int)BLF_width(style->widgetlabel.uifont_id, version_str) + 5; @@ -1377,12 +1397,15 @@ static void operator_search_cb(const struct bContext *C, void *UNUSED(arg), cons int len= strlen(ot->name); /* display name for menu, can hold hotkey */ - BLI_strncpy(name, ot->name, 256); + BLI_strncpy(name, ot->name, sizeof(name)); /* check for hotkey */ - if(len < 256-6) { - if(WM_key_event_operator_string(C, ot->idname, WM_OP_EXEC_DEFAULT, NULL, TRUE, &name[len+1], 256-len-1)) + if (len < sizeof(name) - 6) { + if (WM_key_event_operator_string(C, ot->idname, WM_OP_EXEC_DEFAULT, NULL, TRUE, + &name[len+1], sizeof(name)-len-1)) + { name[len]= '|'; + } } if(0==uiSearchItemAdd(items, name, ot, 0)) @@ -1404,7 +1427,7 @@ static uiBlock *wm_block_search_menu(bContext *C, ARegion *ar, void *UNUSED(arg_ block= uiBeginBlock(C, ar, "_popup", UI_EMBOSS); uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_RET_1|UI_BLOCK_MOVEMOUSE_QUIT); - but= uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, 256, 10, 10, 9*UI_UNIT_X, UI_UNIT_Y, 0, 0, ""); + but= uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, sizeof(search), 10, 10, 9*UI_UNIT_X, UI_UNIT_Y, 0, 0, ""); uiButSetSearchFunc(but, operator_search_cb, NULL, operator_call_cb, NULL); /* fake button, it holds space for search items */ @@ -1549,13 +1572,13 @@ static void WM_OT_read_factory_settings(wmOperatorType *ot) static void open_set_load_ui(wmOperator *op) { - if(!RNA_property_is_set(op->ptr, "load_ui")) + if(!RNA_struct_property_is_set(op->ptr, "load_ui")) RNA_boolean_set(op->ptr, "load_ui", !(U.flag & USER_FILENOUI)); } static void open_set_use_scripts(wmOperator *op) { - if(!RNA_property_is_set(op->ptr, "use_scripts")) { + if(!RNA_struct_property_is_set(op->ptr, "use_scripts")) { /* use G_SCRIPT_AUTOEXEC rather than the userpref because this means if * the flag has been disabled from the command line, then opening * from the menu wont enable this setting. */ @@ -1653,7 +1676,7 @@ int wm_link_append_poll(bContext *C) static int wm_link_append_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { - if(RNA_property_is_set(op->ptr, "filepath")) { + if(RNA_struct_property_is_set(op->ptr, "filepath")) { return WM_operator_call_notest(C, op); } else { @@ -1917,7 +1940,7 @@ static void untitled(char *name) static void save_set_compress(wmOperator *op) { - if(!RNA_property_is_set(op->ptr, "compress")) { + if(!RNA_struct_property_is_set(op->ptr, "compress")) { if(G.save_over) /* keep flag for existing file */ RNA_boolean_set(op->ptr, "compress", G.fileflags & G_FILE_COMPRESS); else /* use userdef for new file */ @@ -1956,14 +1979,14 @@ static int wm_save_as_mainfile_exec(bContext *C, wmOperator *op) save_set_compress(op); - if(RNA_property_is_set(op->ptr, "filepath")) + if(RNA_struct_property_is_set(op->ptr, "filepath")) RNA_string_get(op->ptr, "filepath", path); else { BLI_strncpy(path, G.main->name, FILE_MAX); untitled(path); } - if(RNA_property_is_set(op->ptr, "copy")) + if(RNA_struct_property_is_set(op->ptr, "copy")) copy = RNA_boolean_get(op->ptr, "copy"); fileflags= G.fileflags; @@ -2091,7 +2114,7 @@ static void WM_OT_save_mainfile(wmOperatorType *ot) static int wm_collada_export_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { - if(!RNA_property_is_set(op->ptr, "filepath")) { + if(!RNA_struct_property_is_set(op->ptr, "filepath")) { char filepath[FILE_MAX]; BLI_strncpy(filepath, G.main->name, sizeof(filepath)); BLI_replace_extension(filepath, sizeof(filepath), ".dae"); @@ -2109,7 +2132,7 @@ static int wm_collada_export_exec(bContext *C, wmOperator *op) char filename[FILE_MAX]; int selected; - if(!RNA_property_is_set(op->ptr, "filepath")) { + if(!RNA_struct_property_is_set(op->ptr, "filepath")) { BKE_report(op->reports, RPT_ERROR, "No filename given"); return OPERATOR_CANCELLED; } @@ -2143,7 +2166,7 @@ static int wm_collada_import_exec(bContext *C, wmOperator *op) { char filename[FILE_MAX]; - if(!RNA_property_is_set(op->ptr, "filepath")) { + if(!RNA_struct_property_is_set(op->ptr, "filepath")) { BKE_report(op->reports, RPT_ERROR, "No filename given"); return OPERATOR_CANCELLED; } @@ -3060,23 +3083,35 @@ static void radial_control_paint_cursor(bContext *C, int x, int y, void *customd glDisable(GL_LINE_SMOOTH); } +typedef enum { + RC_PROP_ALLOW_MISSING = 1, + RC_PROP_REQUIRE_FLOAT = 2, + RC_PROP_REQUIRE_BOOL = 4, +} RCPropFlags; + /* attempt to retrieve the rna pointer/property from an rna path; returns 0 for failure, 1 for success, and also 1 if property is not set */ static int radial_control_get_path(PointerRNA *ctx_ptr, wmOperator *op, const char *name, PointerRNA *r_ptr, - PropertyRNA **r_prop, int req_float, - int req_length, int allow_missing) + PropertyRNA **r_prop, int req_length, RCPropFlags flags) { PropertyRNA *unused_prop; int len; char *str; + /* check flags */ + if((flags & RC_PROP_REQUIRE_BOOL) && (flags & RC_PROP_REQUIRE_FLOAT)) { + BKE_reportf(op->reports, RPT_ERROR, "Property can't be both boolean and float"); + return 0; + } + /* get an rna string path from the operator's properties */ if(!(str = RNA_string_get_alloc(op->ptr, name, NULL, 0))) return 1; if(str[0] == '\0') { + if(r_prop) *r_prop = NULL; MEM_freeN(str); return 1; } @@ -3087,7 +3122,7 @@ static int radial_control_get_path(PointerRNA *ctx_ptr, wmOperator *op, /* get rna from path */ if(!RNA_path_resolve(ctx_ptr, str, r_ptr, r_prop)) { MEM_freeN(str); - if(allow_missing) + if(flags & RC_PROP_ALLOW_MISSING) return 1; else { BKE_reportf(op->reports, RPT_ERROR, "Couldn't resolve path %s", name); @@ -3095,9 +3130,12 @@ static int radial_control_get_path(PointerRNA *ctx_ptr, wmOperator *op, } } - /* if property is expected to be a float, check its type */ - if(req_float) { - if(!(*r_prop) || (RNA_property_type(*r_prop) != PROP_FLOAT)) { + /* check property type */ + if(flags & (RC_PROP_REQUIRE_BOOL | RC_PROP_REQUIRE_FLOAT)) { + PropertyType prop_type = RNA_property_type(*r_prop); + + if(((flags & RC_PROP_REQUIRE_BOOL) && (prop_type != PROP_BOOLEAN)) || + ((flags & RC_PROP_REQUIRE_FLOAT) && prop_type != PROP_FLOAT)) { MEM_freeN(str); BKE_reportf(op->reports, RPT_ERROR, "Property from path %s is not a float", name); @@ -3123,31 +3161,50 @@ static int radial_control_get_path(PointerRNA *ctx_ptr, wmOperator *op, static int radial_control_get_properties(bContext *C, wmOperator *op) { RadialControl *rc = op->customdata; - PointerRNA ctx_ptr; + PointerRNA ctx_ptr, use_secondary_ptr; + PropertyRNA *use_secondary_prop; + const char *data_path; RNA_pointer_create(NULL, &RNA_Context, C, &ctx_ptr); - if(!radial_control_get_path(&ctx_ptr, op, "data_path", &rc->ptr, &rc->prop, 0, 0, 0)) + /* check if we use primary or secondary path */ + if(!radial_control_get_path(&ctx_ptr, op, "use_secondary", + &use_secondary_ptr, &use_secondary_prop, + 0, (RC_PROP_ALLOW_MISSING| + RC_PROP_REQUIRE_BOOL))) { + return 0; + } + else { + if(use_secondary_prop && + RNA_property_boolean_get(&use_secondary_ptr, use_secondary_prop)) + data_path = "data_path_secondary"; + else + data_path = "data_path_primary"; + } + + if(!radial_control_get_path(&ctx_ptr, op, data_path, &rc->ptr, &rc->prop, 0, 0)) return 0; /* data path is required */ if(!rc->prop) return 0; - if(!radial_control_get_path(&ctx_ptr, op, "rotation_path", &rc->rot_ptr, &rc->rot_prop, 1, 0, 0)) + if(!radial_control_get_path(&ctx_ptr, op, "rotation_path", &rc->rot_ptr, &rc->rot_prop, 0, RC_PROP_REQUIRE_FLOAT)) return 0; - if(!radial_control_get_path(&ctx_ptr, op, "color_path", &rc->col_ptr, &rc->col_prop, 1, 3, 0)) + if(!radial_control_get_path(&ctx_ptr, op, "color_path", &rc->col_ptr, &rc->col_prop, 3, RC_PROP_REQUIRE_FLOAT)) return 0; - if(!radial_control_get_path(&ctx_ptr, op, "fill_color_path", &rc->fill_col_ptr, &rc->fill_col_prop, 1, 3, 0)) + if(!radial_control_get_path(&ctx_ptr, op, "fill_color_path", &rc->fill_col_ptr, &rc->fill_col_prop, 3, RC_PROP_REQUIRE_FLOAT)) return 0; /* slightly ugly; allow this property to not resolve correctly. needed because 3d texture paint shares the same keymap as 2d image paint */ - if(!radial_control_get_path(&ctx_ptr, op, "zoom_path", &rc->zoom_ptr, &rc->zoom_prop, 1, 2, 1)) + if(!radial_control_get_path(&ctx_ptr, op, "zoom_path", + &rc->zoom_ptr, &rc->zoom_prop, 2, + RC_PROP_REQUIRE_FLOAT|RC_PROP_ALLOW_MISSING)) return 0; - if(!radial_control_get_path(&ctx_ptr, op, "image_id", &rc->image_id_ptr, NULL, 0, 0, 0)) + if(!radial_control_get_path(&ctx_ptr, op, "image_id", &rc->image_id_ptr, NULL, 0, 0)) return 0; else if(rc->image_id_ptr.data) { /* extra check, pointer must be to an ID */ @@ -3340,7 +3397,9 @@ static void WM_OT_radial_control(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; /* all paths relative to the context */ - RNA_def_string(ot->srna, "data_path", "", 0, "Data Path", "Path of property to be set by the radial control"); + RNA_def_string(ot->srna, "data_path_primary", "", 0, "Primary Data Path", "Primary path of property to be set by the radial control"); + RNA_def_string(ot->srna, "data_path_secondary", "", 0, "Secondary Data Path", "Secondary path of property to be set by the radial control"); + RNA_def_string(ot->srna, "use_secondary", "", 0, "Use Secondary", "Path of property to select between the primary and secondary data paths"); RNA_def_string(ot->srna, "rotation_path", "", 0, "Rotation Path", "Path of property used to rotate the texture display"); RNA_def_string(ot->srna, "color_path", "", 0, "Color Path", "Path of property used to set the color of the control"); RNA_def_string(ot->srna, "fill_color_path", "", 0, "Fill Color Path", "Path of property used to set the fill color of the control"); |