[Bf-blender-cvs] [4b5d02b] soc-2013-paint: Merge branch 'master' into soc-2013-paint
Antony Riakiotakis
noreply at git.blender.org
Wed Jul 9 23:24:08 CEST 2014
Commit: 4b5d02b7c4233d3e4129f4406aebe88dabf04d41
Author: Antony Riakiotakis
Date: Thu Jul 10 00:09:10 2014 +0300
https://developer.blender.org/rB4b5d02b7c4233d3e4129f4406aebe88dabf04d41
Merge branch 'master' into soc-2013-paint
Conflicts:
source/blender/blenkernel/BKE_blender.h
source/blender/blenloader/intern/versioning_270.c
source/blender/editors/sculpt_paint/paint_stroke.c
source/blender/editors/transform/transform.h
source/blender/makesdna/DNA_material_types.h
===================================================================
===================================================================
diff --cc source/blender/blenkernel/BKE_blender.h
index 593bc62,0af45a1..19fa60f
--- a/source/blender/blenkernel/BKE_blender.h
+++ b/source/blender/blenkernel/BKE_blender.h
@@@ -42,8 -42,7 +42,7 @@@ extern "C"
* and keep comment above the defines.
* Use STRINGIFY() rather than defining with quotes */
#define BLENDER_VERSION 271
--#define BLENDER_SUBVERSION 1
-
++#define BLENDER_SUBVERSION 2
/* 262 was the last editmesh release but it has compatibility code for bmesh data */
#define BLENDER_MINVERSION 270
#define BLENDER_MINSUBVERSION 5
diff --cc source/blender/blenloader/intern/versioning_270.c
index cfd9b87,103f9b7..23ec677
--- a/source/blender/blenloader/intern/versioning_270.c
+++ b/source/blender/blenloader/intern/versioning_270.c
@@@ -300,10 -300,20 +300,28 @@@ void blo_do_versions_270(FileData *fd,
}
if (!MAIN_VERSION_ATLEAST(main, 271, 1)) {
+ if (!DNA_struct_elem_find(fd->filesdna, "Material", "float", "line_col[4]")) {
+ Material *mat;
+
+ for (mat = main->mat.first; mat; mat = mat->id.next) {
+ mat->line_col[0] = mat->line_col[1] = mat->line_col[2] = 0.0f;
+ mat->line_col[3] = mat->alpha;
+ }
+ }
+ }
+
++ if (!MAIN_VERSION_ATLEAST(main, 271, 2)) {
+ Scene *sce;
+ for (sce = main->scene.first; sce; sce = sce->id.next) {
+ sce->toolsettings->imapaint.slot_xresolution_default = 1024;
+ sce->toolsettings->imapaint.slot_yresolution_default = 1024;
+ }
+ }
++
+ if (!DNA_struct_elem_find(fd->filesdna, "RenderData", "int", "preview_start_resolution")) {
+ Scene *scene;
+ for (scene = main->scene.first; scene; scene = scene->id.next) {
+ scene->r.preview_start_resolution = 64;
+ }
+ }
}
diff --cc source/blender/editors/include/UI_interface.h
index 05ac127,1565583..ad17ef4
--- a/source/blender/editors/include/UI_interface.h
+++ b/source/blender/editors/include/UI_interface.h
@@@ -850,9 -844,9 +850,10 @@@ void uiTemplateIconView(uiLayout *layou
void uiTemplateHistogram(uiLayout *layout, struct PointerRNA *ptr, const char *propname);
void uiTemplateWaveform(uiLayout *layout, struct PointerRNA *ptr, const char *propname);
void uiTemplateVectorscope(uiLayout *layout, struct PointerRNA *ptr, const char *propname);
- void uiTemplateCurveMapping(uiLayout *layout, struct PointerRNA *ptr, const char *propname, int type, int levels, int brush);
+ void uiTemplateCurveMapping(uiLayout *layout, struct PointerRNA *ptr, const char *propname, int type,
+ int levels, int brush, int neg_slope);
void uiTemplateColorPicker(uiLayout *layout, struct PointerRNA *ptr, const char *propname, int value_slider, int lock, int lock_luminosity, int cubic);
+void uiTemplatePalette(uiLayout *layout, struct PointerRNA *ptr, const char *propname, int color);
void uiTemplateLayers(uiLayout *layout, struct PointerRNA *ptr, const char *propname,
PointerRNA *used_ptr, const char *used_propname, int active_layer);
void uiTemplateGameStates(uiLayout *layout, struct PointerRNA *ptr, const char *propname,
diff --cc source/blender/editors/sculpt_paint/paint_stroke.c
index bc3f139,e87f8ca..1041144
--- a/source/blender/editors/sculpt_paint/paint_stroke.c
+++ b/source/blender/editors/sculpt_paint/paint_stroke.c
@@@ -211,20 -155,33 +211,38 @@@ static float event_tablet_data(const wm
return pressure;
}
+ static bool paint_tool_require_location(Brush *brush, PaintMode mode)
+ {
+ switch (mode) {
+ case PAINT_SCULPT:
+ if (ELEM4(brush->sculpt_tool, SCULPT_TOOL_GRAB, SCULPT_TOOL_ROTATE,
+ SCULPT_TOOL_SNAKE_HOOK, SCULPT_TOOL_THUMB))
+ {
+ return false;
+ }
+ else {
+ return true;
+ }
+ default:
+ break;
+ }
+
+ return true;
+ }
/* Initialize the stroke cache variants from operator properties */
-static void paint_brush_update(bContext *C, Brush *brush, PaintMode mode,
- struct PaintStroke *stroke,
- const float mouse[2], float pressure)
+static bool paint_brush_update(bContext *C,
+ Brush *brush,
+ PaintMode mode,
+ struct PaintStroke *stroke,
+ const float mouse_init[2],
+ float mouse[2], float pressure,
+ float location[3])
{
Scene *scene = CTX_data_scene(C);
- UnifiedPaintSettings *ups = &scene->toolsettings->unified_paint_settings;
-
+ UnifiedPaintSettings *ups = stroke->ups;
+ bool location_sampled = false;
+ bool location_success = false;
/* XXX: Use pressure value from first brush step for brushes which don't
* support strokes (grab, thumb). They depends on initial state and
* brush coord/pressure/etc.
@@@ -313,11 -272,12 +331,14 @@@
halfway[1] = dy * 0.5f + stroke->initial_mouse[1];
if (stroke->get_location) {
- if (stroke->get_location(C, out, halfway)) {
+ if (stroke->get_location(C, location, halfway)) {
hit = true;
+ location_sampled = true;
+ location_success = true;
}
+ else if (!paint_tool_require_location(brush, mode)) {
+ hit = true;
+ }
}
else {
hit = true;
@@@ -341,26 -295,8 +362,28 @@@
ups->draw_anchored = true;
}
else if (brush->flag & BRUSH_RAKE) {
- paint_calculate_rake_rotation(ups, mouse);
+ /* here we are using the initial mouse coordinate because we do not want the rake
+ * result to depend on jittering */
+ if (!stroke->brush_init)
+ copy_v2_v2(ups->last_rake, mouse_init);
+ else
+ paint_calculate_rake_rotation(ups, mouse_init);
}
+
+ if (!location_sampled) {
+ if (stroke->get_location) {
+ if (stroke->get_location(C, location, mouse))
+ location_success = true;
++ else if (!paint_tool_require_location(brush, mode))
++ location_success = true;
+ }
+ else {
+ zero_v3(location);
+ location_success = true;
+ }
+ }
+
+ return location_success;
}
diff --cc source/blender/editors/space_view3d/drawmesh.c
index 5df20ae,bf0b785..c34aefe
--- a/source/blender/editors/space_view3d/drawmesh.c
+++ b/source/blender/editors/space_view3d/drawmesh.c
@@@ -238,10 -236,13 +238,16 @@@ static bool set_draw_settings_cached(in
int lit = 0;
int has_texface = texface != NULL;
bool need_set_tpage = false;
+ bool texpaint = ((gtexdraw.ob->mode & OB_MODE_TEXTURE_PAINT) != 0);
+
+ Image *ima = NULL;
+ if (ma != NULL) {
+ if (ma->mode & MA_TRANSP) {
+ alphablend = GPU_BLEND_ALPHA;
+ }
+ }
+
if (clearcache) {
c_textured = c_lit = c_backculled = -1;
memset(&c_texface, 0, sizeof(MTFace));
diff --cc source/blender/editors/transform/transform.h
index 2fd625c,0bccf17..d3f2339
--- a/source/blender/editors/transform/transform.h
+++ b/source/blender/editors/transform/transform.h
@@@ -520,7 -532,7 +532,8 @@@ void flushTransNodes(TransInfo *t)
void flushTransSeq(TransInfo *t);
void flushTransTracking(TransInfo *t);
void flushTransMasking(TransInfo *t);
+void flushTransPaintCurve(TransInfo *t);
+ void restoreBones(TransInfo *t);
/*********************** exported from transform_manipulator.c ********** */
bool gimbal_axis(struct Object *ob, float gmat[3][3]); /* return 0 when no gimbal for selection */
diff --cc source/blender/makesdna/DNA_material_types.h
index 4c0903d,5fda38f..02d1103
--- a/source/blender/makesdna/DNA_material_types.h
+++ b/source/blender/makesdna/DNA_material_types.h
@@@ -184,14 -178,12 +184,19 @@@ typedef struct Material
short shadowonly_flag; /* "shadowsonly" type */
short index; /* custom index for render passes */
+ /* Freestyle line settings */
+ float line_col[4];
+ short line_priority;
short vcol_alpha;
- int pad4;
+ /* texture painting */
+ short paint_active_slot;
+ short paint_clone_slot;
+ short tot_slots;
++ short pad4[3];
++
+ struct TexPaintSlot *texpaintslot; /* cached slot for painting. Make sure to recalculate before use
+ * with refresh_texpaint_image_cache */
ListBase gpumaterial; /* runtime */
} Material;
More information about the Bf-blender-cvs
mailing list