From 42ca1c8dcd8d148124b9d5fcf262887cac9909c1 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 4 Mar 2013 13:18:14 +0000 Subject: Fix for image transparency backwards compatibility. Now the texture datablock has a Use Alpha option again. This makes the case where you enabled Premultiply on the image and disabled Use Alpha on the texture work again. That's mostly useful when you have a straight alpha image file which has no useful RGB colors in zero alpha regions (e.g. renders). Then sometimes you don't want to use the alpha for the texture stack mixing, but you still want to multiply it into the RGB channels to avoid a blocky transition into zero alpha regions. This also removes the version patch that copied image datablocks because it's not reliable and might be causing bug #34434. This does mean we are no longer backwards compatible for cases where two different texture datablocks with Use Alpha enabled and disabled where using the same image. --- source/blender/makesdna/DNA_texture_types.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/makesdna') diff --git a/source/blender/makesdna/DNA_texture_types.h b/source/blender/makesdna/DNA_texture_types.h index ea4f281efd6..dd63e6aad59 100644 --- a/source/blender/makesdna/DNA_texture_types.h +++ b/source/blender/makesdna/DNA_texture_types.h @@ -340,7 +340,7 @@ typedef struct ColorMapping { /* imaflag */ #define TEX_INTERPOL 1 -#define TEX_USEALPHA 2 /* deprecated, used for versioning only */ +#define TEX_USEALPHA 2 #define TEX_MIPMAP 4 #define TEX_IMAROT 16 #define TEX_CALCALPHA 32 -- cgit v1.2.3 From f840ac9801175cc16dcaceaa6168f262530a548e Mon Sep 17 00:00:00 2001 From: Gaia Clary Date: Tue, 5 Mar 2013 20:30:38 +0000 Subject: Weight Painting: Added userpref for zero_weight color. --- source/blender/makesdna/DNA_userdef_types.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source/blender/makesdna') diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index 26b33783535..10e85437e5f 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -229,7 +229,7 @@ typedef struct ThemeSpace { char wire[4], select[4]; char lamp[4], speaker[4], empty[4], camera[4], pad[8]; char active[4], group[4], group_active[4], transform[4]; - char vertex[4], vertex_select[4]; + char vertex[4], vertex_select[4], vertex_unreferenced[4]; char edge[4], edge_select[4]; char edge_seam[4], edge_sharp[4], edge_facesel[4], edge_crease[4]; char face[4], face_select[4]; /* solid faces */ @@ -267,6 +267,7 @@ typedef struct ThemeSpace { char handle_vertex[4]; char handle_vertex_select[4]; + char pad2[4]; char handle_vertex_size; -- cgit v1.2.3 From 8676530b7d035d9ecb4e518d084790a4d305ec35 Mon Sep 17 00:00:00 2001 From: Antony Riakiotakis Date: Wed, 6 Mar 2013 19:54:43 +0000 Subject: Texture paint refactoring commit Adding new file paint_image_proj.c which includes the projective texture painting part of texture painting, using the stroke system. To access the new code path use Shift-LClick. The new code path still is problematic with tablet pressure and I will be looking into ways to unify this across paint systems next. The old code is still present and can be accessed by regular Lclick as usual. Also removed 3D (non-projective) painting from 3D viewport. TODO: * Add pressure influence code to stroke, remove from every other paint system code, including texpaint. * Put UnifiedPaintSettings update in PaintStroke code. --- source/blender/makesdna/DNA_scene_types.h | 1 - 1 file changed, 1 deletion(-) (limited to 'source/blender/makesdna') diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index a6c838eb485..fa6fd41f568 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -1512,7 +1512,6 @@ typedef enum SculptFlags { // #define IMAGEPAINT_DRAW_TOOL_DRAWING 4 // deprecated /* projection painting only */ -#define IMAGEPAINT_PROJECT_DISABLE 8 /* Non projection 3D painting */ #define IMAGEPAINT_PROJECT_XRAY 16 #define IMAGEPAINT_PROJECT_BACKFACE 32 #define IMAGEPAINT_PROJECT_FLAT 64 -- cgit v1.2.3 From 557b893dfd0fa2380ee159bb4fe7a28f09187036 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Thu, 7 Mar 2013 17:47:30 +0000 Subject: Border for compositor viewer node feature This adds border option to compositor, which affects on a backdrop and viewer nodes, which is useful for faster previews and tweaks. Final compositing still happens for the whole frame, but if it'll be needed it's not so difficult to support it as well. To use border there's Ctrl-B shortcut in the compositor editor, which i used to define region you want to restrict compositing to. There's also "Viewer Border" option in the N-panel in case you'll want to disable border compositing. Some areas could be cleaned a bit, like ideally it shall not be viewer image clearing in viewer_border_update RNA callback, but currently it's not so much clear how to make it the same fast as simple memset and glue it somehow to compositor. Will think of nicer solution a bit later. --- source/blender/makesdna/DNA_node_types.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source/blender/makesdna') diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h index 62c997b72c6..b2b23828cee 100644 --- a/source/blender/makesdna/DNA_node_types.h +++ b/source/blender/makesdna/DNA_node_types.h @@ -279,6 +279,8 @@ typedef struct bNodeTree { short render_quality; /* Quality setting when rendering */ int chunksize; /* tile size for compositor engine */ + rctf viewer_border; + ListBase inputs, outputs; /* external sockets for group nodes */ /* execution data */ @@ -313,6 +315,7 @@ typedef struct bNodeTree { #define NTREE_COM_OPENCL 2 /* use opencl */ #define NTREE_TWO_PASS 4 /* two pass */ #define NTREE_COM_GROUPNODE_BUFFER 8 /* use groupnode buffers */ +#define NTREE_VIEWER_BORDER 16 /* use a border for viewer nodes */ /* XXX not nice, but needed as a temporary flags * for group updates after library linking. -- cgit v1.2.3 From ddddb7bab173b040342ef99270ee71ae076d45e8 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 9 Mar 2013 03:46:30 +0000 Subject: code cleanup: favor braces when blocks have mixed brace use. --- source/blender/makesdna/intern/makesdna.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'source/blender/makesdna') diff --git a/source/blender/makesdna/intern/makesdna.c b/source/blender/makesdna/intern/makesdna.c index 31ff0ffa8fe..e22602aa7a2 100644 --- a/source/blender/makesdna/intern/makesdna.c +++ b/source/blender/makesdna/intern/makesdna.c @@ -251,7 +251,9 @@ static int add_type(const char *str, int len) } /* append new type */ - if (nr_types == 0) cp = typedata; + if (nr_types == 0) { + cp = typedata; + } else { cp = types[nr_types - 1] + strlen(types[nr_types - 1]) + 1; } @@ -397,7 +399,9 @@ static int add_name(const char *str) } /* append new type */ - if (nr_names == 0) cp = namedata; + if (nr_names == 0) { + cp = namedata; + } else { cp = names[nr_names - 1] + strlen(names[nr_names - 1]) + 1; } -- cgit v1.2.3 From abd1748e486e0948df26fb7a0cf42bce67f861ec Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 9 Mar 2013 11:40:42 +0000 Subject: code cleanup: move runtime var zfac out of RegionView3D. rename initgrabz() -> ED_view3d_calc_zfac() and have it return the zfac to use. --- source/blender/makesdna/DNA_view3d_types.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/makesdna') diff --git a/source/blender/makesdna/DNA_view3d_types.h b/source/blender/makesdna/DNA_view3d_types.h index d9d6db5ff91..5397b06dc15 100644 --- a/source/blender/makesdna/DNA_view3d_types.h +++ b/source/blender/makesdna/DNA_view3d_types.h @@ -118,7 +118,6 @@ typedef struct RegionView3D { float viewquat[4]; /* view rotation, must be kept normalized */ float dist; /* distance from 'ofs' along -viewinv[2] vector, where result is negative as is 'ofs' */ - float zfac; /* initgrabz() result */ float camdx, camdy; /* camera view offsets, 1.0 = viewplane moves entire width/height */ float pixsize; /* runtime only */ float ofs[3]; /* view center & orbit pivot, negative of worldspace location, @@ -129,10 +128,11 @@ typedef struct RegionView3D { char persp; char view; char viewlock; + char pad[4]; short twdrawflag; short rflag; - + /* last view (use when switching out of camera view) */ float lviewquat[4]; -- cgit v1.2.3 From 38feedcaacd2bd317ea68a57014cddb2f9ceaf15 Mon Sep 17 00:00:00 2001 From: Antony Riakiotakis Date: Sun, 10 Mar 2013 20:05:18 +0000 Subject: Feature request for all paint systems that support it: Jittering in absolute coordinates. This allows an artist to lower the brush radius while keeping the spread of the brush constant. A toggle under the jitter slider provides the option to switch between relative/absolute. --- source/blender/makesdna/DNA_brush_types.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source/blender/makesdna') diff --git a/source/blender/makesdna/DNA_brush_types.h b/source/blender/makesdna/DNA_brush_types.h index 62d696ec255..147791b4835 100644 --- a/source/blender/makesdna/DNA_brush_types.h +++ b/source/blender/makesdna/DNA_brush_types.h @@ -71,6 +71,8 @@ typedef struct Brush { int size; /* brush diameter */ int flag; /* general purpose flag */ float jitter; /* jitter the position of the brush */ + int jitter_absolute; /* absolute jitter in pixels */ + int pad; int spacing; /* spacing of paint operations */ int smooth_stroke_radius; /* turning radius (in pixels) for smooth stroke */ float smooth_stroke_factor; /* higher values limit fast changes in the stroke direction */ @@ -137,7 +139,8 @@ typedef enum BrushFlags { /* temporary flag which sets up automatically for correct brush * drawing when inverted modal operator is running */ - BRUSH_INVERTED = (1 << 29) + BRUSH_INVERTED = (1 << 29), + BRUSH_ABSOLUTE_JITTER = (1 << 30) } BrushFlags; /* Brush.sculpt_tool */ -- cgit v1.2.3 From acd3bef34e6a6b30df694f931dc0c622ca083f59 Mon Sep 17 00:00:00 2001 From: Antony Riakiotakis Date: Wed, 13 Mar 2013 03:46:22 +0000 Subject: Texture sampling function refactoring: ALERT! POSSIBLE BREAKING COMMIT, ESPECIALLY FOR SCULPT! Separate the sculpt sampling function so that it can be reused from other paint systems. This includes updating of the relevant coordinates for anchored and rake style brushes, which are now being updated as part of the stroke system. I left only code for area-style brush texture mapping in sculpt code, since it requires a few data structures not present on other paint systems. This commit makes it almost as easy to support rake on other systems as exposing the python UI for it. Also it makes it totally possible to have texture painting capabilities in vertex paint too :) These commits will follow very soon. Also, even if I did my best to keep the code from breaking, (even fixed a leftover bug from coordinate changes) this is a big change. Please test! --- source/blender/makesdna/DNA_scene_types.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'source/blender/makesdna') diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index fa6fd41f568..cd1acb53029 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -888,20 +888,25 @@ typedef struct UnifiedPaintSettings { /* rake rotation */ /* record movement of mouse so that rake can start at an intuitive angle */ - float last_x, last_y; - float last_angle; + float last_rake[2]; + int pad; - float special_rotation; + float brush_rotation; // all this below is used to communicate with the cursor drawing routine int draw_anchored; int anchored_size; - float anchored_location[3]; float anchored_initial_mouse[2]; /* drawing pressure */ int draw_pressure; float pressure_value; + + /* position of mouse, used to sample the texture */ + float tex_mouse[2]; + /* radius of brush, premultiplied with pressure. + * In case of anchored brushes contains that radius */ + float pixel_radius; } UnifiedPaintSettings; typedef enum { -- cgit v1.2.3 From 1d73ee50a48012712bc2846602fb475bb76f7c21 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 13 Mar 2013 17:31:26 +0000 Subject: solidify modifier: thickness clamping helps prevent self intersections when there are small details on a larger model. --- source/blender/makesdna/DNA_modifier_types.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source/blender/makesdna') diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h index 117eac0e42b..66685c131d4 100644 --- a/source/blender/makesdna/DNA_modifier_types.h +++ b/source/blender/makesdna/DNA_modifier_types.h @@ -744,6 +744,8 @@ typedef struct SolidifyModifierData { float offset; /* new surface offset level*/ float offset_fac; /* midpoint of the offset */ float offset_fac_vg; /* factor for the minimum weight to use when vgroups are used, avoids 0.0 weights giving duplicate geometry */ + float offset_clamp; /* clamp offset based on surrounding geometry */ + float pad; float crease_inner; float crease_outer; float crease_rim; -- cgit v1.2.3 From cf3b3a1ba2159792fad7cc0c8ccb98a855534823 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Thu, 14 Mar 2013 10:15:10 +0000 Subject: Code cleanup: replace magic constant used for alpha ignore flag with a define. --- source/blender/makesdna/DNA_node_types.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source/blender/makesdna') diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h index b2b23828cee..2e24b6ed78d 100644 --- a/source/blender/makesdna/DNA_node_types.h +++ b/source/blender/makesdna/DNA_node_types.h @@ -860,4 +860,7 @@ typedef struct NodeShaderNormalMap { /* image */ #define CMP_NODE_IMAGE_USE_STRAIGHT_OUTPUT 1 +/* viewer and cmposite output */ +#define CMP_NODE_OUTPUT_IGNORE_ALPHA 1 + #endif -- cgit v1.2.3 From 2d21e6521f99825cd4c5783ca6866910947c7e13 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 15 Mar 2013 19:56:33 +0000 Subject: Fix: multisample viewport drawing didn't work well with selection or particle brushes, due to issues with color coded drawing or slow/buggy reading from such a buffer on some systems. In case multisample is enabled now, it uses an offscreen buffer for such drawing, which is not multisampled and so should not cause issues. This does mean there is some extra GPU memory usage when multisample is enabled, and we could optimize triple buffer to work together here somehow to share buffers, but it's better than having selection not working. --- source/blender/makesdna/DNA_view3d_types.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source/blender/makesdna') diff --git a/source/blender/makesdna/DNA_view3d_types.h b/source/blender/makesdna/DNA_view3d_types.h index 5397b06dc15..294c47aa9db 100644 --- a/source/blender/makesdna/DNA_view3d_types.h +++ b/source/blender/makesdna/DNA_view3d_types.h @@ -107,6 +107,7 @@ typedef struct RegionView3D { struct RenderInfo *ri; struct RenderEngine *render_engine; struct ViewDepths *depths; + void *gpuoffscreen; /* animated smooth view */ struct SmoothView3DStore *sms; -- cgit v1.2.3 From 0a4b030145fdad2b36290454bbd3ba37406d4f9a Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Sun, 17 Mar 2013 14:38:58 +0000 Subject: New feature: Automatic switching for drawing pixel buffers via glDrawPixels or using GPU textures It works with a User Preference limit, in megapixels, to define whether to use GPU or direct pixel drawing. Default is now initialized to 10 MP (4k buffers). Especially for zooming out (draw smaller) texture drawing is much smaller. Also Nvidia cards typically draw much faster with textures in general. Added to node backdrop first now, the other editors follow in a next commit. For coders: added new DNA function to initialize new struct variables, so you don't have to sub-version files anymore. DNA_struct_elem_find(fd->filesdna, "structname", "typename", "varname") "filesdna" is the sdna description of the current file being versioned. --- source/blender/makesdna/DNA_genfile.h | 2 ++ source/blender/makesdna/DNA_userdef_types.h | 2 +- source/blender/makesdna/intern/dna_genfile.c | 16 ++++++++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) (limited to 'source/blender/makesdna') diff --git a/source/blender/makesdna/DNA_genfile.h b/source/blender/makesdna/DNA_genfile.h index ac75b03c742..96d71288c62 100644 --- a/source/blender/makesdna/DNA_genfile.h +++ b/source/blender/makesdna/DNA_genfile.h @@ -71,6 +71,8 @@ void *DNA_struct_reconstruct(struct SDNA *newsdna, struct SDNA *oldsdna, char *c int DNA_elem_array_size(const char *astr, int len); int DNA_elem_offset(struct SDNA *sdna, const char *stype, const char *vartype, const char *name); +bool DNA_struct_elem_find(struct SDNA *sdna, const char *stype, const char *vartype, const char *name); + int DNA_elem_type_size(const eSDNA_Type elem_nr); diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index 10e85437e5f..5a16ff39e68 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -451,7 +451,7 @@ typedef struct UserDef { short ogl_multisamples; /* amount of samples for OpenGL FSA, if zero no FSA */ - short pad4; + short image_gpubuffer_limit; /* If set, amount of mega-pixels to use for texture drawing of images */ float glalphaclip; diff --git a/source/blender/makesdna/intern/dna_genfile.c b/source/blender/makesdna/intern/dna_genfile.c index 86014c4e80e..1225821102a 100644 --- a/source/blender/makesdna/intern/dna_genfile.c +++ b/source/blender/makesdna/intern/dna_genfile.c @@ -1314,6 +1314,22 @@ int DNA_elem_offset(SDNA *sdna, const char *stype, const char *vartype, const ch return (int)((intptr_t)cp); } +bool DNA_struct_elem_find(SDNA *sdna, const char *stype, const char *vartype, const char *name) +{ + + const int SDNAnr = DNA_struct_find_nr(sdna, stype); + + if (SDNAnr >= 0) { + const short * const spo = sdna->structs[SDNAnr]; + char * const cp = find_elem(sdna, vartype, name, spo, NULL, NULL); + + if (cp) return true; + return (int)((intptr_t)cp); + } + return false; +} + + /** * Returns the size in bytes of a primitive type. */ -- cgit v1.2.3