diff options
-rw-r--r-- | release/scripts/startup/bl_ui/space_image.py | 5 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_view3d_toolbar.py | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/BKE_blender.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/brush.c | 1 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/texture.c | 1 | ||||
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 9 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_image_2d.c | 4 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_brush_types.h | 12 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_brush.c | 5 |
9 files changed, 23 insertions, 18 deletions
diff --git a/release/scripts/startup/bl_ui/space_image.py b/release/scripts/startup/bl_ui/space_image.py index 1ea20d96386..cfedc5e1e00 100644 --- a/release/scripts/startup/bl_ui/space_image.py +++ b/release/scripts/startup/bl_ui/space_image.py @@ -20,7 +20,7 @@ import bpy from bpy.types import Header, Menu, Panel from bl_ui.properties_paint_common import UnifiedPaintPanel - +from bl_ui.properties_paint_common import brush_texture_settings class ImagePaintPanel(UnifiedPaintPanel): bl_space_type = 'IMAGE_EDITOR' @@ -722,7 +722,8 @@ class IMAGE_PT_tools_brush_texture(BrushButtonsPanel, Panel): col = layout.column() col.template_ID_preview(brush, "texture", new="texture.new", rows=3, cols=8) - col.prop(brush, "use_fixed_texture") + + brush_texture_settings(col, brush, 0) class IMAGE_PT_tools_brush_tool(BrushButtonsPanel, Panel): diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py index 579171970fa..1653e8fab7e 100644 --- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py +++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py @@ -720,8 +720,6 @@ class VIEW3D_PT_tools_brush_texture(Panel, View3DPaintPanel): col = layout.column() col.template_ID_preview(brush, "texture", new="texture.new", rows=3, cols=8) - if brush.use_paint_image: - col.prop(brush, "use_fixed_texture") brush_texture_settings(col, brush, context.sculpt_object) diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h index 9c6d26c08bc..2d596faabce 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 265 -#define BLENDER_SUBVERSION 8 +#define BLENDER_SUBVERSION 9 /* 262 was the last editmesh release but it has compatibility code for bmesh data */ #define BLENDER_MINVERSION 262 diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c index aeb0407b37f..e8275471b09 100644 --- a/source/blender/blenkernel/intern/brush.c +++ b/source/blender/blenkernel/intern/brush.c @@ -259,7 +259,6 @@ void BKE_brush_debug_print_state(Brush *br) BR_TEST_FLAG(BRUSH_SIZE_PRESSURE); BR_TEST_FLAG(BRUSH_JITTER_PRESSURE); BR_TEST_FLAG(BRUSH_SPACING_PRESSURE); - BR_TEST_FLAG(BRUSH_FIXED_TEX); BR_TEST_FLAG(BRUSH_RAKE); BR_TEST_FLAG(BRUSH_ANCHORED); BR_TEST_FLAG(BRUSH_DIR_IN); diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c index fbaf6f70fbc..2e909f11eaa 100644 --- a/source/blender/blenkernel/intern/texture.c +++ b/source/blender/blenkernel/intern/texture.c @@ -615,6 +615,7 @@ void default_mtex(MTex *mtex) mtex->gravityfac = 1.0f; mtex->fieldfac = 1.0f; mtex->normapspace = MTEX_NSPACE_TANGENT; + mtex->brush_map_mode = MTEX_MAP_MODE_TILED; } diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 029e16969db..09c90f6acb2 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -8663,6 +8663,15 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } } + if (!MAIN_VERSION_ATLEAST(main, 265, 9)) { + Brush *br; + for (br = main->brush.first; br; br = br->id.next) { + if (br->ob_mode & OB_MODE_TEXTURE_PAINT) { + br->mtex.brush_map_mode = MTEX_MAP_MODE_TILED; + } + } + } + // if (main->versionfile < 265 || (main->versionfile == 265 && main->subversionfile < 7)) { /* WATCH IT!!!: pointers from libdata have not been converted yet here! */ diff --git a/source/blender/editors/sculpt_paint/paint_image_2d.c b/source/blender/editors/sculpt_paint/paint_image_2d.c index dd7412cf3d5..9965727ed79 100644 --- a/source/blender/editors/sculpt_paint/paint_image_2d.c +++ b/source/blender/editors/sculpt_paint/paint_image_2d.c @@ -331,7 +331,7 @@ static void brush_painter_refresh_cache(BrushPainter *painter, const float pos[2 flt = cache->flt; size = (cache->size) ? cache->size : diameter; - if (brush->flag & BRUSH_FIXED_TEX) { + if (brush->mtex.brush_map_mode == MTEX_MAP_MODE_TILED) { BKE_brush_imbuf_new(scene, brush, flt, 3, size, &cache->maskibuf, use_color_correction); brush_painter_fixed_tex_partial_update(painter, pos); } @@ -342,7 +342,7 @@ static void brush_painter_refresh_cache(BrushPainter *painter, const float pos[2 cache->lastalpha = alpha; cache->lastjitter = brush->jitter; } - else if ((brush->flag & BRUSH_FIXED_TEX) && mtex && mtex->tex) { + else if ((brush->mtex.brush_map_mode == MTEX_MAP_MODE_TILED) && mtex && mtex->tex) { int dx = (int)painter->lastpaintpos[0] - (int)pos[0]; int dy = (int)painter->lastpaintpos[1] - (int)pos[1]; diff --git a/source/blender/makesdna/DNA_brush_types.h b/source/blender/makesdna/DNA_brush_types.h index e3571c767bd..e935592ecfb 100644 --- a/source/blender/makesdna/DNA_brush_types.h +++ b/source/blender/makesdna/DNA_brush_types.h @@ -112,7 +112,7 @@ typedef enum BrushFlags { BRUSH_SIZE_PRESSURE = (1 << 3), BRUSH_JITTER_PRESSURE = (1 << 4), BRUSH_SPACING_PRESSURE = (1 << 5), - BRUSH_FIXED_TEX = (1 << 6), + BRUSH_FIXED_TEX = (1 << 6), /* obsolete, use mtex->brush_map_mode = MTEX_MAP_MODE_TILED instead */ BRUSH_RAKE = (1 << 7), BRUSH_ANCHORED = (1 << 8), BRUSH_DIR_IN = (1 << 9), @@ -164,10 +164,12 @@ typedef enum BrushSculptTool { } BrushSculptTool; /* ImagePaintSettings.tool */ -#define PAINT_TOOL_DRAW 0 -#define PAINT_TOOL_SOFTEN 1 -#define PAINT_TOOL_SMEAR 2 -#define PAINT_TOOL_CLONE 3 +typedef enum BrushImagePaintTool{ + PAINT_TOOL_DRAW = 0, + PAINT_TOOL_SOFTEN = 1, + PAINT_TOOL_SMEAR = 2, + PAINT_TOOL_CLONE = 3 +} BrushImagePaintTool; /* direction that the brush displaces along */ enum { diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c index 2eb656878ae..f17ee48a87c 100644 --- a/source/blender/makesrna/intern/rna_brush.c +++ b/source/blender/makesrna/intern/rna_brush.c @@ -867,11 +867,6 @@ static void rna_def_brush(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_RESTORE_MESH); RNA_def_property_ui_text(prop, "Restore Mesh", "Allow a single dot to be carefully positioned"); RNA_def_property_update(prop, 0, "rna_Brush_update"); - - prop = RNA_def_property(srna, "use_fixed_texture", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_FIXED_TEX); - RNA_def_property_ui_text(prop, "Fixed Texture", "Keep texture origin in fixed position"); - RNA_def_property_update(prop, 0, "rna_Brush_update"); /* only for projection paint, TODO, other paint modes */ prop = RNA_def_property(srna, "use_alpha", PROP_BOOLEAN, PROP_NONE); |