From eb11b590a8d5c2152b0f811fc2240aba2e76f6de Mon Sep 17 00:00:00 2001 From: Antony Riakiotakis Date: Fri, 5 Apr 2013 16:34:27 +0000 Subject: Keep brush overlays below panels in triple buffer mode. --- source/blender/windowmanager/intern/wm_draw.c | 40 +++++++++++++-------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/source/blender/windowmanager/intern/wm_draw.c b/source/blender/windowmanager/intern/wm_draw.c index 1e3c2479e66..444f8cc57c8 100644 --- a/source/blender/windowmanager/intern/wm_draw.c +++ b/source/blender/windowmanager/intern/wm_draw.c @@ -628,6 +628,26 @@ static void wm_method_draw_triple(bContext *C, wmWindow *win) wm_triple_copy_textures(win, triple); } + if (paintcursor && wm->paintcursors.first) { + for (sa = screen->areabase.first; sa; sa = sa->next) { + for (ar = sa->regionbase.first; ar; ar = ar->next) { + if (ar->swinid && ar->swinid == screen->subwinactive) { + CTX_wm_area_set(C, sa); + CTX_wm_region_set(C, ar); + + /* make region ready for draw, scissor, pixelspace */ + ED_region_set(C, ar); + wm_paintcursor_draw(C, ar); + + CTX_wm_region_set(C, NULL); + CTX_wm_area_set(C, NULL); + } + } + } + + wmSubWindowSet(win, screen->mainwin); + } + /* draw overlapping area regions (always like popups) */ for (sa = screen->areabase.first; sa; sa = sa->next) { CTX_wm_area_set(C, sa); @@ -662,26 +682,6 @@ static void wm_method_draw_triple(bContext *C, wmWindow *win) /* always draw, not only when screen tagged */ if (win->gesture.first) wm_gesture_draw(win); - - if (paintcursor && wm->paintcursors.first) { - for (sa = screen->areabase.first; sa; sa = sa->next) { - for (ar = sa->regionbase.first; ar; ar = ar->next) { - if (ar->swinid && ar->swinid == screen->subwinactive) { - CTX_wm_area_set(C, sa); - CTX_wm_region_set(C, ar); - - /* make region ready for draw, scissor, pixelspace */ - ED_region_set(C, ar); - wm_paintcursor_draw(C, ar); - - CTX_wm_region_set(C, NULL); - CTX_wm_area_set(C, NULL); - } - } - } - - wmSubWindowSet(win, screen->mainwin); - } /* needs pixel coords in screen */ if (wm->drags.first) { -- cgit v1.2.3 From 3863e72c735af5a0fbf07cfe6d5f15dbc46d9850 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 5 Apr 2013 16:43:53 +0000 Subject: Fix #34679: cycles image texture alpha fringes. New rule is now that color output will not give straight RGB values if the alpha output is used, so that mixing with a transparent BSDF gives the correct result. --- intern/cycles/kernel/shaders/node_color.h | 8 ++++++ .../kernel/shaders/node_environment_texture.osl | 3 +++ .../cycles/kernel/shaders/node_image_texture.osl | 15 +++++++---- intern/cycles/kernel/svm/svm_image.h | 31 +++++++++++++++++----- 4 files changed, 45 insertions(+), 12 deletions(-) diff --git a/intern/cycles/kernel/shaders/node_color.h b/intern/cycles/kernel/shaders/node_color.h index 80786e4e369..c6b5d740f6a 100644 --- a/intern/cycles/kernel/shaders/node_color.h +++ b/intern/cycles/kernel/shaders/node_color.h @@ -48,6 +48,14 @@ color color_scene_linear_to_srgb(color c) color_scene_linear_to_srgb(c[2])); } +color color_unpremultiply(color c, float alpha) +{ + if(alpha != 1.0 && alpha != 0.0) + return c/alpha; + + return c; +} + /* Color Operations */ color rgb_to_hsv(color rgb) diff --git a/intern/cycles/kernel/shaders/node_environment_texture.osl b/intern/cycles/kernel/shaders/node_environment_texture.osl index 33b30a27ee1..36b2f755c20 100644 --- a/intern/cycles/kernel/shaders/node_environment_texture.osl +++ b/intern/cycles/kernel/shaders/node_environment_texture.osl @@ -66,6 +66,9 @@ shader node_environment_texture( /* todo: use environment for better texture filtering of equirectangular */ Color = (color)texture(filename, p[0], 1.0 - p[1], "wrap", "periodic", "alpha", Alpha); + if (isconnected(Alpha)) + Color = color_unpremultiply(Color, Alpha); + if (color_space == "sRGB") Color = color_srgb_to_scene_linear(Color); } diff --git a/intern/cycles/kernel/shaders/node_image_texture.osl b/intern/cycles/kernel/shaders/node_image_texture.osl index c94a3f7e76a..c7ec8726ae2 100644 --- a/intern/cycles/kernel/shaders/node_image_texture.osl +++ b/intern/cycles/kernel/shaders/node_image_texture.osl @@ -19,10 +19,13 @@ #include "stdosl.h" #include "node_color.h" -color image_texture_lookup(string filename, string color_space, float u, float v, output float Alpha) +color image_texture_lookup(string filename, string color_space, float u, float v, output float Alpha, int use_alpha) { color rgb = (color)texture(filename, u, 1.0 - v, "wrap", "periodic", "alpha", Alpha); + if (use_alpha) + rgb = color_unpremultiply(rgb, Alpha); + if (color_space == "sRGB") rgb = color_srgb_to_scene_linear(rgb); @@ -44,9 +47,11 @@ shader node_image_texture( if (use_mapping) p = transform(mapping, p); + + int use_alpha = isconnected(Alpha); if (projection == "Flat") { - Color = image_texture_lookup(filename, color_space, p[0], p[1], Alpha); + Color = image_texture_lookup(filename, color_space, p[0], p[1], Alpha, use_alpha); } else if (projection == "Box") { /* object space normal */ @@ -111,15 +116,15 @@ shader node_image_texture( float tmp_alpha; if (weight[0] > 0.0) { - Color += weight[0] * image_texture_lookup(filename, color_space, p[1], p[2], tmp_alpha); + Color += weight[0] * image_texture_lookup(filename, color_space, p[1], p[2], tmp_alpha, use_alpha); Alpha += weight[0] * tmp_alpha; } if (weight[1] > 0.0) { - Color += weight[1] * image_texture_lookup(filename, color_space, p[0], p[2], tmp_alpha); + Color += weight[1] * image_texture_lookup(filename, color_space, p[0], p[2], tmp_alpha, use_alpha); Alpha += weight[1] * tmp_alpha; } if (weight[2] > 0.0) { - Color += weight[2] * image_texture_lookup(filename, color_space, p[1], p[0], tmp_alpha); + Color += weight[2] * image_texture_lookup(filename, color_space, p[1], p[0], tmp_alpha, use_alpha); Alpha += weight[2] * tmp_alpha; } } diff --git a/intern/cycles/kernel/svm/svm_image.h b/intern/cycles/kernel/svm/svm_image.h index 0894c9c8290..b2f20366573 100644 --- a/intern/cycles/kernel/svm/svm_image.h +++ b/intern/cycles/kernel/svm/svm_image.h @@ -50,7 +50,7 @@ __device_inline float svm_image_texture_frac(float x, int *ix) return x - (float)i; } -__device float4 svm_image_texture(KernelGlobals *kg, int id, float x, float y, uint srgb) +__device float4 svm_image_texture(KernelGlobals *kg, int id, float x, float y, uint srgb, uint use_alpha) { /* first slots are used by float textures, which are not supported here */ if(id < TEX_NUM_FLOAT_IMAGES) @@ -88,6 +88,13 @@ __device float4 svm_image_texture(KernelGlobals *kg, int id, float x, float y, u r += ty*(1.0f - tx)*svm_image_texture_read(kg, offset + ix + niy*width); r += ty*tx*svm_image_texture_read(kg, offset + nix + niy*width); + if(use_alpha && r.w != 1.0f && r.w != 0.0f) { + float invw = 1.0f/r.w; + r.x *= invw; + r.y *= invw; + r.z *= invw; + } + if(srgb) { r.x = color_srgb_to_scene_linear(r.x); r.y = color_srgb_to_scene_linear(r.y); @@ -99,7 +106,7 @@ __device float4 svm_image_texture(KernelGlobals *kg, int id, float x, float y, u #else -__device float4 svm_image_texture(KernelGlobals *kg, int id, float x, float y, uint srgb) +__device float4 svm_image_texture(KernelGlobals *kg, int id, float x, float y, uint srgb, uint use_alpha) { float4 r; @@ -222,6 +229,13 @@ __device float4 svm_image_texture(KernelGlobals *kg, int id, float x, float y, u } #endif + if(use_alpha && r.w != 1.0f && r.w != 0.0f) { + float invw = 1.0f/r.w; + r.x *= invw; + r.y *= invw; + r.z *= invw; + } + if(srgb) { r.x = color_srgb_to_scene_linear(r.x); r.y = color_srgb_to_scene_linear(r.y); @@ -241,7 +255,8 @@ __device void svm_node_tex_image(KernelGlobals *kg, ShaderData *sd, float *stack decode_node_uchar4(node.z, &co_offset, &out_offset, &alpha_offset, &srgb); float3 co = stack_load_float3(stack, co_offset); - float4 f = svm_image_texture(kg, id, co.x, co.y, srgb); + uint use_alpha = stack_valid(alpha_offset); + float4 f = svm_image_texture(kg, id, co.x, co.y, srgb, use_alpha); if(stack_valid(out_offset)) stack_store_float3(stack, out_offset, make_float3(f.x, f.y, f.z)); @@ -322,13 +337,14 @@ __device void svm_node_tex_image_box(KernelGlobals *kg, ShaderData *sd, float *s uint id = node.y; float4 f = make_float4(0.0f, 0.0f, 0.0f, 0.0f); + uint use_alpha = stack_valid(alpha_offset); if(weight.x > 0.0f) - f += weight.x*svm_image_texture(kg, id, co.y, co.z, srgb); + f += weight.x*svm_image_texture(kg, id, co.y, co.z, srgb, use_alpha); if(weight.y > 0.0f) - f += weight.y*svm_image_texture(kg, id, co.x, co.z, srgb); + f += weight.y*svm_image_texture(kg, id, co.x, co.z, srgb, use_alpha); if(weight.z > 0.0f) - f += weight.z*svm_image_texture(kg, id, co.y, co.x, srgb); + f += weight.z*svm_image_texture(kg, id, co.y, co.x, srgb, use_alpha); if(stack_valid(out_offset)) stack_store_float3(stack, out_offset, make_float3(f.x, f.y, f.z)); @@ -355,7 +371,8 @@ __device void svm_node_tex_environment(KernelGlobals *kg, ShaderData *sd, float else uv = direction_to_mirrorball(co); - float4 f = svm_image_texture(kg, id, uv.x, uv.y, srgb); + uint use_alpha = stack_valid(alpha_offset); + float4 f = svm_image_texture(kg, id, uv.x, uv.y, srgb, use_alpha); if(stack_valid(out_offset)) stack_store_float3(stack, out_offset, make_float3(f.x, f.y, f.z)); -- cgit v1.2.3 From 394a45a64524f417bba0168c236f6f5eccc3a70d Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Fri, 5 Apr 2013 16:59:19 +0000 Subject: Fix #34877: The render status feedback (progress bar) does not take into account specific Renderlayer samples --- intern/cycles/blender/blender_session.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/intern/cycles/blender/blender_session.cpp b/intern/cycles/blender/blender_session.cpp index acda90f0b83..3043d2aa9e9 100644 --- a/intern/cycles/blender/blender_session.cpp +++ b/intern/cycles/blender/blender_session.cpp @@ -549,7 +549,7 @@ void BlenderSession::get_progress(float& progress, double& total_time) session->progress.get_tile(tile, total_time, tile_time); sample = session->progress.get_sample(); - samples_per_tile = session->params.samples; + samples_per_tile = session->tile_manager.state.num_samples; if(samples_per_tile && tile_total) progress = ((float)sample / (float)(tile_total * samples_per_tile)); -- cgit v1.2.3 From 5e0cdd647300d6cd2ff0f3582330f12653c5d166 Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Fri, 5 Apr 2013 17:03:59 +0000 Subject: Code cleanup / Cycles / Object Attributes: * Change some long "else if" conditions into switch case. --- intern/cycles/render/attribute.cpp | 133 +++++++++++++++++++++++-------------- 1 file changed, 84 insertions(+), 49 deletions(-) diff --git a/intern/cycles/render/attribute.cpp b/intern/cycles/render/attribute.cpp index b6f6ba47fe8..3137ea5327b 100644 --- a/intern/cycles/render/attribute.cpp +++ b/intern/cycles/render/attribute.cpp @@ -72,20 +72,33 @@ size_t Attribute::data_sizeof() const size_t Attribute::element_size(int numverts, int numtris, int numcurves, int numkeys) const { - if(element == ATTR_ELEMENT_VALUE) - return 1; - if(element == ATTR_ELEMENT_VERTEX) - return numverts; - else if(element == ATTR_ELEMENT_FACE) - return numtris; - else if(element == ATTR_ELEMENT_CORNER) - return numtris*3; - else if(element == ATTR_ELEMENT_CURVE) - return numcurves; - else if(element == ATTR_ELEMENT_CURVE_KEY) - return numkeys; + size_t size; - return 0; + switch(element) { + case ATTR_ELEMENT_VALUE: + size = 1; + break; + case ATTR_ELEMENT_VERTEX: + size = numverts; + break; + case ATTR_ELEMENT_FACE: + size = numtris; + break; + case ATTR_ELEMENT_CORNER: + size = numtris*3; + break; + case ATTR_ELEMENT_CURVE: + size = numcurves; + break; + case ATTR_ELEMENT_CURVE_KEY: + size = numkeys; + break; + default: + size = 0; + break; + } + + return size; } size_t Attribute::buffer_size(int numverts, int numtris, int numcurves, int numkeys) const @@ -214,44 +227,66 @@ Attribute *AttributeSet::add(AttributeStandard std, ustring name) name = Attribute::standard_name(std); if(triangle_mesh) { - if(std == ATTR_STD_VERTEX_NORMAL) - attr = add(name, TypeDesc::TypeNormal, ATTR_ELEMENT_VERTEX); - else if(std == ATTR_STD_FACE_NORMAL) - attr = add(name, TypeDesc::TypeNormal, ATTR_ELEMENT_FACE); - else if(std == ATTR_STD_UV) - attr = add(name, TypeDesc::TypePoint, ATTR_ELEMENT_CORNER); - else if(std == ATTR_STD_UV_TANGENT) - attr = add(name, TypeDesc::TypeVector, ATTR_ELEMENT_CORNER); - else if(std == ATTR_STD_UV_TANGENT_SIGN) - attr = add(name, TypeDesc::TypeFloat, ATTR_ELEMENT_CORNER); - else if(std == ATTR_STD_GENERATED) - attr = add(name, TypeDesc::TypePoint, ATTR_ELEMENT_VERTEX); - else if(std == ATTR_STD_POSITION_UNDEFORMED) - attr = add(name, TypeDesc::TypePoint, ATTR_ELEMENT_VERTEX); - else if(std == ATTR_STD_POSITION_UNDISPLACED) - attr = add(name, TypeDesc::TypePoint, ATTR_ELEMENT_VERTEX); - else if(std == ATTR_STD_MOTION_PRE) - attr = add(name, TypeDesc::TypePoint, ATTR_ELEMENT_VERTEX); - else if(std == ATTR_STD_MOTION_POST) - attr = add(name, TypeDesc::TypePoint, ATTR_ELEMENT_VERTEX); - else - assert(0); + switch(std) { + case ATTR_STD_VERTEX_NORMAL: + attr = add(name, TypeDesc::TypeNormal, ATTR_ELEMENT_VERTEX); + break; + case ATTR_STD_FACE_NORMAL: + attr = add(name, TypeDesc::TypeNormal, ATTR_ELEMENT_FACE); + break; + case ATTR_STD_UV: + attr = add(name, TypeDesc::TypePoint, ATTR_ELEMENT_CORNER); + break; + case ATTR_STD_UV_TANGENT: + attr = add(name, TypeDesc::TypeVector, ATTR_ELEMENT_CORNER); + break; + case ATTR_STD_UV_TANGENT_SIGN: + attr = add(name, TypeDesc::TypeFloat, ATTR_ELEMENT_CORNER); + break; + case ATTR_STD_GENERATED: + attr = add(name, TypeDesc::TypePoint, ATTR_ELEMENT_VERTEX); + break; + case ATTR_STD_POSITION_UNDEFORMED: + attr = add(name, TypeDesc::TypePoint, ATTR_ELEMENT_VERTEX); + break; + case ATTR_STD_POSITION_UNDISPLACED: + attr = add(name, TypeDesc::TypePoint, ATTR_ELEMENT_VERTEX); + break; + case ATTR_STD_MOTION_PRE: + attr = add(name, TypeDesc::TypePoint, ATTR_ELEMENT_VERTEX); + break; + case ATTR_STD_MOTION_POST: + attr = add(name, TypeDesc::TypePoint, ATTR_ELEMENT_VERTEX); + break; + default: + assert(0); + break; + } } else if(curve_mesh) { - if(std == ATTR_STD_UV) - attr = add(name, TypeDesc::TypePoint, ATTR_ELEMENT_CURVE); - else if(std == ATTR_STD_GENERATED) - attr = add(name, TypeDesc::TypePoint, ATTR_ELEMENT_CURVE); - else if(std == ATTR_STD_MOTION_PRE) - attr = add(name, TypeDesc::TypePoint, ATTR_ELEMENT_CURVE_KEY); - else if(std == ATTR_STD_MOTION_POST) - attr = add(name, TypeDesc::TypePoint, ATTR_ELEMENT_CURVE_KEY); - else if(std == ATTR_STD_CURVE_TANGENT) - attr = add(name, TypeDesc::TypeVector, ATTR_ELEMENT_CURVE_KEY); - else if(std == ATTR_STD_CURVE_INTERCEPT) - attr = add(name, TypeDesc::TypeFloat, ATTR_ELEMENT_CURVE_KEY); - else - assert(0); + switch(std) { + case ATTR_STD_UV: + attr = add(name, TypeDesc::TypePoint, ATTR_ELEMENT_CURVE); + break; + case ATTR_STD_GENERATED: + attr = add(name, TypeDesc::TypePoint, ATTR_ELEMENT_CURVE); + break; + case ATTR_STD_MOTION_PRE: + attr = add(name, TypeDesc::TypePoint, ATTR_ELEMENT_CURVE_KEY); + break; + case ATTR_STD_MOTION_POST: + attr = add(name, TypeDesc::TypePoint, ATTR_ELEMENT_CURVE_KEY); + break; + case ATTR_STD_CURVE_TANGENT: + attr = add(name, TypeDesc::TypeVector, ATTR_ELEMENT_CURVE_KEY); + break; + case ATTR_STD_CURVE_INTERCEPT: + attr = add(name, TypeDesc::TypeFloat, ATTR_ELEMENT_CURVE_KEY); + break; + default: + assert(0); + break; + } } attr->std = std; -- cgit v1.2.3 From b18a7c3cd64bd3bb0dd203ff7d034d5d9f168b18 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Fri, 5 Apr 2013 17:10:28 +0000 Subject: Bug fix #34866 Global undo/redo now clears the local undo editmode stack entirely. Error goes back to the 2.3 days, when undo was added. Global undo refreshes the entire internal database, so all ID pointers get invalid. This cases editmode undo storage to fail, if it uses ID pointers as well. The error was that for any Mesh undo stack, a single global undo would make the mesh stack corrupt. Back in edit mode, on undo you'd lose assigned texture images, or get bad crashes. The downside is that people expect this to work... it's a fun feature to maintain stacks separately. Having this instable is not acceptable though. Needs quite some redesign work to solve it (like Dalai's kill-the-tface project :) --- source/blender/editors/util/undo.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/blender/editors/util/undo.c b/source/blender/editors/util/undo.c index fc603f7a593..e1451ee43e6 100644 --- a/source/blender/editors/util/undo.c +++ b/source/blender/editors/util/undo.c @@ -186,6 +186,11 @@ static int ed_undo_step(bContext *C, int step, const char *undoname) //#ifdef WITH_PYTHON // XXX BPY_scripts_clear_pyobjects(); //#endif + + /* for global undo/redo we should just clear the editmode stack */ + /* for example, texface stores image pointers */ + undo_editmode_clear(); + if (undoname) BKE_undo_name(C, undoname); else -- cgit v1.2.3 From 5f49bab8bad9ecadcfecaec17268a4c75bcde762 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Fri, 5 Apr 2013 17:27:25 +0000 Subject: Fix eternal compo refresh when having image editor with mask opened This was a regression since 55719 and the reason is: - image_refresh() will tag combo for re-calc when editing mask. This is a feature, so you could have immediate feedback on masking and compositing while editing mask. This is done from image_refresh(). - Color management sends NC_WINDOW notifier, so the whole window is updated when changing color management settings. Image editor used to refresh space when this notifier is sent. The same notifier is sent by compositor job to redraw all possible viewers. Simple fix: don't refresh image space for NC_WINDOW, there's nothing in image_refresh() which we would want to happen on NC_WINDOW event. --- source/blender/editors/space_image/space_image.c | 1 - 1 file changed, 1 deletion(-) diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c index 1b4ff44bb6b..9bc23ca17c2 100644 --- a/source/blender/editors/space_image/space_image.c +++ b/source/blender/editors/space_image/space_image.c @@ -438,7 +438,6 @@ static void image_listener(ScrArea *sa, wmNotifier *wmn) case NC_WINDOW: /* notifier comes from editing color space */ image_scopes_tag_refresh(sa); - ED_area_tag_refresh(sa); ED_area_tag_redraw(sa); break; case NC_SCENE: -- cgit v1.2.3 From 93ac968db3bc47e3520c662671cf68e86c0f2204 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 5 Apr 2013 17:56:54 +0000 Subject: code cleanup: include order --- source/blender/blenkernel/intern/CCGSubSurf.c | 8 ++++---- source/blender/blenkernel/intern/collision.c | 7 +++---- source/blender/blenloader/intern/runtime.c | 6 +++--- source/blender/blenloader/intern/undofile.c | 6 +----- source/blender/bmesh/intern/bmesh_interp.c | 6 +++--- source/blender/bmesh/operators/bmo_join_triangles.c | 4 ++-- source/blender/compositor/intern/COM_WorkScheduler.cpp | 4 ++-- source/blender/editors/armature/reeb.c | 4 ++-- source/blender/editors/gpencil/gpencil_undo.c | 4 ++-- source/blender/editors/include/UI_resources.h | 2 +- source/blender/editors/render/render_preview.c | 4 ++-- source/blender/editors/space_clip/clip_dopesheet_draw.c | 8 ++++---- source/blender/editors/space_clip/clip_draw.c | 10 +++++----- source/blender/editors/space_clip/clip_graph_draw.c | 8 ++++---- source/blender/editors/space_file/file_panels.c | 5 ++--- source/blender/editors/space_file/space_file.c | 4 ++-- source/blender/editors/space_node/node_ops.c | 4 ++-- source/blender/editors/transform/transform_constraints.c | 4 ++-- source/blender/makesrna/intern/rna_cloth.c | 6 +++--- source/blender/makesrna/intern/rna_internal.h | 4 ++-- source/blender/makesrna/intern/rna_movieclip.c | 6 +++--- source/blender/nodes/shader/nodes/node_shader_script.c | 4 ++-- source/blender/python/intern/bpy_library.c | 10 +++++----- 23 files changed, 61 insertions(+), 67 deletions(-) diff --git a/source/blender/blenkernel/intern/CCGSubSurf.c b/source/blender/blenkernel/intern/CCGSubSurf.c index e58d484b0c0..292d74b03d7 100644 --- a/source/blender/blenkernel/intern/CCGSubSurf.c +++ b/source/blender/blenkernel/intern/CCGSubSurf.c @@ -7,15 +7,15 @@ #include #include -#include "BKE_ccg.h" -#include "CCGSubSurf.h" -#include "BKE_subsurf.h" - #include "MEM_guardedalloc.h" #include "BLO_sys_types.h" // for intptr_t support #include "BLI_utildefines.h" /* for BLI_assert */ +#include "BKE_ccg.h" +#include "CCGSubSurf.h" +#include "BKE_subsurf.h" + /* used for normalize_v3 in BLI_math_vector * float.h's FLT_EPSILON causes trouble with subsurf normals - campbell */ #define EPSILON (1.0e-35f) diff --git a/source/blender/blenkernel/intern/collision.c b/source/blender/blenkernel/intern/collision.c index ed72a0fb37b..4bfe3b1c0bd 100644 --- a/source/blender/blenkernel/intern/collision.c +++ b/source/blender/blenkernel/intern/collision.c @@ -32,8 +32,6 @@ #include "MEM_guardedalloc.h" -#include "BKE_cloth.h" - #include "DNA_cloth_types.h" #include "DNA_group_types.h" #include "DNA_mesh_types.h" @@ -52,11 +50,12 @@ #include "BLI_rand.h" #include "BKE_DerivedMesh.h" +#include "BKE_cloth.h" #include "BKE_global.h" -#include "BKE_scene.h" #include "BKE_mesh.h" -#include "BKE_object.h" #include "BKE_modifier.h" +#include "BKE_object.h" +#include "BKE_scene.h" #include "BKE_DerivedMesh.h" #ifdef WITH_BULLET diff --git a/source/blender/blenloader/intern/runtime.c b/source/blender/blenloader/intern/runtime.c index cbbaf713e84..d6fd2f92443 100644 --- a/source/blender/blenloader/intern/runtime.c +++ b/source/blender/blenloader/intern/runtime.c @@ -45,12 +45,12 @@ # include // read #endif -#include "BLO_readfile.h" -#include "BLO_runtime.h" - #include "BLI_blenlib.h" #include "BLI_utildefines.h" +#include "BLO_readfile.h" +#include "BLO_runtime.h" + #include "BKE_blender.h" #include "BKE_report.h" diff --git a/source/blender/blenloader/intern/undofile.c b/source/blender/blenloader/intern/undofile.c index 38fd6e9d32d..2b63d13a9dd 100644 --- a/source/blender/blenloader/intern/undofile.c +++ b/source/blender/blenloader/intern/undofile.c @@ -30,7 +30,6 @@ * \ingroup blenloader */ - #include #include #include @@ -40,13 +39,10 @@ #include "DNA_listBase.h" - -#include "BLO_undofile.h" - #include "BLI_blenlib.h" #include "BLI_linklist.h" - +#include "BLO_undofile.h" /* **************** support for memory-write, for undo buffers *************** */ diff --git a/source/blender/bmesh/intern/bmesh_interp.c b/source/blender/bmesh/intern/bmesh_interp.c index d0ab0ea5d60..6edbae0831e 100644 --- a/source/blender/bmesh/intern/bmesh_interp.c +++ b/source/blender/bmesh/intern/bmesh_interp.c @@ -36,12 +36,12 @@ #include "DNA_mesh_types.h" #include "DNA_meshdata_types.h" -#include "BKE_customdata.h" -#include "BKE_multires.h" - #include "BLI_array.h" #include "BLI_math.h" +#include "BKE_customdata.h" +#include "BKE_multires.h" + #include "bmesh.h" #include "intern/bmesh_private.h" diff --git a/source/blender/bmesh/operators/bmo_join_triangles.c b/source/blender/bmesh/operators/bmo_join_triangles.c index 5e4fa29d953..edbb19afc62 100644 --- a/source/blender/bmesh/operators/bmo_join_triangles.c +++ b/source/blender/bmesh/operators/bmo_join_triangles.c @@ -33,11 +33,11 @@ #include "DNA_meshdata_types.h" -#include "BKE_customdata.h" - #include "BLI_math.h" #include "BLI_array.h" +#include "BKE_customdata.h" + #include "bmesh.h" #include "intern/bmesh_operators_private.h" /* own include */ diff --git a/source/blender/compositor/intern/COM_WorkScheduler.cpp b/source/blender/compositor/intern/COM_WorkScheduler.cpp index 724abb59bcf..402fa28e210 100644 --- a/source/blender/compositor/intern/COM_WorkScheduler.cpp +++ b/source/blender/compositor/intern/COM_WorkScheduler.cpp @@ -23,8 +23,6 @@ #include #include -#include "BKE_global.h" - #include "COM_compositor.h" #include "COM_WorkScheduler.h" #include "COM_CPUDevice.h" @@ -38,6 +36,8 @@ #include "PIL_time.h" #include "BLI_threads.h" +#include "BKE_global.h" + #if COM_CURRENT_THREADING_MODEL == COM_TM_NOTHREAD # ifndef DEBUG /* test this so we dont get warnings in debug builds */ # warning COM_CURRENT_THREADING_MODEL COM_TM_NOTHREAD is activated. Use only for debugging. diff --git a/source/blender/editors/armature/reeb.c b/source/blender/editors/armature/reeb.c index 649ef90f7ba..665c5f628d9 100644 --- a/source/blender/editors/armature/reeb.c +++ b/source/blender/editors/armature/reeb.c @@ -26,13 +26,13 @@ #include "MEM_guardedalloc.h" -#include "BKE_context.h" - #include "BLI_blenlib.h" #include "BLI_math.h" #include "BLI_edgehash.h" #include "BLI_ghash.h" +#include "BKE_context.h" + #include "reeb.h" #if 0 /* UNUSED 2.5 */ diff --git a/source/blender/editors/gpencil/gpencil_undo.c b/source/blender/editors/gpencil/gpencil_undo.c index 3d2cd260fb9..7edf723022f 100644 --- a/source/blender/editors/gpencil/gpencil_undo.c +++ b/source/blender/editors/gpencil/gpencil_undo.c @@ -38,12 +38,12 @@ #include "DNA_listBase.h" #include "DNA_windowmanager_types.h" +#include "BLI_listbase.h" + #include "BKE_blender.h" #include "BKE_context.h" #include "BKE_gpencil.h" -#include "BLI_listbase.h" - #include "ED_gpencil.h" #include "WM_api.h" diff --git a/source/blender/editors/include/UI_resources.h b/source/blender/editors/include/UI_resources.h index 51d16094609..b37b4f40c08 100644 --- a/source/blender/editors/include/UI_resources.h +++ b/source/blender/editors/include/UI_resources.h @@ -308,4 +308,4 @@ const unsigned char *UI_ThemeGetColorPtr(struct bTheme *btheme, int spacetype, i void UI_make_axis_color(const unsigned char *src_col, unsigned char *dst_col, const char axis); -#endif /* UI_RESOURCES_H */ +#endif /* __UI_RESOURCES_H__ */ diff --git a/source/blender/editors/render/render_preview.c b/source/blender/editors/render/render_preview.c index b851dc3be94..08349e2e0bb 100644 --- a/source/blender/editors/render/render_preview.c +++ b/source/blender/editors/render/render_preview.c @@ -43,13 +43,13 @@ #endif #include "MEM_guardedalloc.h" -#include "BLO_readfile.h" - #include "BLI_math.h" #include "BLI_blenlib.h" #include "BLI_threads.h" #include "BLI_utildefines.h" +#include "BLO_readfile.h" + #include "DNA_world_types.h" #include "DNA_camera_types.h" #include "DNA_material_types.h" diff --git a/source/blender/editors/space_clip/clip_dopesheet_draw.c b/source/blender/editors/space_clip/clip_dopesheet_draw.c index b1be9217819..382b0b75c5e 100644 --- a/source/blender/editors/space_clip/clip_dopesheet_draw.c +++ b/source/blender/editors/space_clip/clip_dopesheet_draw.c @@ -35,10 +35,6 @@ #include "MEM_guardedalloc.h" -#include "BKE_context.h" -#include "BKE_movieclip.h" -#include "BKE_tracking.h" - #include "BLI_utildefines.h" #include "BLI_math.h" #include "BLI_string.h" @@ -46,6 +42,10 @@ #include "BLI_math.h" #include "BLI_rect.h" +#include "BKE_context.h" +#include "BKE_movieclip.h" +#include "BKE_tracking.h" + #include "ED_screen.h" #include "ED_clip.h" diff --git a/source/blender/editors/space_clip/clip_draw.c b/source/blender/editors/space_clip/clip_draw.c index 1000aced3a9..1d2ea8d7305 100644 --- a/source/blender/editors/space_clip/clip_draw.c +++ b/source/blender/editors/space_clip/clip_draw.c @@ -37,11 +37,6 @@ #include "MEM_guardedalloc.h" -#include "BKE_context.h" -#include "BKE_movieclip.h" -#include "BKE_tracking.h" -#include "BKE_mask.h" - #include "IMB_colormanagement.h" #include "IMB_imbuf_types.h" #include "IMB_imbuf.h" @@ -52,6 +47,11 @@ #include "BLI_rect.h" #include "BLI_math_base.h" +#include "BKE_context.h" +#include "BKE_movieclip.h" +#include "BKE_tracking.h" +#include "BKE_mask.h" + #include "ED_screen.h" #include "ED_clip.h" #include "ED_mask.h" diff --git a/source/blender/editors/space_clip/clip_graph_draw.c b/source/blender/editors/space_clip/clip_graph_draw.c index 7b070fde6ba..973200dc340 100644 --- a/source/blender/editors/space_clip/clip_graph_draw.c +++ b/source/blender/editors/space_clip/clip_graph_draw.c @@ -35,14 +35,14 @@ #include "MEM_guardedalloc.h" -#include "BKE_context.h" -#include "BKE_movieclip.h" -#include "BKE_tracking.h" - #include "BLI_utildefines.h" #include "BLI_math.h" #include "BLI_string.h" +#include "BKE_context.h" +#include "BKE_movieclip.h" +#include "BKE_tracking.h" + #include "ED_screen.h" #include "ED_clip.h" diff --git a/source/blender/editors/space_file/file_panels.c b/source/blender/editors/space_file/file_panels.c index 35179511563..d6f644ab330 100644 --- a/source/blender/editors/space_file/file_panels.c +++ b/source/blender/editors/space_file/file_panels.c @@ -28,13 +28,12 @@ * \ingroup spfile */ +#include "BLI_blenlib.h" +#include "BLI_utildefines.h" #include "BKE_context.h" #include "BKE_screen.h" -#include "BLI_blenlib.h" -#include "BLI_utildefines.h" - #include "BLF_translation.h" #include "DNA_screen_types.h" diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c index 698c355fad3..d2624c7fa97 100644 --- a/source/blender/editors/space_file/space_file.c +++ b/source/blender/editors/space_file/space_file.c @@ -35,14 +35,14 @@ #include "BIF_gl.h" -#include "BLO_readfile.h" - #include "BLI_blenlib.h" #include "BLI_math.h" #include "BLI_rand.h" #include "BLI_utildefines.h" #include "BLI_fileops_types.h" +#include "BLO_readfile.h" + #include "BKE_context.h" #include "BKE_screen.h" #include "BKE_global.h" diff --git a/source/blender/editors/space_node/node_ops.c b/source/blender/editors/space_node/node_ops.c index 513bde4375c..0155750fbf8 100644 --- a/source/blender/editors/space_node/node_ops.c +++ b/source/blender/editors/space_node/node_ops.c @@ -31,10 +31,10 @@ #include "DNA_node_types.h" -#include "BKE_context.h" - #include "BLI_utildefines.h" +#include "BKE_context.h" + #include "ED_node.h" /* own include */ #include "ED_screen.h" #include "ED_transform.h" diff --git a/source/blender/editors/transform/transform_constraints.c b/source/blender/editors/transform/transform_constraints.c index 7678051fd38..2752d76fbf0 100644 --- a/source/blender/editors/transform/transform_constraints.c +++ b/source/blender/editors/transform/transform_constraints.c @@ -49,12 +49,12 @@ #include "BIF_gl.h" #include "BIF_glutil.h" -#include "BKE_context.h" - #include "BLI_math.h" #include "BLI_utildefines.h" #include "BLI_string.h" +#include "BKE_context.h" + #include "ED_image.h" #include "ED_view3d.h" diff --git a/source/blender/makesrna/intern/rna_cloth.c b/source/blender/makesrna/intern/rna_cloth.c index 1bf15fd0838..74b0f69c9b8 100644 --- a/source/blender/makesrna/intern/rna_cloth.c +++ b/source/blender/makesrna/intern/rna_cloth.c @@ -27,9 +27,6 @@ #include #include -#include "BKE_cloth.h" -#include "BKE_modifier.h" - #include "DNA_cloth_types.h" #include "DNA_object_types.h" #include "DNA_scene_types.h" @@ -38,6 +35,9 @@ #include "rna_internal.h" +#include "BKE_cloth.h" +#include "BKE_modifier.h" + #include "WM_api.h" #include "WM_types.h" diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h index a38797d4831..48829cf1965 100644 --- a/source/blender/makesrna/intern/rna_internal.h +++ b/source/blender/makesrna/intern/rna_internal.h @@ -27,12 +27,12 @@ #ifndef __RNA_INTERNAL_H__ #define __RNA_INTERNAL_H__ -#include "UI_resources.h" - #include "BLI_utildefines.h" #include "rna_internal_types.h" +#include "UI_resources.h" + #define RNA_MAGIC ((int)~0) struct ColorBand; diff --git a/source/blender/makesrna/intern/rna_movieclip.c b/source/blender/makesrna/intern/rna_movieclip.c index 9b2bcab4604..bb5ff172672 100644 --- a/source/blender/makesrna/intern/rna_movieclip.c +++ b/source/blender/makesrna/intern/rna_movieclip.c @@ -30,9 +30,6 @@ #include "MEM_guardedalloc.h" -#include "BKE_movieclip.h" -#include "BKE_tracking.h" - #include "DNA_movieclip_types.h" #include "DNA_scene_types.h" @@ -40,6 +37,9 @@ #include "rna_internal.h" +#include "BKE_movieclip.h" +#include "BKE_tracking.h" + #include "WM_types.h" #include "IMB_imbuf_types.h" diff --git a/source/blender/nodes/shader/nodes/node_shader_script.c b/source/blender/nodes/shader/nodes/node_shader_script.c index 6666197770f..c0d62f98d47 100644 --- a/source/blender/nodes/shader/nodes/node_shader_script.c +++ b/source/blender/nodes/shader/nodes/node_shader_script.c @@ -29,10 +29,10 @@ * \ingroup shdnodes */ -#include "BKE_idprop.h" - #include "node_shader_util.h" +#include "BKE_idprop.h" + /* **************** Script ******************** */ static void init(bNodeTree *UNUSED(ntree), bNode *node) diff --git a/source/blender/python/intern/bpy_library.c b/source/blender/python/intern/bpy_library.c index 623d45dfd90..0ab8543c4ac 100644 --- a/source/blender/python/intern/bpy_library.c +++ b/source/blender/python/intern/bpy_library.c @@ -31,20 +31,17 @@ * a context manager. */ -/* nifty feature. swap out strings for RNA data */ -#define USE_RNA_DATABLOCKS - #include #include -#include "BLO_readfile.h" - #include "BLI_utildefines.h" #include "BLI_string.h" #include "BLI_linklist.h" #include "BLI_path_util.h" #include "BLI_listbase.h" +#include "BLO_readfile.h" + #include "BKE_global.h" #include "BKE_main.h" #include "BKE_library.h" @@ -57,6 +54,9 @@ #include "bpy_util.h" #include "bpy_library.h" +/* nifty feature. swap out strings for RNA data */ +#define USE_RNA_DATABLOCKS + #ifdef USE_RNA_DATABLOCKS # include "bpy_rna.h" # include "RNA_access.h" -- cgit v1.2.3 From 7404c1a553662c4dc1468a78b2237cd54c9598a2 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 5 Apr 2013 17:57:26 +0000 Subject: Fix another part of #34877: cycles progress status text not showing correct with per render layer samples in addition to the progress bar. Also fixed job progress bar not working at all on high DPI / retina, was so small the actual progress was not visible. --- intern/cycles/blender/blender_session.cpp | 2 +- intern/cycles/render/session.cpp | 8 ++++---- intern/cycles/render/tile.h | 3 ++- source/blender/editors/interface/interface_widgets.c | 8 ++++---- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/intern/cycles/blender/blender_session.cpp b/intern/cycles/blender/blender_session.cpp index 3043d2aa9e9..1f1bb830771 100644 --- a/intern/cycles/blender/blender_session.cpp +++ b/intern/cycles/blender/blender_session.cpp @@ -549,7 +549,7 @@ void BlenderSession::get_progress(float& progress, double& total_time) session->progress.get_tile(tile, total_time, tile_time); sample = session->progress.get_sample(); - samples_per_tile = session->tile_manager.state.num_samples; + samples_per_tile = session->tile_manager.num_samples; if(samples_per_tile && tile_total) progress = ((float)sample / (float)(tile_total * samples_per_tile)); diff --git a/intern/cycles/render/session.cpp b/intern/cycles/render/session.cpp index 6ed14452c6b..075f5eb6bab 100644 --- a/intern/cycles/render/session.cpp +++ b/intern/cycles/render/session.cpp @@ -758,7 +758,7 @@ void Session::update_status_time(bool show_pause, bool show_done) * also display the info on CPU, when using 1 tile only */ - int sample = progress.get_sample(), num_samples = tile_manager.state.num_samples; + int sample = progress.get_sample(), num_samples = tile_manager.num_samples; if(tile > 1) { /* sample counter is global for all tiles, subtract samples @@ -771,10 +771,10 @@ void Session::update_status_time(bool show_pause, bool show_done) substatus += string_printf(", Sample %d/%d", sample, num_samples); } } - else if(params.samples == INT_MAX) + else if(tile_manager.num_samples == INT_MAX) substatus = string_printf("Path Tracing Sample %d", sample+1); else - substatus = string_printf("Path Tracing Sample %d/%d", sample+1, params.samples); + substatus = string_printf("Path Tracing Sample %d/%d", sample+1, tile_manager.num_samples); if(show_pause) status = "Paused"; @@ -846,7 +846,7 @@ void Session::tonemap() bool Session::update_progressive_refine(bool cancel) { int sample = tile_manager.state.sample + 1; - bool write = sample == params.samples || cancel; + bool write = sample == tile_manager.num_samples || cancel; double current_time = time_dt(); diff --git a/intern/cycles/render/tile.h b/intern/cycles/render/tile.h index 99cffb49c08..0e9e5a73a42 100644 --- a/intern/cycles/render/tile.h +++ b/intern/cycles/render/tile.h @@ -58,6 +58,8 @@ public: list tiles; } state; + int num_samples; + TileManager(bool progressive, int num_samples, int2 tile_size, int start_resolution, bool preserve_tile_device, bool background, int tile_order, int num_devices = 1); ~TileManager(); @@ -82,7 +84,6 @@ protected: void set_tiles(); bool progressive; - int num_samples; int2 tile_size; int tile_order; int start_resolution; diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index e5f9e48c3b0..905c914352f 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -2506,8 +2506,8 @@ static void widget_progressbar(uiBut *but, uiWidgetColors *wcol, rcti *rect, int /* make the progress bar a proportion of the original height */ /* hardcoded 4px high for now */ - rect_prog.ymax = rect_prog.ymin + 4; - rect_bar.ymax = rect_bar.ymin + 4; + rect_prog.ymax = rect_prog.ymin + 4 * UI_DPI_FAC; + rect_bar.ymax = rect_bar.ymin + 4 * UI_DPI_FAC; w = value * BLI_rcti_size_x(&rect_prog); @@ -2520,8 +2520,8 @@ static void widget_progressbar(uiBut *but, uiWidgetColors *wcol, rcti *rect, int uiWidgetScrollDraw(wcol, &rect_prog, &rect_bar, UI_SCROLL_NO_OUTLINE); /* raise text a bit */ - rect->ymin += 6; - rect->xmin -= 6; + rect->ymin += 6 * UI_DPI_FAC; + rect->xmin -= 6 * UI_DPI_FAC; } static void widget_link(uiBut *but, uiWidgetColors *UNUSED(wcol), rcti *rect, int UNUSED(state), int UNUSED(roundboxalign)) -- cgit v1.2.3 From 79e58c31a085c52a4901fdb8a0d026aa4ab2e594 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 5 Apr 2013 19:26:33 +0000 Subject: add BM_face_calc_center_mean_weighted() gives much better result at cost of some speed. --- source/blender/bmesh/intern/bmesh_polygon.c | 28 ++++++++++++++++++++++++++++ source/blender/bmesh/intern/bmesh_polygon.h | 1 + source/blender/python/bmesh/bmesh_py_types.c | 17 +++++++++++++++++ 3 files changed, 46 insertions(+) diff --git a/source/blender/bmesh/intern/bmesh_polygon.c b/source/blender/bmesh/intern/bmesh_polygon.c index d235aaaa622..525dd5b1f9c 100644 --- a/source/blender/bmesh/intern/bmesh_polygon.c +++ b/source/blender/bmesh/intern/bmesh_polygon.c @@ -336,6 +336,34 @@ void BM_face_calc_center_mean(BMFace *f, float r_cent[3]) mul_v3_fl(r_cent, 1.0f / (float) f->len); } +/** + * computes the center of a face, using the mean average + * weighted by edge length + */ +void BM_face_calc_center_mean_weighted(BMFace *f, float r_cent[3]) +{ + BMLoop *l_iter; + BMLoop *l_first; + float totw = 0.0f; + float w_prev; + + zero_v3(r_cent); + + + l_iter = l_first = BM_FACE_FIRST_LOOP(f); + w_prev = BM_edge_calc_length(l_iter->prev->e); + do { + const float w_curr = BM_edge_calc_length(l_iter->e); + const float w = (w_curr + w_prev); + madd_v3_v3fl(r_cent, l_iter->v->co, w); + totw += w; + w_prev = w_curr; + } while ((l_iter = l_iter->next) != l_first); + + if (totw != 0.0f) + mul_v3_fl(r_cent, 1.0f / (float) totw); +} + /** * COMPUTE POLY PLANE * diff --git a/source/blender/bmesh/intern/bmesh_polygon.h b/source/blender/bmesh/intern/bmesh_polygon.h index c439a41f672..d857ba77fe7 100644 --- a/source/blender/bmesh/intern/bmesh_polygon.h +++ b/source/blender/bmesh/intern/bmesh_polygon.h @@ -37,6 +37,7 @@ float BM_face_calc_area(BMFace *f); float BM_face_calc_perimeter(BMFace *f); void BM_face_calc_center_bounds(BMFace *f, float center[3]); void BM_face_calc_center_mean(BMFace *f, float center[3]); +void BM_face_calc_center_mean_weighted(BMFace *f, float center[3]); void BM_face_normal_update(BMFace *f); void BM_face_normal_update_vcos(BMesh *bm, BMFace *f, float no[3], diff --git a/source/blender/python/bmesh/bmesh_py_types.c b/source/blender/python/bmesh/bmesh_py_types.c index 833ec3b7467..0e75ee088d3 100644 --- a/source/blender/python/bmesh/bmesh_py_types.c +++ b/source/blender/python/bmesh/bmesh_py_types.c @@ -1627,6 +1627,22 @@ static PyObject *bpy_bmface_calc_center_mean(BPy_BMFace *self) return Vector_CreatePyObject(cent, 3, Py_NEW, NULL); } +PyDoc_STRVAR(bpy_bmface_calc_center_mean_weighted_doc, +".. method:: calc_center_median_weighted()\n" +"\n" +" Return median center of the face weighted by edge lengths.\n" +"\n" +" :return: a 3D vector.\n" +" :rtype: :class:`mathutils.Vector`\n" +); +static PyObject *bpy_bmface_calc_center_mean_weighted(BPy_BMFace *self) +{ + float cent[3]; + + BPY_BM_CHECK_OBJ(self); + BM_face_calc_center_mean_weighted(self->f, cent); + return Vector_CreatePyObject(cent, 3, Py_NEW, NULL); +} PyDoc_STRVAR(bpy_bmface_calc_center_bounds_doc, ".. method:: calc_center_bounds()\n" @@ -2482,6 +2498,7 @@ static struct PyMethodDef bpy_bmface_methods[] = { {"calc_area", (PyCFunction)bpy_bmface_calc_area, METH_NOARGS, bpy_bmface_calc_area_doc}, {"calc_perimeter", (PyCFunction)bpy_bmface_calc_perimeter, METH_NOARGS, bpy_bmface_calc_perimeter_doc}, {"calc_center_median", (PyCFunction)bpy_bmface_calc_center_mean, METH_NOARGS, bpy_bmface_calc_center_mean_doc}, + {"calc_center_median_weighted", (PyCFunction)bpy_bmface_calc_center_mean_weighted, METH_NOARGS, bpy_bmface_calc_center_mean_weighted_doc}, {"calc_center_bounds", (PyCFunction)bpy_bmface_calc_center_bounds, METH_NOARGS, bpy_bmface_calc_center_bounds_doc}, {"normal_update", (PyCFunction)bpy_bmface_normal_update, METH_NOARGS, bpy_bmface_normal_update_doc}, -- cgit v1.2.3 From 716ed32d902cd57cf700723627e8a4ba3e55a858 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 5 Apr 2013 19:58:18 +0000 Subject: fix [#34870] bmesh.ops.* parameter lists and descriptions don't show in PyConsole on auto-complete more a feature request then a bug but nice to have __doc__ on bmesh operators. --- source/blender/bmesh/intern/bmesh_operator_api.h | 2 + source/blender/bmesh/intern/bmesh_operators.c | 25 ++++--- source/blender/python/bmesh/bmesh_py_ops.c | 92 ++++++++++++++++++++---- 3 files changed, 98 insertions(+), 21 deletions(-) diff --git a/source/blender/bmesh/intern/bmesh_operator_api.h b/source/blender/bmesh/intern/bmesh_operator_api.h index 180bc53c2e3..c72accbc605 100644 --- a/source/blender/bmesh/intern/bmesh_operator_api.h +++ b/source/blender/bmesh/intern/bmesh_operator_api.h @@ -482,6 +482,8 @@ typedef struct BMOElemMapping { extern const int BMO_OPSLOT_TYPEINFO[BMO_OP_SLOT_TOTAL_TYPES]; +int BMO_opcode_from_opname(const char *opname); + #ifdef __cplusplus } #endif diff --git a/source/blender/bmesh/intern/bmesh_operators.c b/source/blender/bmesh/intern/bmesh_operators.c index a358623834f..1d20f94c51c 100644 --- a/source/blender/bmesh/intern/bmesh_operators.c +++ b/source/blender/bmesh/intern/bmesh_operators.c @@ -47,7 +47,6 @@ static void bmo_flag_layer_free(BMesh *bm); static void bmo_flag_layer_clear(BMesh *bm); static int bmo_name_to_slotcode(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *identifier); static int bmo_name_to_slotcode_check(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *identifier); -static int bmo_opname_to_opcode(const char *opname); static const char *bmo_error_messages[] = { NULL, @@ -145,7 +144,7 @@ static void bmo_op_slots_init(const BMOSlotType *slot_types, BMOpSlot *slot_args */ void BMO_op_init(BMesh *bm, BMOperator *op, const int flag, const char *opname) { - int opcode = bmo_opname_to_opcode(opname); + int opcode = BMO_opcode_from_opname(opname); #ifdef DEBUG BM_ELEM_INDEX_VALIDATE(bm, "pre bmo", opname); @@ -1522,20 +1521,27 @@ static int bmo_name_to_slotcode_check(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], cons return i; } -static int bmo_opname_to_opcode(const char *opname) +int BMO_opcode_from_opname(const char *opname) { - int i; - for (i = 0; i < bmo_opdefines_total; i++) { - if (STREQ(opname, bmo_opdefines[i]->opname)) { + const unsigned int tot = bmo_opdefines_total; + unsigned int i; + for (i = 0; i < tot; i++) { + if (STREQ(bmo_opdefines[i]->opname, opname)) { return i; } } - - fprintf(stderr, "%s: could not find bmesh slot for name %s! (bmesh internal error)\n", __func__, opname); return -1; } +static int BMO_opcode_from_opname_check(const char *opname) +{ + int i = BMO_opcode_from_opname(opname); + if (i == -1) + fprintf(stderr, "%s: could not find bmesh slot for name %s! (bmesh internal error)\n", __func__, opname); + return i; +} + /** * \brief Format Strings for #BMOperator Initialization. * @@ -1628,10 +1634,11 @@ bool BMO_op_vinitf(BMesh *bm, BMOperator *op, const int flag, const char *_fmt, fmt += i + (noslot ? 0 : 1); - i = bmo_opname_to_opcode(opname); + i = BMO_opcode_from_opname_check(opname); if (i == -1) { MEM_freeN(ofmt); + BLI_assert(0); return false; } diff --git a/source/blender/python/bmesh/bmesh_py_ops.c b/source/blender/python/bmesh/bmesh_py_ops.c index cc87d34d769..234dd1e5fec 100644 --- a/source/blender/python/bmesh/bmesh_py_ops.c +++ b/source/blender/python/bmesh/bmesh_py_ops.c @@ -33,6 +33,7 @@ #include #include "BLI_utildefines.h" +#include "BLI_dynstr.h" #include "MEM_guardedalloc.h" @@ -68,6 +69,76 @@ static PyObject *bpy_bmesh_op_repr(BPy_BMeshOpFunc *self) } +/* methods + * ======= */ + + +/* __doc__ + * ------- */ + +static char *bmp_slots_as_args(const BMOSlotType slot_types[BMO_OP_MAX_SLOTS], const bool is_out) +{ + DynStr *dyn_str = BLI_dynstr_new(); + char *ret; + + int i = 0; + + while (*slot_types[i].name) { + /* cut off '.out' by using a string size arg */ + const int name_len = is_out ? + (strchr(slot_types[i].name, '.') - slot_types[i].name) : + sizeof(slot_types[i].name); + const char *value = ""; + switch (slot_types[i].type) { + case BMO_OP_SLOT_BOOL: value = "False"; break; + case BMO_OP_SLOT_INT: value = "0"; break; + case BMO_OP_SLOT_FLT: value = "0.0"; break; + case BMO_OP_SLOT_PTR: value = "None"; break; + case BMO_OP_SLOT_MAT: value = "Matrix()"; break; + case BMO_OP_SLOT_VEC: value = "Vector()"; break; + case BMO_OP_SLOT_ELEMENT_BUF: value = + (slot_types[i].subtype.elem & BMO_OP_SLOT_SUBTYPE_ELEM_IS_SINGLE) ? "None" : "[]"; break; + case BMO_OP_SLOT_MAPPING: value = "{}"; break; + } + BLI_dynstr_appendf(dyn_str, i ? ", %.*s=%s" : "%.*s=%s", name_len, slot_types[i].name, value); + i++; + }; + + ret = BLI_dynstr_get_cstring(dyn_str); + BLI_dynstr_free(dyn_str); + return ret; +} + +static PyObject *bpy_bmesh_op_doc_get(BPy_BMeshOpFunc *self, void *UNUSED(closure)) +{ + PyObject *ret; + char *slot_in; + char *slot_out; + int i; + + i = BMO_opcode_from_opname(self->opname); + + slot_in = bmp_slots_as_args(bmo_opdefines[i]->slot_types_in, false); + slot_out = bmp_slots_as_args(bmo_opdefines[i]->slot_types_out, true); + + ret = PyUnicode_FromFormat("%.200s bmesh.ops.%.200s(bmesh, %s)\n -> dict(%s)", + Py_TYPE(self)->tp_name, + self->opname, slot_in, slot_out); + + MEM_freeN(slot_in); + MEM_freeN(slot_out); + + return ret; +} + +static PyGetSetDef bpy_bmesh_op_getseters[] = { + {(char *)"__doc__", (getter)bpy_bmesh_op_doc_get, (setter)NULL, NULL, NULL}, + {NULL, NULL, NULL, NULL, NULL} /* Sentinel */ +}; + + +/* Types + * ===== */ PyTypeObject bmesh_op_Type = { PyVarObject_HEAD_INIT(NULL, 0) @@ -126,7 +197,7 @@ PyTypeObject bmesh_op_Type = { /*** Attribute descriptor and subclassing stuff ***/ NULL, /* struct PyMethodDef *tp_methods; */ NULL, /* struct PyMemberDef *tp_members; */ - NULL, /* struct PyGetSetDef *tp_getset; */ + bpy_bmesh_op_getseters, /* struct PyGetSetDef *tp_getset; */ NULL, /* struct _typeobject *tp_base; */ NULL, /* PyObject *tp_dict; */ NULL, /* descrgetfunc tp_descr_get; */ @@ -154,20 +225,17 @@ PyTypeObject bmesh_op_Type = { static PyObject *bpy_bmesh_ops_fakemod_getattro(PyObject *UNUSED(self), PyObject *pyname) { - const unsigned int tot = bmo_opdefines_total; - unsigned int i; const char *opname = _PyUnicode_AsString(pyname); - for (i = 0; i < tot; i++) { - if (STREQ(bmo_opdefines[i]->opname, opname)) { - return bpy_bmesh_op_CreatePyObject(opname); - } + if (BMO_opcode_from_opname(opname) != -1) { + return bpy_bmesh_op_CreatePyObject(opname); + } + else { + PyErr_Format(PyExc_AttributeError, + "BMeshOpsModule: operator \"%.200s\" doesn't exist", + opname); + return NULL; } - - PyErr_Format(PyExc_AttributeError, - "BMeshOpsModule: operator \"%.200s\" doesn't exist", - opname); - return NULL; } static PyObject *bpy_bmesh_ops_fakemod_dir(PyObject *UNUSED(self)) -- cgit v1.2.3 From 8fd42b2aae6c1415be2365d09153fb8578aeecaa Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 5 Apr 2013 22:21:14 +0000 Subject: patch [#34886] BMesh Individual Face Inset from Francisco De La Cruz (xercesblue) with some simplifications to the patch. --- source/blender/bmesh/intern/bmesh_opdefines.c | 23 +++ .../blender/bmesh/intern/bmesh_operators_private.h | 1 + source/blender/bmesh/operators/bmo_inset.c | 225 ++++++++++++++++++++- source/blender/editors/mesh/editmesh_inset.c | 39 +++- 4 files changed, 278 insertions(+), 10 deletions(-) diff --git a/source/blender/bmesh/intern/bmesh_opdefines.c b/source/blender/bmesh/intern/bmesh_opdefines.c index 7583332c4db..31398b452bd 100644 --- a/source/blender/bmesh/intern/bmesh_opdefines.c +++ b/source/blender/bmesh/intern/bmesh_opdefines.c @@ -1499,6 +1499,28 @@ static BMOpDefine bmo_solidify_def = { 0 }; +/* + * Face Inset (Individual). + * + * Insets individual faces. + */ +static BMOpDefine bmo_inset_individual_def = { + "inset_individual", + /* slots_in */ + {{"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* input faces */ + {"thickness", BMO_OP_SLOT_FLT}, + {"depth", BMO_OP_SLOT_FLT}, + {"use_even_offset", BMO_OP_SLOT_BOOL}, + {{'\0'}}, + }, + /* slots_out */ + {{"faces.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* output faces */ + {{'\0'}}, + }, + bmo_inset_individual_exec, + 0 +}; + /* * Face Inset. * @@ -1647,6 +1669,7 @@ const BMOpDefine *bmo_opdefines[] = { &bmo_extrude_face_region_def, &bmo_extrude_vert_indiv_def, &bmo_find_doubles_def, + &bmo_inset_individual_def, &bmo_inset_def, &bmo_join_triangles_def, &bmo_mesh_to_bmesh_def, diff --git a/source/blender/bmesh/intern/bmesh_operators_private.h b/source/blender/bmesh/intern/bmesh_operators_private.h index 79e688bd5ff..bae29540b62 100644 --- a/source/blender/bmesh/intern/bmesh_operators_private.h +++ b/source/blender/bmesh/intern/bmesh_operators_private.h @@ -65,6 +65,7 @@ void bmo_extrude_edge_only_exec(BMesh *bm, BMOperator *op); void bmo_extrude_face_region_exec(BMesh *bm, BMOperator *op); void bmo_extrude_vert_indiv_exec(BMesh *bm, BMOperator *op); void bmo_find_doubles_exec(BMesh *bm, BMOperator *op); +void bmo_inset_individual_exec(BMesh *bm, BMOperator *op); void bmo_inset_exec(BMesh *bm, BMOperator *op); void bmo_join_triangles_exec(BMesh *bm, BMOperator *op); void bmo_mesh_to_bmesh_exec(BMesh *bm, BMOperator *op); diff --git a/source/blender/bmesh/operators/bmo_inset.c b/source/blender/bmesh/operators/bmo_inset.c index a3656ce5b74..12d1c8e0376 100644 --- a/source/blender/bmesh/operators/bmo_inset.c +++ b/source/blender/bmesh/operators/bmo_inset.c @@ -24,14 +24,14 @@ * \ingroup bmesh * * Inset face regions. + * Inset individual faces. * - * TODO - * - Inset indervidual faces. */ #include "MEM_guardedalloc.h" #include "BLI_math.h" +#include "BLI_array.h" #include "bmesh.h" @@ -39,6 +39,227 @@ #define ELE_NEW 1 + + +/* -------------------------------------------------------------------- */ +/* Inset Indervidual */ + + +/* Holds Per-Face Inset Edge Data */ +typedef struct EdgeInsetInfo { + float no[3]; + BMEdge *e_old; + BMEdge *e_new; +} EdgeInsetInfo; + +/** + * Individual Face Inset. + * Find all tagged faces (f), duplicate edges around faces, inset verts of + * created edges, create new faces between old and new edges, fill face + * between connected new edges, kill old face (f). + */ +void bmo_inset_individual_exec(BMesh *bm, BMOperator *op) +{ + BMEdge **f_edges = NULL; + BMVert **f_verts = NULL; + BMFace *f; + + BMOIter oiter; + EdgeInsetInfo *eiinfo_arr = NULL; + + BLI_array_declare(eiinfo_arr); + BLI_array_declare(f_edges); + BLI_array_declare(f_verts); + + const float thickness = BMO_slot_float_get(op->slots_in, "thickness"); + const float depth = BMO_slot_float_get(op->slots_in, "depth"); + const bool use_even_offset = BMO_slot_bool_get(op->slots_in, "use_even_offset"); + + /* Only tag faces in slot */ + BM_mesh_elem_hflag_disable_all(bm, BM_FACE, BM_ELEM_TAG, false); + + BMO_slot_buffer_hflag_enable(bm, op->slots_in, "faces", BM_FACE, BM_ELEM_TAG, false); + + BMO_ITER(f, &oiter, op->slots_in, "faces", BM_FACE) { + BMLoop *l_iter, *l_first; + BMLoop *l_iter_inner = NULL; + int i; + + BLI_array_empty(f_verts); + BLI_array_empty(f_edges); + BLI_array_empty(eiinfo_arr); + BLI_array_grow_items(f_verts, f->len); + BLI_array_grow_items(f_edges, f->len); + BLI_array_grow_items(eiinfo_arr, f->len); + + /* create verts */ + i = 0; + l_iter = l_first = BM_FACE_FIRST_LOOP(f); + do { + f_verts[i] = BM_vert_create(bm, l_iter->v->co, l_iter->v, 0); + i++; + } while ((l_iter = l_iter->next) != l_first); + + /* make edges */ + i = 0; + l_iter = l_first; + do { + f_edges[i] = BM_edge_create(bm, f_verts[i], f_verts[(i + 1) % f->len], l_iter->e, 0); + + eiinfo_arr[i].e_new = f_edges[i]; + eiinfo_arr[i].e_old = l_iter->e; + BM_edge_calc_face_tangent(l_iter->e, l_iter, eiinfo_arr[i].no); + + /* Tagging (old elements) required when iterating over edges + * connected to verts for translation vector calculation */ + BM_elem_flag_enable(l_iter->e, BM_ELEM_TAG); + BM_elem_index_set(l_iter->e, i); /* set_dirty! */ + i++; + } while ((l_iter = l_iter->next) != l_first); + /* done with edges */ + + bm->elem_index_dirty |= BM_EDGE; + + /* Calculate translation vector for new */ + l_iter = l_first; + do { + EdgeInsetInfo *ei_prev = &eiinfo_arr[BM_elem_index_get(l_iter->prev->e)]; + EdgeInsetInfo *ei_next = &eiinfo_arr[BM_elem_index_get(l_iter->e)]; + float tvec[3]; + float v_new_co[3]; + int index = 0; + + add_v3_v3v3(tvec, ei_prev->no, ei_next->no); + normalize_v3(tvec); + + /* l->e is traversed in order */ + index = BM_elem_index_get(l_iter->e); + + copy_v3_v3(v_new_co, eiinfo_arr[index].e_new->v1->co); + + if (use_even_offset) { + mul_v3_fl(tvec, shell_angle_to_dist(angle_normalized_v3v3(ei_prev->no, ei_next->no) / 2.0f)); + } + + /* Modify vertices and their normals */ + madd_v3_v3fl(v_new_co, tvec, thickness); + + /* Set normal, add depth and write new vertex position*/ + copy_v3_v3(eiinfo_arr[index].e_new->v1->no, f->no); + + madd_v3_v3fl(v_new_co, f->no, depth); + + copy_v3_v3(eiinfo_arr[index].e_new->v1->co, v_new_co); + } while ((l_iter = l_iter->next) != l_first); + + { + BMFace *f_new_inner; + /* Create New Inset Faces */ + f_new_inner = BM_face_create(bm, f_verts, f_edges, f->len, 0); + if (UNLIKELY(f_new_inner == NULL)) { + BMO_error_raise(bm, op, BMERR_MESH_ERROR, "Inset failed: could not create inner face."); + BLI_array_free(f_edges); + BLI_array_free(f_verts); + BLI_array_free(eiinfo_arr); + return; + } + + /* Copy Face Data */ + BM_elem_attrs_copy(bm, bm, f, f_new_inner); + // Don't tag, gives more useful inner/outer select option + // BMO_elem_flag_enable(bm, f_new_inner, ELE_NEW); + + l_iter_inner = BM_FACE_FIRST_LOOP(f_new_inner); + } + + l_iter = l_first; + do { + BMFace *f_new_outer; + + BMLoop *l_iter_sub; + BMLoop *l_a = NULL; + BMLoop *l_b = NULL; + BMLoop *l_a_other = NULL; + BMLoop *l_b_other = NULL; + BMLoop *l_shared = NULL; + + BM_elem_attrs_copy(bm, bm, l_iter, l_iter_inner); + + f_new_outer = BM_face_create_quad_tri(bm, + l_iter->v, + l_iter->next->v, + l_iter_inner->next->v, + l_iter_inner->v, + f, false); + + if (UNLIKELY(f_new_outer == NULL)) { + BMO_error_raise(bm, op, BMERR_MESH_ERROR, "Inset failed: could not create an outer face."); + BLI_array_free(f_edges); + BLI_array_free(f_verts); + BLI_array_free(eiinfo_arr); + return; + } + + BM_elem_attrs_copy(bm, bm, f, f_new_outer); + BMO_elem_flag_enable(bm, f_new_outer, ELE_NEW); + BM_elem_flag_enable(f_new_outer, BM_ELEM_TAG); + + /* Copy Loop Data */ + l_a = BM_FACE_FIRST_LOOP(f_new_outer); + l_b = l_a->next; + + l_iter_sub = l_iter; + + /* Skip old face f and new inset face. + * If loop if found we are a boundary. This + * is required as opposed to BM_edge_is_boundary() + * Because f_new_outer shares an edge with f */ + do { + if (l_iter_sub->f != f && l_iter_sub->f != f_new_outer) { + l_shared = l_iter_sub; + break; + } + } while ((l_iter_sub = l_iter_sub->radial_next) != l_iter); + + if (l_shared) { + BM_elem_attrs_copy(bm, bm, l_shared, l_a->next); + BM_elem_attrs_copy(bm, bm, l_shared->next, l_a); + } + else { + l_a_other = BM_edge_other_loop(l_a->e, l_a); + l_b_other = l_a_other->next; + BM_elem_attrs_copy(bm, bm, l_a_other, l_a); + BM_elem_attrs_copy(bm, bm, l_b_other, l_b); + } + + /* Move to the last two loops in new face */ + l_a = l_b->next; + l_b = l_a->next; + + /* This loop should always have >1 radials + * (associated edge connects new and old face) */ + BM_elem_attrs_copy(bm, bm, l_iter, l_b); + BM_elem_attrs_copy(bm, bm, l_iter->next, l_a); + + } while ((l_iter_inner = l_iter_inner->next), + (l_iter = l_iter->next) != l_first); + + BM_face_kill(bm, f); + } + + /* we could flag new edges/verts too, is it useful? */ + BMO_slot_buffer_from_enabled_flag(bm, op, op->slots_out, "faces.out", BM_FACE, ELE_NEW); + + BLI_array_free(f_verts); + BLI_array_free(f_edges); + BLI_array_free(eiinfo_arr); +} + + + +/* -------------------------------------------------------------------- */ +/* Inset Region */ + typedef struct SplitEdgeInfo { float no[3]; float length; diff --git a/source/blender/editors/mesh/editmesh_inset.c b/source/blender/editors/mesh/editmesh_inset.c index f7cf32a074f..fd7ca512a13 100644 --- a/source/blender/editors/mesh/editmesh_inset.c +++ b/source/blender/editors/mesh/editmesh_inset.c @@ -80,7 +80,7 @@ static void edbm_inset_update_header(wmOperator *op, bContext *C) InsetData *opdata = op->customdata; const char *str = IFACE_("Confirm: Enter/LClick, Cancel: (Esc/RClick), Thickness: %s, " - "Depth (Ctrl to tweak): %s (%s), Outset (O): (%s), Boundary (B): (%s)"); + "Depth (Ctrl to tweak): %s (%s), Outset (O): (%s), Boundary (B): (%s), Individual (I): (%s)"); char msg[HEADER_LENGTH]; ScrArea *sa = CTX_wm_area(C); @@ -98,7 +98,8 @@ static void edbm_inset_update_header(wmOperator *op, bContext *C) flts_str + NUM_STR_REP_LEN, opdata->modify_depth ? IFACE_("On") : IFACE_("Off"), RNA_boolean_get(op->ptr, "use_outset") ? IFACE_("On") : IFACE_("Off"), - RNA_boolean_get(op->ptr, "use_boundary") ? IFACE_("On") : IFACE_("Off") + RNA_boolean_get(op->ptr, "use_boundary") ? IFACE_("On") : IFACE_("Off"), + RNA_boolean_get(op->ptr, "individual") ? IFACE_("On") : IFACE_("Off") ); ED_area_headerprint(sa, msg); @@ -191,6 +192,7 @@ static int edbm_inset_calc(wmOperator *op) const float depth = RNA_float_get(op->ptr, "depth"); const bool use_outset = RNA_boolean_get(op->ptr, "use_outset"); const bool use_select_inset = RNA_boolean_get(op->ptr, "use_select_inset"); /* not passed onto the BMO */ + const bool individual = RNA_boolean_get(op->ptr, "individual"); opdata = op->customdata; em = opdata->em; @@ -199,12 +201,18 @@ static int edbm_inset_calc(wmOperator *op) EDBM_redo_state_restore(opdata->mesh_backup, em, false); } - EDBM_op_init(em, &bmop, op, - "inset faces=%hf use_boundary=%b use_even_offset=%b use_relative_offset=%b " - "thickness=%f depth=%f use_outset=%b", - BM_ELEM_SELECT, use_boundary, use_even_offset, use_relative_offset, - thickness, depth, use_outset); - + if (individual) { + EDBM_op_init(em, &bmop, op, + "inset_individual faces=%hf thickness=%f depth=%f use_even_offset=%b", + BM_ELEM_SELECT, thickness, depth, use_even_offset); + } + else { + EDBM_op_init(em, &bmop, op, + "inset faces=%hf use_boundary=%b use_even_offset=%b use_relative_offset=%b " + "thickness=%f depth=%f use_outset=%b", + BM_ELEM_SELECT, use_boundary, use_even_offset, use_relative_offset, + thickness, depth, use_outset); + } BMO_op_exec(em->bm, &bmop); if (use_select_inset) { @@ -410,6 +418,20 @@ static int edbm_inset_modal(bContext *C, wmOperator *op, const wmEvent *event) } } break; + case IKEY: + if (event->val == KM_PRESS) { + int individual = RNA_boolean_get(op->ptr, "individual"); + RNA_boolean_set(op->ptr, "individual", !individual); + if (edbm_inset_calc(op)) { + edbm_inset_update_header(op, C); + } + else { + edbm_inset_cancel(C, op); + return OPERATOR_CANCELLED; + } + } + break; + } return OPERATOR_RUNNING_MODAL; @@ -448,4 +470,5 @@ void MESH_OT_inset(wmOperatorType *ot) RNA_def_boolean(ot->srna, "use_outset", false, "Outset", "Outset rather than inset"); RNA_def_boolean(ot->srna, "use_select_inset", true, "Select Outer", "Select the new inset faces"); + RNA_def_boolean(ot->srna, "individual", false, "Individual", "Individual Face Inset"); } -- cgit v1.2.3 From bb81923c3e71619a6aaa47caa1b9ee834b8481c2 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 5 Apr 2013 22:56:01 +0000 Subject: bmesh operator rename inset -> inset_region --- source/blender/bmesh/intern/bmesh_opdefines.c | 22 +++++++++++----------- .../blender/bmesh/intern/bmesh_operators_private.h | 2 +- source/blender/bmesh/operators/bmo_inset.c | 4 ++-- source/blender/editors/mesh/editmesh_inset.c | 2 +- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/source/blender/bmesh/intern/bmesh_opdefines.c b/source/blender/bmesh/intern/bmesh_opdefines.c index 31398b452bd..c76bf15022c 100644 --- a/source/blender/bmesh/intern/bmesh_opdefines.c +++ b/source/blender/bmesh/intern/bmesh_opdefines.c @@ -1508,26 +1508,26 @@ static BMOpDefine bmo_inset_individual_def = { "inset_individual", /* slots_in */ {{"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* input faces */ - {"thickness", BMO_OP_SLOT_FLT}, - {"depth", BMO_OP_SLOT_FLT}, - {"use_even_offset", BMO_OP_SLOT_BOOL}, - {{'\0'}}, + {"thickness", BMO_OP_SLOT_FLT}, + {"depth", BMO_OP_SLOT_FLT}, + {"use_even_offset", BMO_OP_SLOT_BOOL}, + {{'\0'}}, }, /* slots_out */ {{"faces.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* output faces */ - {{'\0'}}, + {{'\0'}}, }, bmo_inset_individual_exec, 0 }; /* - * Face Inset. + * Face Inset (Regions). * - * Inset or outset faces. + * Inset or outset face regions. */ -static BMOpDefine bmo_inset_def = { - "inset", +static BMOpDefine bmo_inset_region_def = { + "inset_region", /* slots_in */ {{"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* input faces */ {"use_boundary", BMO_OP_SLOT_BOOL}, @@ -1542,7 +1542,7 @@ static BMOpDefine bmo_inset_def = { {{"faces.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* output faces */ {{'\0'}}, }, - bmo_inset_exec, + bmo_inset_region_exec, 0 }; @@ -1670,7 +1670,7 @@ const BMOpDefine *bmo_opdefines[] = { &bmo_extrude_vert_indiv_def, &bmo_find_doubles_def, &bmo_inset_individual_def, - &bmo_inset_def, + &bmo_inset_region_def, &bmo_join_triangles_def, &bmo_mesh_to_bmesh_def, &bmo_mirror_def, diff --git a/source/blender/bmesh/intern/bmesh_operators_private.h b/source/blender/bmesh/intern/bmesh_operators_private.h index bae29540b62..6f9628bc468 100644 --- a/source/blender/bmesh/intern/bmesh_operators_private.h +++ b/source/blender/bmesh/intern/bmesh_operators_private.h @@ -66,7 +66,7 @@ void bmo_extrude_face_region_exec(BMesh *bm, BMOperator *op); void bmo_extrude_vert_indiv_exec(BMesh *bm, BMOperator *op); void bmo_find_doubles_exec(BMesh *bm, BMOperator *op); void bmo_inset_individual_exec(BMesh *bm, BMOperator *op); -void bmo_inset_exec(BMesh *bm, BMOperator *op); +void bmo_inset_region_exec(BMesh *bm, BMOperator *op); void bmo_join_triangles_exec(BMesh *bm, BMOperator *op); void bmo_mesh_to_bmesh_exec(BMesh *bm, BMOperator *op); void bmo_mirror_exec(BMesh *bm, BMOperator *op); diff --git a/source/blender/bmesh/operators/bmo_inset.c b/source/blender/bmesh/operators/bmo_inset.c index 12d1c8e0376..d8ed511bc94 100644 --- a/source/blender/bmesh/operators/bmo_inset.c +++ b/source/blender/bmesh/operators/bmo_inset.c @@ -42,7 +42,7 @@ /* -------------------------------------------------------------------- */ -/* Inset Indervidual */ +/* Inset Individual */ /* Holds Per-Face Inset Edge Data */ @@ -316,7 +316,7 @@ static BMLoop *bm_edge_is_mixed_face_tag(BMLoop *l) * - inset the new edges into their faces. */ -void bmo_inset_exec(BMesh *bm, BMOperator *op) +void bmo_inset_region_exec(BMesh *bm, BMOperator *op) { const bool use_outset = BMO_slot_bool_get(op->slots_in, "use_outset"); const bool use_boundary = BMO_slot_bool_get(op->slots_in, "use_boundary") && (use_outset == false); diff --git a/source/blender/editors/mesh/editmesh_inset.c b/source/blender/editors/mesh/editmesh_inset.c index fd7ca512a13..a9093824a9d 100644 --- a/source/blender/editors/mesh/editmesh_inset.c +++ b/source/blender/editors/mesh/editmesh_inset.c @@ -208,7 +208,7 @@ static int edbm_inset_calc(wmOperator *op) } else { EDBM_op_init(em, &bmop, op, - "inset faces=%hf use_boundary=%b use_even_offset=%b use_relative_offset=%b " + "inset_region faces=%hf use_boundary=%b use_even_offset=%b use_relative_offset=%b " "thickness=%f depth=%f use_outset=%b", BM_ELEM_SELECT, use_boundary, use_even_offset, use_relative_offset, thickness, depth, use_outset); -- cgit v1.2.3 From cf3ec257a2b6913c41db93069b0ec7ce4dc6e2ad Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 5 Apr 2013 23:03:10 +0000 Subject: Fix #34880: cycles motion blur render issue with some compilers. Actually is a bigger problem where accessing float4 members with [] stops working due to optimizer, will check that later. --- intern/cycles/util/util_transform.cpp | 2 +- intern/cycles/util/util_transform.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/intern/cycles/util/util_transform.cpp b/intern/cycles/util/util_transform.cpp index ca19146e125..f5e0c8e803e 100644 --- a/intern/cycles/util/util_transform.cpp +++ b/intern/cycles/util/util_transform.cpp @@ -155,7 +155,7 @@ Transform transform_inverse(const Transform& tfm) /* Motion Transform */ -static float4 transform_to_quat(const Transform& tfm) +float4 transform_to_quat(const Transform& tfm) { double trace = tfm[0][0] + tfm[1][1] + tfm[2][2]; float4 qt; diff --git a/intern/cycles/util/util_transform.h b/intern/cycles/util/util_transform.h index 1f19f85f894..617ba43a5ed 100644 --- a/intern/cycles/util/util_transform.h +++ b/intern/cycles/util/util_transform.h @@ -454,6 +454,7 @@ __device_inline bool operator==(const MotionTransform& A, const MotionTransform& return (A.pre == B.pre && A.post == B.post); } +float4 transform_to_quat(const Transform& tfm); void transform_motion_decompose(DecompMotionTransform *decomp, const MotionTransform *motion, const Transform *mid); #endif -- cgit v1.2.3 From 1d5f988778ef0e4779e708db9f1921e5713e373c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 6 Apr 2013 02:45:43 +0000 Subject: patch [#34890] BMesh Poke Face. by Francisco De La Cruz (xercesblue), with some of my own changes/improvements. Converts faces to triangle-fans (useful to run on ngons). To access select a group of faces and press "Alt+P" or alternatively select the operator from the Faces menu (Ctrl+F) --- release/scripts/startup/bl_ui/space_view3d.py | 1 + source/blender/bmesh/CMakeLists.txt | 1 + source/blender/bmesh/intern/bmesh_opdefines.c | 23 ++++ source/blender/bmesh/intern/bmesh_operators.h | 7 ++ .../blender/bmesh/intern/bmesh_operators_private.h | 1 + source/blender/bmesh/operators/bmo_poke.c | 124 +++++++++++++++++++++ source/blender/editors/mesh/editmesh_tools.c | 57 ++++++++++ source/blender/editors/mesh/mesh_intern.h | 1 + source/blender/editors/mesh/mesh_ops.c | 3 +- 9 files changed, 217 insertions(+), 1 deletion(-) create mode 100644 source/blender/bmesh/operators/bmo_poke.c diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index d3350a77ba7..abfbe7efaa9 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -1946,6 +1946,7 @@ class VIEW3D_MT_edit_mesh_faces(Menu): layout.separator() + layout.operator("mesh.poke") layout.operator("mesh.quads_convert_to_tris") layout.operator("mesh.tris_convert_to_quads") diff --git a/source/blender/bmesh/CMakeLists.txt b/source/blender/bmesh/CMakeLists.txt index 4c2115b5052..b0e78a43337 100644 --- a/source/blender/bmesh/CMakeLists.txt +++ b/source/blender/bmesh/CMakeLists.txt @@ -54,6 +54,7 @@ set(SRC operators/bmo_join_triangles.c operators/bmo_mesh_conv.c operators/bmo_mirror.c + operators/bmo_poke.c operators/bmo_primitive.c operators/bmo_removedoubles.c operators/bmo_similar.c diff --git a/source/blender/bmesh/intern/bmesh_opdefines.c b/source/blender/bmesh/intern/bmesh_opdefines.c index c76bf15022c..83f57baea18 100644 --- a/source/blender/bmesh/intern/bmesh_opdefines.c +++ b/source/blender/bmesh/intern/bmesh_opdefines.c @@ -1571,6 +1571,28 @@ static BMOpDefine bmo_wireframe_def = { 0 }; +/* + * Pokes a face. + * + * Splits a face into a triangle fan. + */ +static BMOpDefine bmo_poke_def = { + "poke", + /* slots_in */ + {{"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* input faces */ + {"offset", BMO_OP_SLOT_FLT}, /* center vertex offset along normal */ + {"center_mode", BMO_OP_SLOT_INT}, /* calculation mode for center vertex */ + {{'\0'}}, + }, + /* slots_out */ + {{"verts.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}}, /* output verts */ + {"faces.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* output faces */ + {{'\0'}}, + }, + bmo_poke_exec, + 0 +}; + #ifdef WITH_BULLET /* * Convex Hull @@ -1677,6 +1699,7 @@ const BMOpDefine *bmo_opdefines[] = { &bmo_object_load_bmesh_def, &bmo_pointmerge_def, &bmo_pointmerge_facedata_def, + &bmo_poke_def, &bmo_recalc_face_normals_def, &bmo_region_extend_def, &bmo_remove_doubles_def, diff --git a/source/blender/bmesh/intern/bmesh_operators.h b/source/blender/bmesh/intern/bmesh_operators.h index d02b0dce728..2063ab49169 100644 --- a/source/blender/bmesh/intern/bmesh_operators.h +++ b/source/blender/bmesh/intern/bmesh_operators.h @@ -89,6 +89,13 @@ enum { VPATH_SELECT_TOPOLOGICAL }; +/* Poke face center calculation */ +enum { + BMOP_POKE_MEAN_WEIGHTED = 0, + BMOP_POKE_MEAN, + BMOP_POKE_BOUNDS +}; + extern const BMOpDefine *bmo_opdefines[]; extern const int bmo_opdefines_total; diff --git a/source/blender/bmesh/intern/bmesh_operators_private.h b/source/blender/bmesh/intern/bmesh_operators_private.h index 6f9628bc468..2a67407b261 100644 --- a/source/blender/bmesh/intern/bmesh_operators_private.h +++ b/source/blender/bmesh/intern/bmesh_operators_private.h @@ -74,6 +74,7 @@ void bmo_object_load_bmesh_exec(BMesh *bm, BMOperator *op); void bmo_pointmerge_exec(BMesh *bm, BMOperator *op); void bmo_pointmerge_facedata_exec(BMesh *bm, BMOperator *op); void bmo_recalc_face_normals_exec(BMesh *bm, BMOperator *op); +void bmo_poke_exec(BMesh *bm, BMOperator *op); void bmo_region_extend_exec(BMesh *bm, BMOperator *op); void bmo_remove_doubles_exec(BMesh *bm, BMOperator *op); void bmo_reverse_colors_exec(BMesh *bm, BMOperator *op); diff --git a/source/blender/bmesh/operators/bmo_poke.c b/source/blender/bmesh/operators/bmo_poke.c new file mode 100644 index 00000000000..939bfb3b63e --- /dev/null +++ b/source/blender/bmesh/operators/bmo_poke.c @@ -0,0 +1,124 @@ +/* + * ***** 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. + * + * Contributor(s): Francisco De La Cruz + * + * ***** END GPL LICENSE BLOCK ***** + */ + +/** \file blender/bmesh/operators/bmo_poke.c + * \ingroup bmesh + * + * Pokes a face. + * + * Splits a face into a triangle fan. + */ + +#include "MEM_guardedalloc.h" + +#include "BLI_math.h" +#include "BLI_array.h" + +#include "bmesh.h" + +#include "intern/bmesh_operators_private.h" /* own include */ + +#define ELE_NEW 1 + +/** + * Pokes a face + * + * Splits a face into a triangle fan. + * Iterate over all selected faces, create a new center vertex and + * create triangles between original face edges and new center vertex. + */ +void bmo_poke_exec(BMesh *bm, BMOperator *op) +{ + BMOIter oiter; + BMFace *f; + + const float offset = BMO_slot_float_get(op->slots_in, "offset"); + const int center_mode = BMO_slot_int_get(op->slots_in, "center_mode"); + + void (*bm_face_calc_center_fn)(BMFace *f, float r_cent[3]); + + switch (center_mode) { + case BMOP_POKE_MEAN_WEIGHTED: + bm_face_calc_center_fn = BM_face_calc_center_mean_weighted; + break; + case BMOP_POKE_BOUNDS: + bm_face_calc_center_fn = BM_face_calc_center_bounds; + break; + case BMOP_POKE_MEAN: + bm_face_calc_center_fn = BM_face_calc_center_mean; + break; + default: + BLI_assert(0); + break; + } + + BMO_ITER(f, &oiter, op->slots_in, "faces", BM_FACE) { + BMFace *f_new; + float f_center[3]; + BMVert *v_center = NULL; + BMLoop *l_iter, *l_first; + /* only interpolate the centeral loop from the face once, + * then copy to all others in the fan */ + BMLoop *l_center_example; + + int i; + + bm_face_calc_center_fn(f, f_center); + v_center = BM_vert_create(bm, f_center, NULL, 0); + BMO_elem_flag_enable(bm, v_center, ELE_NEW); + + /* handled by BM_loop_interp_from_face */ + // BM_vert_interp_from_face(bm, v_center, f); + + i = 0; + l_iter = l_first = BM_FACE_FIRST_LOOP(f); + do { + BMLoop *l_new; + + f_new = BM_face_create_quad_tri(bm, l_iter->v, l_iter->next->v, v_center, NULL, f, false); + l_new = BM_FACE_FIRST_LOOP(f_new); + + if (i == 0) { + l_center_example = l_new->prev; + BM_loop_interp_from_face(bm, l_center_example, f, true, true); + } + else { + BM_elem_attrs_copy(bm, bm, l_center_example, l_new->prev); + } + + /* Copy Loop Data */ + BM_elem_attrs_copy(bm, bm, l_iter, l_new); + BM_elem_attrs_copy(bm, bm, l_iter->next, l_new->next); + + BMO_elem_flag_enable(bm, f_new, ELE_NEW); + } while (i++, (l_iter = l_iter->next) != l_first); + + copy_v3_v3(v_center->no, f->no); + madd_v3_v3fl(v_center->co, v_center->no, offset); + + /* Kill Face */ + BM_face_kill(bm, f); + } + + BMO_slot_buffer_from_enabled_flag(bm, op, op->slots_out, "verts.out", BM_VERT, ELE_NEW); + BMO_slot_buffer_from_enabled_flag(bm, op, op->slots_out, "faces.out", BM_FACE, ELE_NEW); +} diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index a7264d3b006..2dbe2852303 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -2631,6 +2631,37 @@ void MESH_OT_beautify_fill(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } + +/********************** Poke Face **********************/ + +static int edbm_poke_face_exec(bContext *C, wmOperator *op) +{ + Object *obedit = CTX_data_edit_object(C); + BMEditMesh *em = BMEdit_FromObject(obedit); + BMOperator bmop; + + const float offset = RNA_float_get(op->ptr, "offset"); + const int center_mode = RNA_enum_get(op->ptr, "center_mode"); + + EDBM_op_init(em, &bmop, op, "poke faces=%hf offset=%f center_mode=%i", BM_ELEM_SELECT, offset, center_mode); + BMO_op_exec(em->bm, &bmop); + + EDBM_flag_disable_all(em, BM_ELEM_SELECT); + + BMO_slot_buffer_hflag_enable(em->bm, bmop.slots_out, "verts.out", BM_VERT, BM_ELEM_SELECT, true); + BMO_slot_buffer_hflag_enable(em->bm, bmop.slots_out, "faces.out", BM_FACE, BM_ELEM_SELECT, true); + + if (!EDBM_op_finish(em, &bmop, op, true)) { + return OPERATOR_CANCELLED; + } + + EDBM_mesh_normals_update(em); + + EDBM_update_generic(em, true, true); + + return OPERATOR_FINISHED; + +} /********************** Quad/Tri Operators *************************/ static int edbm_quads_convert_to_tris_exec(bContext *C, wmOperator *op) @@ -2659,6 +2690,32 @@ static int edbm_quads_convert_to_tris_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } +void MESH_OT_poke(wmOperatorType *ot) +{ + + static EnumPropertyItem poke_center_modes[] = { + {BMOP_POKE_MEAN_WEIGHTED, "MEAN_WEIGHTED", 0, "Weighted Mean", "Weighted Mean Face Center"}, + {BMOP_POKE_MEAN, "MEAN", 0, "Mean", "Mean Face Center"}, + {BMOP_POKE_BOUNDS, "BOUNDS", 0, "Bounds", "Face Bounds Center"}, + {0, NULL, 0, NULL, NULL}}; + + + /* identifiers */ + ot->name = "Poke Faces"; + ot->idname = "MESH_OT_poke"; + ot->description = "Splits a face into a fan"; + + /* api callbacks */ + ot->exec = edbm_poke_face_exec; + ot->poll = ED_operator_editmesh; + + /* flags */ + ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; + + RNA_def_float(ot->srna, "offset", 0.0f, -FLT_MAX, FLT_MAX, "Poke Offset", "Poke Offset", -1.0f, 1.0f); + RNA_def_enum(ot->srna, "center_mode", poke_center_modes, BMOP_POKE_MEAN_WEIGHTED, "Poke Center", "Poke Face Center Calculation"); +} + void MESH_OT_quads_convert_to_tris(wmOperatorType *ot) { /* identifiers */ diff --git a/source/blender/editors/mesh/mesh_intern.h b/source/blender/editors/mesh/mesh_intern.h index 996ee9fc549..937fbf8146b 100644 --- a/source/blender/editors/mesh/mesh_intern.h +++ b/source/blender/editors/mesh/mesh_intern.h @@ -202,6 +202,7 @@ void MESH_OT_edge_face_add(struct wmOperatorType *ot); void MESH_OT_duplicate(struct wmOperatorType *ot); void MESH_OT_merge(struct wmOperatorType *ot); void MESH_OT_remove_doubles(struct wmOperatorType *ot); +void MESH_OT_poke(struct wmOperatorType *ot); /* *** mesh_data.c *** */ diff --git a/source/blender/editors/mesh/mesh_ops.c b/source/blender/editors/mesh/mesh_ops.c index a79923a4fdb..db6f6e3aeb5 100644 --- a/source/blender/editors/mesh/mesh_ops.c +++ b/source/blender/editors/mesh/mesh_ops.c @@ -152,6 +152,7 @@ void ED_operatortypes_mesh(void) WM_operatortype_append(MESH_OT_bridge_edge_loops); WM_operatortype_append(MESH_OT_inset); + WM_operatortype_append(MESH_OT_poke); WM_operatortype_append(MESH_OT_wireframe); WM_operatortype_append(MESH_OT_edge_split); @@ -260,7 +261,7 @@ void ED_keymap_mesh(wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "MESH_OT_loopcut_slide", RKEY, KM_PRESS, KM_CTRL, 0); WM_keymap_add_item(keymap, "MESH_OT_inset", IKEY, KM_PRESS, 0, 0); - + WM_keymap_add_item(keymap, "MESH_OT_poke", PKEY, KM_PRESS, KM_ALT, 0); kmi = WM_keymap_add_item(keymap, "MESH_OT_bevel", BKEY, KM_PRESS, KM_CTRL, 0); RNA_boolean_set(kmi->ptr, "vertex_only", false); kmi = WM_keymap_add_item(keymap, "MESH_OT_bevel", BKEY, KM_PRESS, KM_CTRL | KM_SHIFT, 0); -- cgit v1.2.3 From 6002927521004bfb13475df8bf4d6c1ee05378fb Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 6 Apr 2013 03:03:37 +0000 Subject: add relative offset option for poke tool. --- source/blender/bmesh/intern/bmesh_opdefines.c | 3 +- source/blender/bmesh/operators/bmo_poke.c | 24 ++++++++++- source/blender/editors/mesh/editmesh_tools.c | 57 +++++++++++++++------------ 3 files changed, 55 insertions(+), 29 deletions(-) diff --git a/source/blender/bmesh/intern/bmesh_opdefines.c b/source/blender/bmesh/intern/bmesh_opdefines.c index 83f57baea18..a84958f6827 100644 --- a/source/blender/bmesh/intern/bmesh_opdefines.c +++ b/source/blender/bmesh/intern/bmesh_opdefines.c @@ -1581,7 +1581,8 @@ static BMOpDefine bmo_poke_def = { /* slots_in */ {{"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* input faces */ {"offset", BMO_OP_SLOT_FLT}, /* center vertex offset along normal */ - {"center_mode", BMO_OP_SLOT_INT}, /* calculation mode for center vertex */ + {"center_mode", BMO_OP_SLOT_INT}, /* calculation mode for center vertex */ + {"use_relative_offset", BMO_OP_SLOT_BOOL}, /* apply offset */ {{'\0'}}, }, /* slots_out */ diff --git a/source/blender/bmesh/operators/bmo_poke.c b/source/blender/bmesh/operators/bmo_poke.c index 939bfb3b63e..122c14021c0 100644 --- a/source/blender/bmesh/operators/bmo_poke.c +++ b/source/blender/bmesh/operators/bmo_poke.c @@ -52,8 +52,8 @@ void bmo_poke_exec(BMesh *bm, BMOperator *op) BMFace *f; const float offset = BMO_slot_float_get(op->slots_in, "offset"); + const bool use_relative_offset = BMO_slot_bool_get(op->slots_in, "use_relative_offset"); const int center_mode = BMO_slot_int_get(op->slots_in, "center_mode"); - void (*bm_face_calc_center_fn)(BMFace *f, float r_cent[3]); switch (center_mode) { @@ -80,6 +80,9 @@ void bmo_poke_exec(BMesh *bm, BMOperator *op) * then copy to all others in the fan */ BMLoop *l_center_example; + /* 1.0 or the average length from the center to the face verts */ + float offset_fac; + int i; bm_face_calc_center_fn(f, f_center); @@ -89,6 +92,13 @@ void bmo_poke_exec(BMesh *bm, BMOperator *op) /* handled by BM_loop_interp_from_face */ // BM_vert_interp_from_face(bm, v_center, f); + if (use_relative_offset) { + offset_fac = 0.0f; + } + else { + offset_fac = 1.0f; + } + i = 0; l_iter = l_first = BM_FACE_FIRST_LOOP(f); do { @@ -110,10 +120,20 @@ void bmo_poke_exec(BMesh *bm, BMOperator *op) BM_elem_attrs_copy(bm, bm, l_iter->next, l_new->next); BMO_elem_flag_enable(bm, f_new, ELE_NEW); + + if (use_relative_offset) { + offset_fac += len_v3v3(f_center, l_iter->v->co); + } + } while (i++, (l_iter = l_iter->next) != l_first); + if (use_relative_offset) { + offset_fac /= (float)f->len; + } + /* else remain at 1.0 */ + copy_v3_v3(v_center->no, f->no); - madd_v3_v3fl(v_center->co, v_center->no, offset); + madd_v3_v3fl(v_center->co, v_center->no, offset * offset_fac); /* Kill Face */ BM_face_kill(bm, f); diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index 2dbe2852303..0fff62f411c 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -2641,9 +2641,11 @@ static int edbm_poke_face_exec(bContext *C, wmOperator *op) BMOperator bmop; const float offset = RNA_float_get(op->ptr, "offset"); + const bool use_relative_offset = RNA_boolean_get(op->ptr, "use_relative_offset"); const int center_mode = RNA_enum_get(op->ptr, "center_mode"); - EDBM_op_init(em, &bmop, op, "poke faces=%hf offset=%f center_mode=%i", BM_ELEM_SELECT, offset, center_mode); + EDBM_op_init(em, &bmop, op, "poke faces=%hf offset=%f use_relative_offset=%b center_mode=%i", + BM_ELEM_SELECT, offset, use_relative_offset, center_mode); BMO_op_exec(em->bm, &bmop); EDBM_flag_disable_all(em, BM_ELEM_SELECT); @@ -2662,6 +2664,34 @@ static int edbm_poke_face_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } + +void MESH_OT_poke(wmOperatorType *ot) +{ + + static EnumPropertyItem poke_center_modes[] = { + {BMOP_POKE_MEAN_WEIGHTED, "MEAN_WEIGHTED", 0, "Weighted Mean", "Weighted Mean Face Center"}, + {BMOP_POKE_MEAN, "MEAN", 0, "Mean", "Mean Face Center"}, + {BMOP_POKE_BOUNDS, "BOUNDS", 0, "Bounds", "Face Bounds Center"}, + {0, NULL, 0, NULL, NULL}}; + + + /* identifiers */ + ot->name = "Poke Faces"; + ot->idname = "MESH_OT_poke"; + ot->description = "Splits a face into a fan"; + + /* api callbacks */ + ot->exec = edbm_poke_face_exec; + ot->poll = ED_operator_editmesh; + + /* flags */ + ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; + + RNA_def_float(ot->srna, "offset", 0.0f, -FLT_MAX, FLT_MAX, "Poke Offset", "Poke Offset", -1.0f, 1.0f); + RNA_def_boolean(ot->srna, "use_relative_offset", false, "Offset Relative", "Scale the offset by surrounding geometry"); + RNA_def_enum(ot->srna, "center_mode", poke_center_modes, BMOP_POKE_MEAN_WEIGHTED, "Poke Center", "Poke Face Center Calculation"); +} + /********************** Quad/Tri Operators *************************/ static int edbm_quads_convert_to_tris_exec(bContext *C, wmOperator *op) @@ -2690,31 +2720,6 @@ static int edbm_quads_convert_to_tris_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void MESH_OT_poke(wmOperatorType *ot) -{ - - static EnumPropertyItem poke_center_modes[] = { - {BMOP_POKE_MEAN_WEIGHTED, "MEAN_WEIGHTED", 0, "Weighted Mean", "Weighted Mean Face Center"}, - {BMOP_POKE_MEAN, "MEAN", 0, "Mean", "Mean Face Center"}, - {BMOP_POKE_BOUNDS, "BOUNDS", 0, "Bounds", "Face Bounds Center"}, - {0, NULL, 0, NULL, NULL}}; - - - /* identifiers */ - ot->name = "Poke Faces"; - ot->idname = "MESH_OT_poke"; - ot->description = "Splits a face into a fan"; - - /* api callbacks */ - ot->exec = edbm_poke_face_exec; - ot->poll = ED_operator_editmesh; - - /* flags */ - ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; - - RNA_def_float(ot->srna, "offset", 0.0f, -FLT_MAX, FLT_MAX, "Poke Offset", "Poke Offset", -1.0f, 1.0f); - RNA_def_enum(ot->srna, "center_mode", poke_center_modes, BMOP_POKE_MEAN_WEIGHTED, "Poke Center", "Poke Face Center Calculation"); -} void MESH_OT_quads_convert_to_tris(wmOperatorType *ot) { -- cgit v1.2.3 From 129f4012283e92a806b48777fc173102887cf004 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 6 Apr 2013 08:22:39 +0000 Subject: ctrl+a select all in button field --- source/blender/bmesh/operators/bmo_poke.c | 3 --- source/blender/editors/interface/interface_handlers.c | 11 +++++++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/source/blender/bmesh/operators/bmo_poke.c b/source/blender/bmesh/operators/bmo_poke.c index 122c14021c0..7105210da04 100644 --- a/source/blender/bmesh/operators/bmo_poke.c +++ b/source/blender/bmesh/operators/bmo_poke.c @@ -28,10 +28,7 @@ * Splits a face into a triangle fan. */ -#include "MEM_guardedalloc.h" - #include "BLI_math.h" -#include "BLI_array.h" #include "bmesh.h" diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index c40d91378b1..16f3cb9c7c2 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -2233,6 +2233,17 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandle retval = WM_UI_HANDLER_BREAK; break; + case AKEY: + /* Ctrl + A: Select all */ + if (event->ctrl && !(event->alt || event->shift || event->oskey)) { + ui_textedit_move(but, data, STRCUR_DIR_PREV, + false, STRCUR_JUMP_ALL); + ui_textedit_move(but, data, STRCUR_DIR_NEXT, + true, STRCUR_JUMP_ALL); + retval = WM_UI_HANDLER_BREAK; + } + break; + case TABKEY: /* there is a key conflict here, we can't tab with autocomplete */ if (but->autocomplete_func || data->searchbox) { -- cgit v1.2.3 From 2d76a828ca5ff8305a959079318176eda6d0d17d Mon Sep 17 00:00:00 2001 From: Gaia Clary Date: Sat, 6 Apr 2013 10:52:52 +0000 Subject: Fix: 34874 Weight Paint UI inconsistent: removed conflicting shortcut definition, added weight assign tools to specials menu --- release/scripts/startup/bl_ui/space_view3d.py | 6 ++++++ source/blender/editors/sculpt_paint/paint_ops.c | 2 -- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index abfbe7efaa9..155be986ee1 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -1641,6 +1641,12 @@ class VIEW3D_MT_pose_specials(Menu): def draw(self, context): layout = self.layout + + layout.operator("paint.weight_from_bones", text="Assign Automatic from Bones").type="AUTOMATIC" + layout.operator("paint.weight_from_bones", text="Assign from Bone Envelopes").type="ENVELOPES" + + layout.separator() + layout.operator("pose.select_constraint_target") layout.operator("pose.flip_names") layout.operator("pose.paths_calculate") diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c index 796bb99ebaf..f480725277e 100644 --- a/source/blender/editors/sculpt_paint/paint_ops.c +++ b/source/blender/editors/sculpt_paint/paint_ops.c @@ -993,8 +993,6 @@ void ED_keymap_paint(wmKeyConfig *keyconf) kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", VKEY, KM_PRESS, 0, 0); /* vert mask toggle */ RNA_string_set(kmi->ptr, "data_path", "weight_paint_object.data.use_paint_mask_vertex"); - WM_keymap_verify_item(keymap, "PAINT_OT_weight_from_bones", WKEY, KM_PRESS, 0, 0); - kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", SKEY, KM_PRESS, KM_SHIFT, 0); RNA_string_set(kmi->ptr, "data_path", "tool_settings.weight_paint.brush.use_smooth_stroke"); -- cgit v1.2.3 From 92b6365e219a341800dcfc0582045fa366ae6222 Mon Sep 17 00:00:00 2001 From: Gaia Clary Date: Sat, 6 Apr 2013 11:52:40 +0000 Subject: fix: #34871 Cycles/CUDA/sm_35: Build problems probably due to issues with float3 operators (on windows?) --- intern/cycles/kernel/kernel_camera.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/intern/cycles/kernel/kernel_camera.h b/intern/cycles/kernel/kernel_camera.h index 800daf40887..fe31419b11e 100644 --- a/intern/cycles/kernel/kernel_camera.h +++ b/intern/cycles/kernel/kernel_camera.h @@ -100,7 +100,6 @@ __device void camera_sample_orthographic(KernelGlobals *kg, float raster_x, floa Transform rastertocamera = kernel_data.cam.rastertocamera; float3 Pcamera = transform_perspective(&rastertocamera, make_float3(raster_x, raster_y, 0.0f)); - ray->P = Pcamera; ray->D = make_float3(0.0f, 0.0f, 1.0f); /* modify ray for depth of field */ @@ -116,11 +115,12 @@ __device void camera_sample_orthographic(KernelGlobals *kg, float raster_x, floa /* update ray for effect of lens */ float3 lensuvw = make_float3(lensuv.x, lensuv.y, 0.0f); - - ray->P += lensuvw; + ray->P = Pcamera + lensuvw; ray->D = normalize(Pfocus - lensuvw); } - + else { + ray->P = Pcamera; + } /* transform ray from camera to world */ Transform cameratoworld = kernel_data.cam.cameratoworld; -- cgit v1.2.3 From 2ed2226ee753cc6a7a19806d99772efa61af897f Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Sat, 6 Apr 2013 12:07:42 +0000 Subject: Node UI: * After PyNodes merge, many node sockets had sliders, instead of the arrow buttons (as the PROP_FACTOR subtype now actually was used). Change those back now, after artists feedback. --- .../blender/nodes/composite/nodes/node_composite_alphaOver.c | 2 +- source/blender/nodes/composite/nodes/node_composite_blur.c | 2 +- .../nodes/composite/nodes/node_composite_colorSpill.c | 2 +- .../nodes/composite/nodes/node_composite_colorbalance.c | 2 +- .../nodes/composite/nodes/node_composite_colorcorrection.c | 2 +- .../blender/nodes/composite/nodes/node_composite_composite.c | 4 ++-- source/blender/nodes/composite/nodes/node_composite_curves.c | 2 +- .../blender/nodes/composite/nodes/node_composite_defocus.c | 2 +- .../blender/nodes/composite/nodes/node_composite_despeckle.c | 2 +- source/blender/nodes/composite/nodes/node_composite_dilate.c | 2 +- .../blender/nodes/composite/nodes/node_composite_displace.c | 4 ++-- source/blender/nodes/composite/nodes/node_composite_filter.c | 2 +- .../blender/nodes/composite/nodes/node_composite_hueSatVal.c | 2 +- .../nodes/composite/nodes/node_composite_huecorrect.c | 2 +- source/blender/nodes/composite/nodes/node_composite_invert.c | 2 +- source/blender/nodes/composite/nodes/node_composite_mixrgb.c | 2 +- .../blender/nodes/composite/nodes/node_composite_pixelate.c | 2 +- source/blender/nodes/composite/nodes/node_composite_scale.c | 4 ++-- .../blender/nodes/composite/nodes/node_composite_valToRgb.c | 2 +- source/blender/nodes/shader/nodes/node_shader_curves.c | 4 ++-- source/blender/nodes/shader/nodes/node_shader_hueSatVal.c | 6 +++--- source/blender/nodes/shader/nodes/node_shader_invert.c | 2 +- source/blender/nodes/shader/nodes/node_shader_material.c | 12 ++++++------ source/blender/nodes/shader/nodes/node_shader_mixRgb.c | 2 +- source/blender/nodes/shader/nodes/node_shader_mix_shader.c | 2 +- source/blender/nodes/shader/nodes/node_shader_output.c | 2 +- source/blender/nodes/shader/nodes/node_shader_valToRgb.c | 2 +- source/blender/nodes/texture/nodes/node_texture_hueSatVal.c | 6 +++--- source/blender/nodes/texture/nodes/node_texture_mixRgb.c | 2 +- source/blender/nodes/texture/nodes/node_texture_valToRgb.c | 2 +- 30 files changed, 43 insertions(+), 43 deletions(-) diff --git a/source/blender/nodes/composite/nodes/node_composite_alphaOver.c b/source/blender/nodes/composite/nodes/node_composite_alphaOver.c index cdfcf045e35..b1732a3b184 100644 --- a/source/blender/nodes/composite/nodes/node_composite_alphaOver.c +++ b/source/blender/nodes/composite/nodes/node_composite_alphaOver.c @@ -33,7 +33,7 @@ /* **************** ALPHAOVER ******************** */ static bNodeSocketTemplate cmp_node_alphaover_in[] = { - { SOCK_FLOAT, 1, N_("Fac"), 1.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f, PROP_FACTOR}, + { SOCK_FLOAT, 1, N_("Fac"), 1.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f, PROP_NONE}, { SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f}, { SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f}, { -1, 0, "" } diff --git a/source/blender/nodes/composite/nodes/node_composite_blur.c b/source/blender/nodes/composite/nodes/node_composite_blur.c index e544ec7d9d8..8dcad031e01 100644 --- a/source/blender/nodes/composite/nodes/node_composite_blur.c +++ b/source/blender/nodes/composite/nodes/node_composite_blur.c @@ -36,7 +36,7 @@ /* **************** BLUR ******************** */ static bNodeSocketTemplate cmp_node_blur_in[] = { { SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f}, - { SOCK_FLOAT, 1, N_("Size"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR}, + { SOCK_FLOAT, 1, N_("Size"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_NONE}, { -1, 0, "" } }; static bNodeSocketTemplate cmp_node_blur_out[] = { diff --git a/source/blender/nodes/composite/nodes/node_composite_colorSpill.c b/source/blender/nodes/composite/nodes/node_composite_colorSpill.c index 60cfd7c90f3..5cdb7b016cd 100644 --- a/source/blender/nodes/composite/nodes/node_composite_colorSpill.c +++ b/source/blender/nodes/composite/nodes/node_composite_colorSpill.c @@ -34,7 +34,7 @@ /* ******************* Color Spill Supression ********************************* */ static bNodeSocketTemplate cmp_node_color_spill_in[] = { {SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f}, - {SOCK_FLOAT, 1, N_("Fac"), 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_FACTOR}, + {SOCK_FLOAT, 1, N_("Fac"), 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_NONE}, {-1, 0, ""} }; diff --git a/source/blender/nodes/composite/nodes/node_composite_colorbalance.c b/source/blender/nodes/composite/nodes/node_composite_colorbalance.c index 693680f58a8..0ab819d6683 100644 --- a/source/blender/nodes/composite/nodes/node_composite_colorbalance.c +++ b/source/blender/nodes/composite/nodes/node_composite_colorbalance.c @@ -36,7 +36,7 @@ /* ******************* Color Balance ********************************* */ static bNodeSocketTemplate cmp_node_colorbalance_in[] = { - {SOCK_FLOAT, 1, N_("Fac"), 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_FACTOR}, + {SOCK_FLOAT, 1, N_("Fac"), 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_NONE}, {SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f}, {-1, 0, ""} }; diff --git a/source/blender/nodes/composite/nodes/node_composite_colorcorrection.c b/source/blender/nodes/composite/nodes/node_composite_colorcorrection.c index 9b09462ed0f..e122bd51ec6 100644 --- a/source/blender/nodes/composite/nodes/node_composite_colorcorrection.c +++ b/source/blender/nodes/composite/nodes/node_composite_colorcorrection.c @@ -38,7 +38,7 @@ /* ******************* Color Balance ********************************* */ static bNodeSocketTemplate cmp_node_colorcorrection_in[] = { { SOCK_RGBA,1,N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f}, - { SOCK_FLOAT, 1, N_("Mask"), 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_FACTOR}, + { SOCK_FLOAT, 1, N_("Mask"), 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_NONE}, { -1,0,""} }; diff --git a/source/blender/nodes/composite/nodes/node_composite_composite.c b/source/blender/nodes/composite/nodes/node_composite_composite.c index 7fa7a5048ab..83ca9128ce4 100644 --- a/source/blender/nodes/composite/nodes/node_composite_composite.c +++ b/source/blender/nodes/composite/nodes/node_composite_composite.c @@ -34,8 +34,8 @@ /* **************** COMPOSITE ******************** */ static bNodeSocketTemplate cmp_node_composite_in[] = { { SOCK_RGBA, 1, N_("Image"), 0.0f, 0.0f, 0.0f, 1.0f}, - { SOCK_FLOAT, 1, N_("Alpha"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR}, - { SOCK_FLOAT, 1, N_("Z"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR}, + { SOCK_FLOAT, 1, N_("Alpha"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_NONE}, + { SOCK_FLOAT, 1, N_("Z"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_NONE}, { -1, 0, "" } }; diff --git a/source/blender/nodes/composite/nodes/node_composite_curves.c b/source/blender/nodes/composite/nodes/node_composite_curves.c index 2bf901491bf..483965f4adf 100644 --- a/source/blender/nodes/composite/nodes/node_composite_curves.c +++ b/source/blender/nodes/composite/nodes/node_composite_curves.c @@ -95,7 +95,7 @@ void register_node_type_cmp_curve_vec(void) /* **************** CURVE RGB ******************** */ static bNodeSocketTemplate cmp_node_curve_rgb_in[] = { - { SOCK_FLOAT, 1, N_("Fac"), 1.0f, 0.0f, 0.0f, 1.0f, -1.0f, 1.0f, PROP_FACTOR}, + { SOCK_FLOAT, 1, N_("Fac"), 1.0f, 0.0f, 0.0f, 1.0f, -1.0f, 1.0f, PROP_NONE}, { SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f}, { SOCK_RGBA, 1, N_("Black Level"), 0.0f, 0.0f, 0.0f, 1.0f}, { SOCK_RGBA, 1, N_("White Level"), 1.0f, 1.0f, 1.0f, 1.0f}, diff --git a/source/blender/nodes/composite/nodes/node_composite_defocus.c b/source/blender/nodes/composite/nodes/node_composite_defocus.c index 9581ef981cb..a4c34ea523f 100644 --- a/source/blender/nodes/composite/nodes/node_composite_defocus.c +++ b/source/blender/nodes/composite/nodes/node_composite_defocus.c @@ -36,7 +36,7 @@ /* ************ qdn: Defocus node ****************** */ static bNodeSocketTemplate cmp_node_defocus_in[] = { { SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f}, - { SOCK_FLOAT, 1, N_("Z"), 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f, PROP_FACTOR}, + { SOCK_FLOAT, 1, N_("Z"), 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f, PROP_NONE}, { -1, 0, "" } }; static bNodeSocketTemplate cmp_node_defocus_out[] = { diff --git a/source/blender/nodes/composite/nodes/node_composite_despeckle.c b/source/blender/nodes/composite/nodes/node_composite_despeckle.c index 486c69caba0..35539082556 100644 --- a/source/blender/nodes/composite/nodes/node_composite_despeckle.c +++ b/source/blender/nodes/composite/nodes/node_composite_despeckle.c @@ -33,7 +33,7 @@ /* **************** FILTER ******************** */ static bNodeSocketTemplate cmp_node_despeckle_in[] = { - { SOCK_FLOAT, 1, N_("Fac"), 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f, PROP_FACTOR}, + { SOCK_FLOAT, 1, N_("Fac"), 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f, PROP_NONE}, { SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f}, { -1, 0, "" } }; diff --git a/source/blender/nodes/composite/nodes/node_composite_dilate.c b/source/blender/nodes/composite/nodes/node_composite_dilate.c index d9caff0d495..a77fc004ce7 100644 --- a/source/blender/nodes/composite/nodes/node_composite_dilate.c +++ b/source/blender/nodes/composite/nodes/node_composite_dilate.c @@ -36,7 +36,7 @@ /* **************** Dilate/Erode ******************** */ static bNodeSocketTemplate cmp_node_dilateerode_in[] = { - { SOCK_FLOAT, 1, N_("Mask"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_FACTOR}, + { SOCK_FLOAT, 1, N_("Mask"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_NONE}, { -1, 0, "" } }; static bNodeSocketTemplate cmp_node_dilateerode_out[] = { diff --git a/source/blender/nodes/composite/nodes/node_composite_displace.c b/source/blender/nodes/composite/nodes/node_composite_displace.c index 33f82355629..5794b5a7cb8 100644 --- a/source/blender/nodes/composite/nodes/node_composite_displace.c +++ b/source/blender/nodes/composite/nodes/node_composite_displace.c @@ -38,8 +38,8 @@ static bNodeSocketTemplate cmp_node_displace_in[] = { { SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f}, { SOCK_VECTOR, 1, N_("Vector"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_TRANSLATION}, - { SOCK_FLOAT, 1, N_("X Scale"), 0.0f, 0.0f, 0.0f, 0.0f, -1000.0f, 1000.0f, PROP_FACTOR}, - { SOCK_FLOAT, 1, N_("Y Scale"), 0.0f, 0.0f, 0.0f, 0.0f, -1000.0f, 1000.0f, PROP_FACTOR}, + { SOCK_FLOAT, 1, N_("X Scale"), 0.0f, 0.0f, 0.0f, 0.0f, -1000.0f, 1000.0f, PROP_NONE}, + { SOCK_FLOAT, 1, N_("Y Scale"), 0.0f, 0.0f, 0.0f, 0.0f, -1000.0f, 1000.0f, PROP_NONE}, { -1, 0, "" } }; static bNodeSocketTemplate cmp_node_displace_out[] = { diff --git a/source/blender/nodes/composite/nodes/node_composite_filter.c b/source/blender/nodes/composite/nodes/node_composite_filter.c index 408c2ff8d73..16adbc8d53c 100644 --- a/source/blender/nodes/composite/nodes/node_composite_filter.c +++ b/source/blender/nodes/composite/nodes/node_composite_filter.c @@ -34,7 +34,7 @@ /* **************** FILTER ******************** */ static bNodeSocketTemplate cmp_node_filter_in[] = { - { SOCK_FLOAT, 1, N_("Fac"), 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f, PROP_FACTOR}, + { SOCK_FLOAT, 1, N_("Fac"), 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f, PROP_NONE}, { SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f}, { -1, 0, "" } }; diff --git a/source/blender/nodes/composite/nodes/node_composite_hueSatVal.c b/source/blender/nodes/composite/nodes/node_composite_hueSatVal.c index 01c6f639cbb..f499dec1224 100644 --- a/source/blender/nodes/composite/nodes/node_composite_hueSatVal.c +++ b/source/blender/nodes/composite/nodes/node_composite_hueSatVal.c @@ -35,7 +35,7 @@ /* **************** Hue Saturation ******************** */ static bNodeSocketTemplate cmp_node_hue_sat_in[] = { - { SOCK_FLOAT, 1, N_("Fac"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR}, + { SOCK_FLOAT, 1, N_("Fac"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_NONE}, { SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f}, { -1, 0, "" } }; diff --git a/source/blender/nodes/composite/nodes/node_composite_huecorrect.c b/source/blender/nodes/composite/nodes/node_composite_huecorrect.c index 71e4df04911..91e5a2d865a 100644 --- a/source/blender/nodes/composite/nodes/node_composite_huecorrect.c +++ b/source/blender/nodes/composite/nodes/node_composite_huecorrect.c @@ -33,7 +33,7 @@ #include "node_composite_util.h" static bNodeSocketTemplate cmp_node_huecorrect_in[] = { - { SOCK_FLOAT, 1, N_("Fac"), 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_FACTOR}, + { SOCK_FLOAT, 1, N_("Fac"), 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_NONE}, { SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f}, { -1, 0, "" } }; diff --git a/source/blender/nodes/composite/nodes/node_composite_invert.c b/source/blender/nodes/composite/nodes/node_composite_invert.c index 6a3da2c854b..415cb641548 100644 --- a/source/blender/nodes/composite/nodes/node_composite_invert.c +++ b/source/blender/nodes/composite/nodes/node_composite_invert.c @@ -33,7 +33,7 @@ /* **************** INVERT ******************** */ static bNodeSocketTemplate cmp_node_invert_in[] = { - { SOCK_FLOAT, 1, N_("Fac"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR}, + { SOCK_FLOAT, 1, N_("Fac"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_NONE}, { SOCK_RGBA, 1, N_("Color"), 1.0f, 1.0f, 1.0f, 1.0f}, { -1, 0, "" } }; diff --git a/source/blender/nodes/composite/nodes/node_composite_mixrgb.c b/source/blender/nodes/composite/nodes/node_composite_mixrgb.c index a3415761bf8..e9c3e4fd6e0 100644 --- a/source/blender/nodes/composite/nodes/node_composite_mixrgb.c +++ b/source/blender/nodes/composite/nodes/node_composite_mixrgb.c @@ -33,7 +33,7 @@ /* **************** MIX RGB ******************** */ static bNodeSocketTemplate cmp_node_mix_rgb_in[] = { - { SOCK_FLOAT, 1, N_("Fac"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 5.0f, PROP_FACTOR}, + { SOCK_FLOAT, 1, N_("Fac"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 5.0f, PROP_NONE}, { SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f}, { SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f}, { -1, 0, "" } diff --git a/source/blender/nodes/composite/nodes/node_composite_pixelate.c b/source/blender/nodes/composite/nodes/node_composite_pixelate.c index d12c09cb25e..95640e2bd9b 100644 --- a/source/blender/nodes/composite/nodes/node_composite_pixelate.c +++ b/source/blender/nodes/composite/nodes/node_composite_pixelate.c @@ -37,7 +37,7 @@ /* **************** Pixelate ******************** */ static bNodeSocketTemplate cmp_node_pixelate_in[] = { - { SOCK_RGBA, 1, N_("Color"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_FACTOR}, + { SOCK_RGBA, 1, N_("Color"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_NONE}, { -1, 0, "" } }; static bNodeSocketTemplate cmp_node_pixelate_out[] = { diff --git a/source/blender/nodes/composite/nodes/node_composite_scale.c b/source/blender/nodes/composite/nodes/node_composite_scale.c index 0d8763bf321..9b1cb3a34b0 100644 --- a/source/blender/nodes/composite/nodes/node_composite_scale.c +++ b/source/blender/nodes/composite/nodes/node_composite_scale.c @@ -36,8 +36,8 @@ static bNodeSocketTemplate cmp_node_scale_in[] = { { SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f}, - { SOCK_FLOAT, 1, N_("X"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0001f, CMP_SCALE_MAX, PROP_FACTOR}, - { SOCK_FLOAT, 1, N_("Y"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0001f, CMP_SCALE_MAX, PROP_FACTOR}, + { SOCK_FLOAT, 1, N_("X"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0001f, CMP_SCALE_MAX, PROP_NONE}, + { SOCK_FLOAT, 1, N_("Y"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0001f, CMP_SCALE_MAX, PROP_NONE}, { -1, 0, "" } }; static bNodeSocketTemplate cmp_node_scale_out[] = { diff --git a/source/blender/nodes/composite/nodes/node_composite_valToRgb.c b/source/blender/nodes/composite/nodes/node_composite_valToRgb.c index a1d51bdf171..45192cc6252 100644 --- a/source/blender/nodes/composite/nodes/node_composite_valToRgb.c +++ b/source/blender/nodes/composite/nodes/node_composite_valToRgb.c @@ -35,7 +35,7 @@ /* **************** VALTORGB ******************** */ static bNodeSocketTemplate cmp_node_valtorgb_in[] = { - { SOCK_FLOAT, 1, N_("Fac"), 0.5f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR}, + { SOCK_FLOAT, 1, N_("Fac"), 0.5f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_NONE}, { -1, 0, "" } }; static bNodeSocketTemplate cmp_node_valtorgb_out[] = { diff --git a/source/blender/nodes/shader/nodes/node_shader_curves.c b/source/blender/nodes/shader/nodes/node_shader_curves.c index b293b02cfe6..f36f1476bbe 100644 --- a/source/blender/nodes/shader/nodes/node_shader_curves.c +++ b/source/blender/nodes/shader/nodes/node_shader_curves.c @@ -35,7 +35,7 @@ /* **************** CURVE VEC ******************** */ static bNodeSocketTemplate sh_node_curve_vec_in[] = { - { SOCK_FLOAT, 0, N_("Fac"), 1.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f, PROP_FACTOR}, + { SOCK_FLOAT, 0, N_("Fac"), 1.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f, PROP_NONE}, { SOCK_VECTOR, 1, N_("Vector"), 0.0f, 0.0f, 0.0f, 1.0f, -1.0f, 1.0f, PROP_NONE}, { -1, 0, "" } }; @@ -88,7 +88,7 @@ void register_node_type_sh_curve_vec(void) /* **************** CURVE RGB ******************** */ static bNodeSocketTemplate sh_node_curve_rgb_in[] = { - { SOCK_FLOAT, 1, N_("Fac"), 1.0f, 0.0f, 0.0f, 1.0f, -1.0f, 1.0f, PROP_FACTOR}, + { SOCK_FLOAT, 1, N_("Fac"), 1.0f, 0.0f, 0.0f, 1.0f, -1.0f, 1.0f, PROP_NONE}, { SOCK_RGBA, 1, N_("Color"), 0.0f, 0.0f, 0.0f, 1.0f}, { -1, 0, "" } }; diff --git a/source/blender/nodes/shader/nodes/node_shader_hueSatVal.c b/source/blender/nodes/shader/nodes/node_shader_hueSatVal.c index 559d9289fb7..0d6f0c6ca10 100644 --- a/source/blender/nodes/shader/nodes/node_shader_hueSatVal.c +++ b/source/blender/nodes/shader/nodes/node_shader_hueSatVal.c @@ -36,9 +36,9 @@ /* **************** Hue Saturation ******************** */ static bNodeSocketTemplate sh_node_hue_sat_in[] = { { SOCK_FLOAT, 1, N_("Hue"), 0.5f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_NONE}, - { SOCK_FLOAT, 1, N_("Saturation"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 2.0f, PROP_FACTOR}, - { SOCK_FLOAT, 1, N_("Value"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 2.0f, PROP_FACTOR}, - { SOCK_FLOAT, 1, N_("Fac"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR}, + { SOCK_FLOAT, 1, N_("Saturation"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 2.0f, PROP_NONE}, + { SOCK_FLOAT, 1, N_("Value"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 2.0f, PROP_NONE}, + { SOCK_FLOAT, 1, N_("Fac"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_NONE}, { SOCK_RGBA, 1, N_("Color"), 0.8f, 0.8f, 0.8f, 1.0f}, { -1, 0, "" } }; diff --git a/source/blender/nodes/shader/nodes/node_shader_invert.c b/source/blender/nodes/shader/nodes/node_shader_invert.c index 193ea93f54a..9dbd2a340ce 100644 --- a/source/blender/nodes/shader/nodes/node_shader_invert.c +++ b/source/blender/nodes/shader/nodes/node_shader_invert.c @@ -36,7 +36,7 @@ /* **************** INVERT ******************** */ static bNodeSocketTemplate sh_node_invert_in[] = { - { SOCK_FLOAT, 1, N_("Fac"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR}, + { SOCK_FLOAT, 1, N_("Fac"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_NONE}, { SOCK_RGBA, 1, N_("Color"), 0.0f, 0.0f, 0.0f, 1.0f}, { -1, 0, "" } }; diff --git a/source/blender/nodes/shader/nodes/node_shader_material.c b/source/blender/nodes/shader/nodes/node_shader_material.c index aee280760ba..a4cdfdc6f41 100644 --- a/source/blender/nodes/shader/nodes/node_shader_material.c +++ b/source/blender/nodes/shader/nodes/node_shader_material.c @@ -36,7 +36,7 @@ static bNodeSocketTemplate sh_node_material_in[] = { { SOCK_RGBA, 1, N_("Color"), 0.0f, 0.0f, 0.0f, 1.0f}, { SOCK_RGBA, 1, N_("Spec"), 0.0f, 0.0f, 0.0f, 1.0f}, - { SOCK_FLOAT, 1, N_("Refl"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_FACTOR}, + { SOCK_FLOAT, 1, N_("Refl"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_NONE}, { SOCK_VECTOR, 1, N_("Normal"), 0.0f, 0.0f, 0.0f, 1.0f, -1.0f, 1.0f, PROP_DIRECTION}, { -1, 0, "" } }; @@ -53,15 +53,15 @@ static bNodeSocketTemplate sh_node_material_out[] = { static bNodeSocketTemplate sh_node_material_ext_in[] = { { SOCK_RGBA, 1, N_("Color"), 0.0f, 0.0f, 0.0f, 1.0f}, { SOCK_RGBA, 1, N_("Spec"), 0.0f, 0.0f, 0.0f, 1.0f}, - { SOCK_FLOAT, 1, N_("Refl"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_FACTOR}, + { SOCK_FLOAT, 1, N_("Refl"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_NONE}, { SOCK_VECTOR, 1, N_("Normal"), 0.0f, 0.0f, 0.0f, 1.0f, -1.0f, 1.0f, PROP_DIRECTION}, { SOCK_RGBA, 1, N_("Mirror"), 0.0f, 0.0f, 0.0f, 1.0f}, - { SOCK_FLOAT, 1, N_("Ambient"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_FACTOR}, + { SOCK_FLOAT, 1, N_("Ambient"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_NONE}, { SOCK_FLOAT, 1, N_("Emit"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_UNSIGNED}, - { SOCK_FLOAT, 1, N_("SpecTra"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_FACTOR}, - { SOCK_FLOAT, 1, N_("Ray Mirror"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR}, + { SOCK_FLOAT, 1, N_("SpecTra"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_NONE}, + { SOCK_FLOAT, 1, N_("Ray Mirror"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_NONE}, { SOCK_FLOAT, 1, N_("Alpha"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_UNSIGNED}, - { SOCK_FLOAT, 1, N_("Translucency"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_FACTOR}, + { SOCK_FLOAT, 1, N_("Translucency"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_NONE}, { -1, 0, "" } }; diff --git a/source/blender/nodes/shader/nodes/node_shader_mixRgb.c b/source/blender/nodes/shader/nodes/node_shader_mixRgb.c index 982eaa228d1..2d4f93fc757 100644 --- a/source/blender/nodes/shader/nodes/node_shader_mixRgb.c +++ b/source/blender/nodes/shader/nodes/node_shader_mixRgb.c @@ -34,7 +34,7 @@ /* **************** MIX RGB ******************** */ static bNodeSocketTemplate sh_node_mix_rgb_in[] = { - { SOCK_FLOAT, 1, N_("Fac"), 0.5f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR}, + { SOCK_FLOAT, 1, N_("Fac"), 0.5f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_NONE}, { SOCK_RGBA, 1, N_("Color1"), 0.5f, 0.5f, 0.5f, 1.0f}, { SOCK_RGBA, 1, N_("Color2"), 0.5f, 0.5f, 0.5f, 1.0f}, { -1, 0, "" } diff --git a/source/blender/nodes/shader/nodes/node_shader_mix_shader.c b/source/blender/nodes/shader/nodes/node_shader_mix_shader.c index f1415dcac1b..4dc484545a2 100644 --- a/source/blender/nodes/shader/nodes/node_shader_mix_shader.c +++ b/source/blender/nodes/shader/nodes/node_shader_mix_shader.c @@ -30,7 +30,7 @@ /* **************** OUTPUT ******************** */ static bNodeSocketTemplate sh_node_mix_shader_in[] = { - { SOCK_FLOAT, 1, N_("Fac"), 0.5f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR}, + { SOCK_FLOAT, 1, N_("Fac"), 0.5f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_NONE}, { SOCK_SHADER, 1, N_("Shader")}, { SOCK_SHADER, 1, N_("Shader")}, { -1, 0, "" } diff --git a/source/blender/nodes/shader/nodes/node_shader_output.c b/source/blender/nodes/shader/nodes/node_shader_output.c index c317fe0f58a..128e31b8352 100644 --- a/source/blender/nodes/shader/nodes/node_shader_output.c +++ b/source/blender/nodes/shader/nodes/node_shader_output.c @@ -35,7 +35,7 @@ /* **************** OUTPUT ******************** */ static bNodeSocketTemplate sh_node_output_in[] = { { SOCK_RGBA, 1, N_("Color"), 0.0f, 0.0f, 0.0f, 1.0f}, - { SOCK_FLOAT, 1, N_("Alpha"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR}, + { SOCK_FLOAT, 1, N_("Alpha"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_NONE}, { -1, 0, "" } }; diff --git a/source/blender/nodes/shader/nodes/node_shader_valToRgb.c b/source/blender/nodes/shader/nodes/node_shader_valToRgb.c index d5f0bf30966..0905b45505e 100644 --- a/source/blender/nodes/shader/nodes/node_shader_valToRgb.c +++ b/source/blender/nodes/shader/nodes/node_shader_valToRgb.c @@ -34,7 +34,7 @@ /* **************** VALTORGB ******************** */ static bNodeSocketTemplate sh_node_valtorgb_in[] = { - { SOCK_FLOAT, 1, N_("Fac"), 0.5f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR}, + { SOCK_FLOAT, 1, N_("Fac"), 0.5f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_NONE}, { -1, 0, "" } }; static bNodeSocketTemplate sh_node_valtorgb_out[] = { diff --git a/source/blender/nodes/texture/nodes/node_texture_hueSatVal.c b/source/blender/nodes/texture/nodes/node_texture_hueSatVal.c index 56da4ad24c0..2c9521c78e3 100644 --- a/source/blender/nodes/texture/nodes/node_texture_hueSatVal.c +++ b/source/blender/nodes/texture/nodes/node_texture_hueSatVal.c @@ -36,9 +36,9 @@ static bNodeSocketTemplate inputs[] = { { SOCK_FLOAT, 1, N_("Hue"), 0.0f, 0.0f, 0.0f, 0.0f, -0.5f, 0.5f, PROP_NONE }, - { SOCK_FLOAT, 1, N_("Saturation"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 2.0f, PROP_FACTOR }, - { SOCK_FLOAT, 1, N_("Value"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 2.0f, PROP_FACTOR }, - { SOCK_FLOAT, 1, N_("Factor"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR }, + { SOCK_FLOAT, 1, N_("Saturation"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 2.0f, PROP_NONE }, + { SOCK_FLOAT, 1, N_("Value"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 2.0f, PROP_NONE }, + { SOCK_FLOAT, 1, N_("Factor"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_NONE }, { SOCK_RGBA, 1, N_("Color"), 0.8f, 0.8f, 0.8f, 1.0f }, { -1, 0, "" } }; diff --git a/source/blender/nodes/texture/nodes/node_texture_mixRgb.c b/source/blender/nodes/texture/nodes/node_texture_mixRgb.c index 12ac27f26b7..b482a76ae8e 100644 --- a/source/blender/nodes/texture/nodes/node_texture_mixRgb.c +++ b/source/blender/nodes/texture/nodes/node_texture_mixRgb.c @@ -35,7 +35,7 @@ /* **************** MIX RGB ******************** */ static bNodeSocketTemplate inputs[] = { - { SOCK_FLOAT, 1, N_("Factor"), 0.5f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR }, + { SOCK_FLOAT, 1, N_("Factor"), 0.5f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_NONE }, { SOCK_RGBA, 1, N_("Color1"), 0.5f, 0.5f, 0.5f, 1.0f }, { SOCK_RGBA, 1, N_("Color2"), 0.5f, 0.5f, 0.5f, 1.0f }, { -1, 0, "" } diff --git a/source/blender/nodes/texture/nodes/node_texture_valToRgb.c b/source/blender/nodes/texture/nodes/node_texture_valToRgb.c index 871cdab384e..4977b443de5 100644 --- a/source/blender/nodes/texture/nodes/node_texture_valToRgb.c +++ b/source/blender/nodes/texture/nodes/node_texture_valToRgb.c @@ -35,7 +35,7 @@ /* **************** VALTORGB ******************** */ static bNodeSocketTemplate valtorgb_in[] = { - { SOCK_FLOAT, 1, N_("Fac"), 0.5f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR}, + { SOCK_FLOAT, 1, N_("Fac"), 0.5f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_NONE}, { -1, 0, "" } }; static bNodeSocketTemplate valtorgb_out[] = { -- cgit v1.2.3