Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build_files/cmake/Modules/FindPythonLibsUnix.cmake11
-rw-r--r--doc/guides/python-dev-guide.txt170
-rw-r--r--doc/python_api/examples/bmesh.ops.1.py2
-rw-r--r--intern/cycles/blender/blender_object.cpp1
-rw-r--r--release/scripts/modules/bl_i18n_utils/bl_extract_messages.py3
-rw-r--r--release/scripts/modules/bl_i18n_utils/utils_spell_check.py2
-rw-r--r--release/scripts/startup/bl_ui/space_view3d_toolbar.py3
-rw-r--r--source/blender/blenkernel/BKE_brush.h2
-rw-r--r--source/blender/blenkernel/BKE_paint.h6
-rw-r--r--source/blender/blenkernel/intern/brush.c4
-rw-r--r--source/blender/blenkernel/intern/paint.c2
-rw-r--r--source/blender/blenkernel/intern/smoke.c2
-rw-r--r--source/blender/blenloader/intern/versioning_270.c2
-rw-r--r--source/blender/bmesh/intern/bmesh_opdefines.c2
-rw-r--r--source/blender/bmesh/operators/bmo_primitive.c8
-rw-r--r--source/blender/editors/mesh/editmesh_add.c2
-rw-r--r--source/blender/editors/mesh/meshtools.c31
-rw-r--r--source/blender/editors/sculpt_paint/paint_intern.h4
-rw-r--r--source/blender/editors/sculpt_paint/paint_utils.c4
-rw-r--r--source/blender/editors/sculpt_paint/paint_vertex.c264
-rw-r--r--source/blender/editors/sculpt_paint/paint_vertex_color_ops.c2
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c53
-rw-r--r--source/blender/editors/sculpt_paint/sculpt_intern.h6
-rw-r--r--source/blender/editors/space_image/image_ops.c11
-rw-r--r--source/blender/editors/space_outliner/outliner_tree.c4
-rw-r--r--source/blender/makesdna/DNA_scene_types.h1
-rw-r--r--source/blender/makesrna/intern/rna_modifier.c4
-rw-r--r--source/blender/makesrna/intern/rna_sculpt_paint.c6
-rw-r--r--source/blender/makesrna/intern/rna_space.c2
-rw-r--r--source/blender/python/generic/bpy_internal_import.c14
-rw-r--r--source/blender/python/intern/bpy_props.c224
-rw-r--r--source/blender/python/intern/bpy_util.h4
-rw-r--r--source/blender/render/extern/include/RE_render_ext.h2
-rw-r--r--source/blender/render/intern/source/render_texture.c8
-rw-r--r--source/blenderplayer/bad_level_call_stubs/stubs.c2
35 files changed, 383 insertions, 485 deletions
diff --git a/build_files/cmake/Modules/FindPythonLibsUnix.cmake b/build_files/cmake/Modules/FindPythonLibsUnix.cmake
index 9d79bdd778d..493fb0df6a7 100644
--- a/build_files/cmake/Modules/FindPythonLibsUnix.cmake
+++ b/build_files/cmake/Modules/FindPythonLibsUnix.cmake
@@ -38,7 +38,7 @@ IF(NOT PYTHON_ROOT_DIR AND NOT $ENV{PYTHON_ROOT_DIR} STREQUAL "")
SET(PYTHON_ROOT_DIR $ENV{PYTHON_ROOT_DIR})
ENDIF()
-SET(PYTHON_VERSION 3.5 CACHE STRING "Python Version (major and minor only)")
+SET(PYTHON_VERSION 3.6 CACHE STRING "Python Version (major and minor only)")
MARK_AS_ADVANCED(PYTHON_VERSION)
@@ -77,15 +77,12 @@ SET(_python_SEARCH_DIRS
# only search for the dirs if we havn't already
IF((NOT _IS_INC_DEF) OR (NOT _IS_INC_CONF_DEF) OR (NOT _IS_LIB_DEF) OR (NOT _IS_LIB_PATH_DEF))
-
- SET(_python_ABI_FLAGS
+ SET(_PYTHON_ABI_FLAGS_TEST
"m;mu;u; " # release
"dm;dmu;du;d" # debug
)
-
-
- FOREACH(_CURRENT_ABI_FLAGS ${_python_ABI_FLAGS})
+ FOREACH(_CURRENT_ABI_FLAGS ${_PYTHON_ABI_FLAGS_TEST})
#IF(CMAKE_BUILD_TYPE STREQUAL Debug)
# SET(_CURRENT_ABI_FLAGS "d${_CURRENT_ABI_FLAGS}")
#ENDIF()
@@ -170,7 +167,7 @@ IF((NOT _IS_INC_DEF) OR (NOT _IS_INC_CONF_DEF) OR (NOT _IS_LIB_DEF) OR (NOT _IS_
UNSET(_CURRENT_ABI_FLAGS)
UNSET(_CURRENT_PATH)
- UNSET(_python_ABI_FLAGS)
+ UNSET(_PYTHON_ABI_FLAGS_TEST)
ENDIF()
UNSET(_IS_INC_DEF)
diff --git a/doc/guides/python-dev-guide.txt b/doc/guides/python-dev-guide.txt
deleted file mode 100644
index 75c9ccb57e5..00000000000
--- a/doc/guides/python-dev-guide.txt
+++ /dev/null
@@ -1,170 +0,0 @@
-Simple Blender Python Developer's Guide
----------------------------------------
-
-This is an outline for a future guide yet to be written. It is meant for
-programmers wanting to understand and maybe help with the embedding of Python
-inside Blender.
-
-I - Introduction
-
-We could praise Python here for its many qualities, but it's probably better
-to just give some links:
-
-The main site is at www.python.org , with documentation at www.python.org/doc/
-
-Also worth of mention: it's an interpreted language and is available for
-many different systems. The download includes the interpreter, many modules
-(think libs), good documentation and some programs / examples. If you use
-linux, there's a high chance you already have Python installed, just try
-"man python".
-
-The reason for embedding a language environment inside Blender is to give
-users the ability to access the program's internal data and functionality.
-This can be used to import / export (from / to other 2d / 3d formats) or
-change the data (to create new objects procedurally, among many other
-interesting possibilities). Script writers (Blender Python programmers) can
-also expand Blender in new ways, adding new features on-the-fly, without having
-to recompile it. It is usually much easier and faster to write scripts in
-Python than to code the equivalent in C.
-
-II - Reference material:
-
-There are two important texts for us in the documentation that comes
-with Python ( docs also available online at www.python.org ):
-
-- Extending and Embedding (tutorial for C/C++ programmers)
-
-and specially
-
-- Python/C API.
-
-You can read the first one to get a feel for how things are done
-(reference counting is probably the most important part), but the second
-doc is a must. Specially useful as a fast reference is its Index, at letter
-P, where all commands are.
-
-Specially useful commands are Py_BuildValue and the family of parsing
-functions, PyArg_Parse* (PyArg_Parse(), PyArg_ParseTuple(),
-PyArg_ParseTupleAndKeywords()). Py_BuildValue is usually the best way to make
-Python Objects (the 'variables' that the Python Interpreter understands)
-out of C ones. The PyArg_Parse* functions do the opposite, they parse
-Python Objects to C variables.
-
-So, understand PyArg_Parse* functions, Py_BuildValue and reference
-counting. The first doc has a good discussion about them.
-
-- C knowledge is also necessary, of course, use your favorite resource.
-
-- The Blender 2.25 API documentation ( www.blender.org ) is, along with
-the source, our basic API ref.
-
-III - Directories
-
-The previous Blender Python API's are spread in blender/intern/python
-and the C part of the current one, bpython, is at
-blender/source/blender/bpython/, specially in intern/. The current
-solution is a Python wrapper on top of this bpython one, at
-blender/intern/python/modules/Blender/
-
-Note: since it's in Python, they needed the freeze Python utility, a
-process/program that creates stand-alone executables out of Python
-source files -- that is, it packs together an interpreter, the needed
-modules and the source of a Python program so that users of this program
-don't need to have the Python interpreter already installed in their
-machines to run the program -- Blender, in this case.
-
-The new implementation is pure C, so we won't need to "freeze" it.
-
-Another important dir for starters is blender/source/blender/makesdna,
-where the headers with Blender structs lie.
-
-IV - Experimental Python
-
-The new implementation, currently referred to as experimental python -
-exppython - was started by Michel Selten. He chose to solve the mess in
-Blender Python by starting over from scratch, in C, but keeping API
-compatibility with the current 2.25 API used by Blender.
-
-It is in blender/source/blender/python , more specifically inside
-api2_2x/
-
-To make it clear, exppython is the new implementation being worked on. It
-will possibly become the de-facto implementation in Blender 2.28, the next
-Blender version. Currently, Blender still comes with the same implementation
-found in the 2.25 version of the program. So we call that the 2.25
-implementation, or bpython.
-
-BPython had plenty of "macro magic", lot's of complicate #define's, etc.,
-since a lot of the embedding work is quite repetitive. But that makes it
-much harder for newbies to jump in and learn, so the new files in exppython
-avoid that.
-
-This means: Blender, Object, Camera, Lamp, Image, Text, Window modules
-(the files have the same names, ending obviously with .c and .h)
-
-To speed things up, some independent parts of bpython are being
-integrated directly into exppython. That already happened with Draw and
-BGL, both taken from opy_draw.c in the bpython/intern dir. The same is
-happening with NMesh (Mesh is written in Python and imports NMesh to
-extend / change its functionality).
-
-For a good example of dexterity with macros (cheers to the NaN
-programmer(s)!), look at BGL.[ch], the OpenGL API wrapper. The defines
-are in the header.
-
-Besides keeping compatibility with the 2.25 API, there are already some
-additions to exppython:
-
-- some modules have access to more variables than 2.25 had;
-- there are more method functions and the access is safer;
-- the file selector (or file browser, if you prefer) is back:
- It's now in the Window module, along with an image selector, too.
-- there are totally new modules, unavailable in 2.25:
- Fellow new developers joining our team are contributing new modules
- that have been requested by the community for a long time.
-
-
-V - Coding
-
-The Camera module is a good reference, since it is like most others, in
-terms of programming, but is smaller and simple. It's in Camera.c and
-Camera.h . To have it working, it was also necessary to include a line to
-the end of Blender.c (registering it as a Blender submodule) and another to
-modules.h (declaring its init and CreateObject method)
-
-Currently, one of our conventions is to prepend M_ to module functions,
-doc strings, etc. and C_ to the new types we had to create for Python,
-like C_Camera, C_Lamp, etc.
-
-If you look at Camera.[ch], you'll find code for creating the Camera
-module and the Camera "type", with all its methods and access policies.
-It's really a new type defined in Python, like PyInt or PyFloat,
-PyString, etc. In practice, it's a "thin" (because it doesn't make
-copies of the variables) wrapper for the Blender Camera Data Object.
-
-A note about Blender: objects in Blender share a common base, the
-Object, whose attributes are things like the matrix, the location, the
-rotation, the size, etc. A Camera is actually an Object of type Camera
-(which means that its "data" field points to a Camera Data obj) and a
-Camera Data object, which is the specific camera part of the object
-(attributes like lens, clip start, etc.). Same for other objects, like
-Lamp, Mesh, etc.
-
-That's why C_Camera is a wrapper for the Blender Camera **Data**
-object. The full wrapper is Object("Camera") linked with
-Camera("camera_name").
-
-How to write a new module for a simple object? Use Camera.[ch] as
-templates, check the specifics of your object in the makesdna dir
-(for example, the camera one is DNA_camera_types.h) and make the
-necessary changes.
-
-If you want to help exppython and in the process possibly learn more about
-embedding, the Python/C API and Blender internals, there's this mailing list:
-
-Bf-python mailing list
-Bf-python@blender.org
-http://www.blender.org/mailman/listinfo/bf-python
-
-There you can ask what hasn't been done yet, get help, make suggestions for
-new features we should consider, send bug reports, etc.
diff --git a/doc/python_api/examples/bmesh.ops.1.py b/doc/python_api/examples/bmesh.ops.1.py
index abce087ceb3..b307624467f 100644
--- a/doc/python_api/examples/bmesh.ops.1.py
+++ b/doc/python_api/examples/bmesh.ops.1.py
@@ -12,7 +12,7 @@ bm = bmesh.new()
bmesh.ops.create_circle(
bm,
cap_ends=False,
- diameter=0.2,
+ radius=0.2,
segments=8)
diff --git a/intern/cycles/blender/blender_object.cpp b/intern/cycles/blender/blender_object.cpp
index 02cb4dbbe8a..a25ae278058 100644
--- a/intern/cycles/blender/blender_object.cpp
+++ b/intern/cycles/blender/blender_object.cpp
@@ -75,6 +75,7 @@ bool BlenderSync::object_is_mesh(BL::Object& b_ob)
return (b_curve.bevel_object() ||
b_curve.extrude() != 0.0f ||
b_curve.bevel_depth() != 0.0f ||
+ b_curve.dimensions() == BL::Curve::dimensions_2D ||
b_ob.modifiers.length());
}
else {
diff --git a/release/scripts/modules/bl_i18n_utils/bl_extract_messages.py b/release/scripts/modules/bl_i18n_utils/bl_extract_messages.py
index 3b7eff6db9c..bbeb1780355 100644
--- a/release/scripts/modules/bl_i18n_utils/bl_extract_messages.py
+++ b/release/scripts/modules/bl_i18n_utils/bl_extract_messages.py
@@ -227,6 +227,8 @@ def dump_rna_messages(msgs, reports, settings, verbose=False):
# More builtin classes we don't need to parse.
blacklist_rna_class |= {cls for cls in bpy.types.Property.__subclasses__()}
+ # None of this seems needed anymore, and it's broken anyway with current master (blender 2.79.1)...
+ """
_rna = {getattr(bpy.types, cls) for cls in dir(bpy.types)}
# Classes which are attached to collections can be skipped too, these are api access only.
@@ -276,6 +278,7 @@ def dump_rna_messages(msgs, reports, settings, verbose=False):
#op = get_instance(idname)
#if 'INTERNAL' in path_resolve(op, "bl_options"):
#blacklist_rna_class.add(idname)
+ """
return blacklist_rna_class
diff --git a/release/scripts/modules/bl_i18n_utils/utils_spell_check.py b/release/scripts/modules/bl_i18n_utils/utils_spell_check.py
index b33588c903b..2ce8385f714 100644
--- a/release/scripts/modules/bl_i18n_utils/utils_spell_check.py
+++ b/release/scripts/modules/bl_i18n_utils/utils_spell_check.py
@@ -107,6 +107,7 @@ class SpellChecker:
"fulldome", "fulldomes",
"fullscreen",
"gridline",
+ "hardlight",
"hemi",
"inbetween",
"inscatter", "inscattering",
@@ -447,6 +448,7 @@ class SpellChecker:
"gpencil",
"idcol",
"keyframe", "keyframes", "keyframing", "keyframed",
+ "luminocity",
"mathvis",
"metaball", "metaballs", "mball",
"metaelement", "metaelements",
diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index b7e2b5b6051..0f9dd117c14 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -1773,7 +1773,6 @@ class VIEW3D_PT_tools_weightpaint_options(Panel, View3DPaintPanel):
sub.prop(wpaint, "normal_angle", text="")
col = layout.column()
row = col.row()
- row.prop(wpaint, "use_spray")
row.prop(wpaint, "use_group_restrict")
obj = context.weight_paint_object
@@ -1816,8 +1815,6 @@ class VIEW3D_PT_tools_vertexpaint(Panel, View3DPaintPanel):
sub.active = (vpaint.use_normal_falloff)
sub.prop(vpaint, "normal_angle", text="")
- col.prop(vpaint, "use_spray")
-
self.unified_paint_settings(col, context)
diff --git a/source/blender/blenkernel/BKE_brush.h b/source/blender/blenkernel/BKE_brush.h
index c1e107e101a..c6d4217780e 100644
--- a/source/blender/blenkernel/BKE_brush.h
+++ b/source/blender/blenkernel/BKE_brush.h
@@ -74,7 +74,7 @@ float BKE_brush_curve_strength(const struct Brush *br, float p, const float len)
/* sampling */
float BKE_brush_sample_tex_3D(
- const struct Scene *scene, struct Brush *br, const float point[3],
+ const struct Scene *scene, const struct Brush *br, const float point[3],
float rgba[4], const int thread, struct ImagePool *pool);
float BKE_brush_sample_masktex(
const struct Scene *scene, struct Brush *br, const float point[2],
diff --git a/source/blender/blenkernel/BKE_paint.h b/source/blender/blenkernel/BKE_paint.h
index 527c0aeb609..f88dfc6f817 100644
--- a/source/blender/blenkernel/BKE_paint.h
+++ b/source/blender/blenkernel/BKE_paint.h
@@ -222,18 +222,14 @@ typedef struct SculptSession {
/* For non-airbrush painting to re-apply from the original (MLoop aligned). */
unsigned int *previous_color;
- float *previous_accum;
} vpaint;
struct {
struct SculptVertexPaintGeomMap gmap;
-
- /* Vertex aligned arrays of weights. */
- float *previous_accum;
/* Keep track of how much each vertex has been painted (non-airbrush only). */
float *alpha_weight;
- /* Needed to continuously re-apply over the same weights (VP_FLAG_SPRAY disabled).
+ /* Needed to continuously re-apply over the same weights (BRUSH_ACCUMULATE disabled).
* Lazy initialize as needed (flag is set to 1 to tag it as uninitialized). */
struct MDeformVert *dvert_prev;
} wpaint;
diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c
index 0300dfe5891..4a54ab26373 100644
--- a/source/blender/blenkernel/intern/brush.c
+++ b/source/blender/blenkernel/intern/brush.c
@@ -521,13 +521,13 @@ int BKE_brush_clone_image_delete(Brush *brush)
* region space mouse coordinates, or 3d world coordinates for 3D mapping.
*
* rgba outputs straight alpha. */
-float BKE_brush_sample_tex_3D(const Scene *scene, Brush *br,
+float BKE_brush_sample_tex_3D(const Scene *scene, const Brush *br,
const float point[3],
float rgba[4], const int thread,
struct ImagePool *pool)
{
UnifiedPaintSettings *ups = &scene->toolsettings->unified_paint_settings;
- MTex *mtex = &br->mtex;
+ const MTex *mtex = &br->mtex;
float intensity = 1.0;
bool hasrgb = false;
diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c
index 40d02acab1c..7acddbbb90e 100644
--- a/source/blender/blenkernel/intern/paint.c
+++ b/source/blender/blenkernel/intern/paint.c
@@ -684,13 +684,11 @@ void BKE_sculptsession_free_vwpaint_data(struct SculptSession *ss)
gmap = &ss->mode.vpaint.gmap;
MEM_SAFE_FREE(ss->mode.vpaint.previous_color);
- MEM_SAFE_FREE(ss->mode.vpaint.previous_accum);
}
else if (ss->mode_type == OB_MODE_WEIGHT_PAINT) {
gmap = &ss->mode.wpaint.gmap;
MEM_SAFE_FREE(ss->mode.wpaint.alpha_weight);
- MEM_SAFE_FREE(ss->mode.wpaint.previous_accum);
if (ss->mode.wpaint.dvert_prev) {
BKE_defvert_array_free_elems(ss->mode.wpaint.dvert_prev, ss->totvert);
MEM_freeN(ss->mode.wpaint.dvert_prev);
diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c
index 218ac64f3e0..7ea985a311b 100644
--- a/source/blender/blenkernel/intern/smoke.c
+++ b/source/blender/blenkernel/intern/smoke.c
@@ -679,7 +679,7 @@ void smokeModifier_copy(struct SmokeModifierData *smd, struct SmokeModifierData
tsmd->flow->texture_size = smd->flow->texture_size;
tsmd->flow->texture_offset = smd->flow->texture_offset;
- BLI_strncpy(tsmd->flow->uvlayer_name, tsmd->flow->uvlayer_name, sizeof(tsmd->flow->uvlayer_name));
+ BLI_strncpy(tsmd->flow->uvlayer_name, smd->flow->uvlayer_name, sizeof(tsmd->flow->uvlayer_name));
tsmd->flow->vgroup_density = smd->flow->vgroup_density;
tsmd->flow->type = smd->flow->type;
diff --git a/source/blender/blenloader/intern/versioning_270.c b/source/blender/blenloader/intern/versioning_270.c
index bab1a45796d..86c5a7913d3 100644
--- a/source/blender/blenloader/intern/versioning_270.c
+++ b/source/blender/blenloader/intern/versioning_270.c
@@ -1711,7 +1711,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
VPaint *vp = i ? ts->vpaint : ts->wpaint;
if (vp != NULL) {
/* remove all other flags */
- vp->flag &= (VP_FLAG_SPRAY | VP_FLAG_VGROUP_RESTRICT);
+ vp->flag &= (VP_FLAG_VGROUP_RESTRICT);
vp->normal_angle = 80;
}
}
diff --git a/source/blender/bmesh/intern/bmesh_opdefines.c b/source/blender/bmesh/intern/bmesh_opdefines.c
index a55df234264..4f48dafd211 100644
--- a/source/blender/bmesh/intern/bmesh_opdefines.c
+++ b/source/blender/bmesh/intern/bmesh_opdefines.c
@@ -1684,7 +1684,7 @@ static BMOpDefine bmo_create_circle_def = {
{{"cap_ends", BMO_OP_SLOT_BOOL}, /* whether or not to fill in the ends with faces */
{"cap_tris", BMO_OP_SLOT_BOOL}, /* fill ends with triangles instead of ngons */
{"segments", BMO_OP_SLOT_INT},
- {"diameter", BMO_OP_SLOT_FLT}, /* diameter of one end */
+ {"radius", BMO_OP_SLOT_FLT}, /* Radius of the circle. */
{"matrix", BMO_OP_SLOT_MAT}, /* matrix to multiply the new geometry with */
{"calc_uvs", BMO_OP_SLOT_BOOL}, /* calculate default UVs */
{{'\0'}},
diff --git a/source/blender/bmesh/operators/bmo_primitive.c b/source/blender/bmesh/operators/bmo_primitive.c
index d8f83d786b4..95d61763902 100644
--- a/source/blender/bmesh/operators/bmo_primitive.c
+++ b/source/blender/bmesh/operators/bmo_primitive.c
@@ -1285,7 +1285,7 @@ void bmo_create_monkey_exec(BMesh *bm, BMOperator *op)
void bmo_create_circle_exec(BMesh *bm, BMOperator *op)
{
- const float dia = BMO_slot_float_get(op->slots_in, "diameter");
+ const float radius = BMO_slot_float_get(op->slots_in, "radius");
const int segs = BMO_slot_int_get(op->slots_in, "segments");
const bool cap_ends = BMO_slot_bool_get(op->slots_in, "cap_ends");
const bool cap_tris = BMO_slot_bool_get(op->slots_in, "cap_tris");
@@ -1315,8 +1315,8 @@ void bmo_create_circle_exec(BMesh *bm, BMOperator *op)
for (a = 0; a < segs; a++, phi += phid) {
/* Going this way ends up with normal(s) upward */
- vec[0] = -dia * sinf(phi);
- vec[1] = dia * cosf(phi);
+ vec[0] = -radius * sinf(phi);
+ vec[1] = radius * cosf(phi);
vec[2] = 0.0f;
mul_m4_v3(mat, vec);
v1 = BM_vert_create(bm, vec, NULL, BM_CREATE_NOP);
@@ -1351,7 +1351,7 @@ void bmo_create_circle_exec(BMesh *bm, BMOperator *op)
BMO_face_flag_enable(bm, f, FACE_NEW);
if (calc_uvs) {
- BM_mesh_calc_uvs_circle(bm, mat, dia, FACE_NEW, cd_loop_uv_offset);
+ BM_mesh_calc_uvs_circle(bm, mat, radius, FACE_NEW, cd_loop_uv_offset);
}
}
diff --git a/source/blender/editors/mesh/editmesh_add.c b/source/blender/editors/mesh/editmesh_add.c
index 07fedffaf80..77772cfc8cc 100644
--- a/source/blender/editors/mesh/editmesh_add.c
+++ b/source/blender/editors/mesh/editmesh_add.c
@@ -233,7 +233,7 @@ static int add_primitive_circle_exec(bContext *C, wmOperator *op)
if (!EDBM_op_call_and_selectf(
em, op, "verts.out", false,
- "create_circle segments=%i diameter=%f cap_ends=%b cap_tris=%b matrix=%m4 calc_uvs=%b",
+ "create_circle segments=%i radius=%f cap_ends=%b cap_tris=%b matrix=%m4 calc_uvs=%b",
RNA_int_get(op->ptr, "vertices"), RNA_float_get(op->ptr, "radius"),
cap_end, cap_tri, mat, calc_uvs))
{
diff --git a/source/blender/editors/mesh/meshtools.c b/source/blender/editors/mesh/meshtools.c
index 5261baeab57..da0da05bb13 100644
--- a/source/blender/editors/mesh/meshtools.c
+++ b/source/blender/editors/mesh/meshtools.c
@@ -80,7 +80,7 @@
static void join_mesh_single(
bContext *C, Main *bmain, Scene *scene,
- Object *ob_dst, Base *base_src, float imat[4][4],
+ Object *ob_dst, Object *ob_src, float imat[4][4],
MVert **mvert_pp, MEdge **medge_pp, MLoop **mloop_pp, MPoly **mpoly_pp,
CustomData *vdata, CustomData *edata, CustomData *ldata, CustomData *pdata,
int totvert, int totedge, int totloop, int totpoly,
@@ -91,7 +91,7 @@ static void join_mesh_single(
EvaluationContext eval_ctx;
int a, b;
- Mesh *me = base_src->object->data;
+ Mesh *me = ob_src->data;
MVert *mvert = *mvert_pp;
MEdge *medge = *medge_pp;
MLoop *mloop = *mloop_pp;
@@ -117,10 +117,10 @@ static void join_mesh_single(
/* Build src to merged mapping of vgroup indices. */
bDeformGroup *dg_src;
- int *vgroup_index_map = alloca(sizeof(*vgroup_index_map) * BLI_listbase_count(&base_src->object->defbase));
+ int *vgroup_index_map = alloca(sizeof(*vgroup_index_map) * BLI_listbase_count(&ob_src->defbase));
bool is_vgroup_remap_needed = false;
- for (dg_src = base_src->object->defbase.first, b = 0; dg_src; dg_src = dg_src->next, b++) {
+ for (dg_src = ob_src->defbase.first, b = 0; dg_src; dg_src = dg_src->next, b++) {
vgroup_index_map[b] = defgroup_name_index(ob_dst, dg_src->name);
is_vgroup_remap_needed = is_vgroup_remap_needed || (vgroup_index_map[b] != b);
}
@@ -135,11 +135,11 @@ static void join_mesh_single(
}
/* if this is the object we're merging into, no need to do anything */
- if (base_src->object != ob_dst) {
+ if (ob_src != ob_dst) {
float cmat[4][4];
/* watch this: switch matmul order really goes wrong */
- mul_m4_m4m4(cmat, imat, base_src->object->obmat);
+ mul_m4_m4m4(cmat, imat, ob_src->obmat);
/* transform vertex coordinates into new space */
for (a = 0, mvert = *mvert_pp; a < me->totvert; a++, mvert++) {
@@ -216,13 +216,13 @@ static void join_mesh_single(
}
if (me->totloop) {
- if (base_src->object != ob_dst) {
+ if (ob_src != ob_dst) {
MultiresModifierData *mmd;
- multiresModifier_prepare_join(&eval_ctx, scene, base_src->object, ob_dst);
+ multiresModifier_prepare_join(&eval_ctx, scene, ob_src, ob_dst);
- if ((mmd = get_multires_modifier(scene, base_src->object, true))) {
- ED_object_iter_other(bmain, base_src->object, true,
+ if ((mmd = get_multires_modifier(scene, ob_src, true))) {
+ ED_object_iter_other(bmain, ob_src, true,
ED_object_multires_update_totlevels_cb,
&mmd->totlvl);
}
@@ -240,8 +240,8 @@ static void join_mesh_single(
if (me->totpoly) {
if (matmap) {
/* make mapping for materials */
- for (a = 1; a <= base_src->object->totcol; a++) {
- Material *ma = give_current_material(base_src->object, a);
+ for (a = 1; a <= ob_src->totcol; a++) {
+ Material *ma = give_current_material(ob_src, a);
for (b = 0; b < totcol; b++) {
if (ma == matar[b]) {
@@ -276,8 +276,7 @@ int join_mesh_exec(bContext *C, wmOperator *op)
{
Main *bmain = CTX_data_main(C);
Scene *scene = CTX_data_scene(C);
- Base *ob_base = CTX_data_active_base(C);
- Object *ob = ob_base->object;
+ Object *ob = CTX_data_active_object(C);
Material **matar = NULL, *ma;
Mesh *me;
MVert *mvert = NULL;
@@ -500,7 +499,7 @@ int join_mesh_exec(bContext *C, wmOperator *op)
*/
join_mesh_single(
C, bmain, scene,
- ob, ob_base, imat,
+ ob, ob, imat,
&mvert, &medge, &mloop, &mpoly,
&vdata, &edata, &ldata, &pdata,
totvert, totedge, totloop, totpoly,
@@ -517,7 +516,7 @@ int join_mesh_exec(bContext *C, wmOperator *op)
if (base->object->type == OB_MESH) {
join_mesh_single(
C, bmain, scene,
- ob, base, imat,
+ ob, base->object, imat,
&mvert, &medge, &mloop, &mpoly,
&vdata, &edata, &ldata, &pdata,
totvert, totedge, totloop, totpoly,
diff --git a/source/blender/editors/sculpt_paint/paint_intern.h b/source/blender/editors/sculpt_paint/paint_intern.h
index 83246f7cc7f..b3b7d40391a 100644
--- a/source/blender/editors/sculpt_paint/paint_intern.h
+++ b/source/blender/editors/sculpt_paint/paint_intern.h
@@ -241,8 +241,8 @@ void paint_calc_redraw_planes(float planes[4][4],
const struct rcti *screen_rect);
float paint_calc_object_space_radius(struct ViewContext *vc, const float center[3], float pixel_radius);
-float paint_get_tex_pixel(struct MTex *mtex, float u, float v, struct ImagePool *pool, int thread);
-void paint_get_tex_pixel_col(struct MTex *mtex, float u, float v, float rgba[4], struct ImagePool *pool, int thread, bool convert, struct ColorSpace *colorspace);
+float paint_get_tex_pixel(const struct MTex *mtex, float u, float v, struct ImagePool *pool, int thread);
+void paint_get_tex_pixel_col(const struct MTex *mtex, float u, float v, float rgba[4], struct ImagePool *pool, int thread, bool convert, struct ColorSpace *colorspace);
void paint_sample_color(struct bContext *C, struct ARegion *ar, int x, int y, bool texpaint_proj, bool palette);
diff --git a/source/blender/editors/sculpt_paint/paint_utils.c b/source/blender/editors/sculpt_paint/paint_utils.c
index c432990d4c3..bb69a5d3db9 100644
--- a/source/blender/editors/sculpt_paint/paint_utils.c
+++ b/source/blender/editors/sculpt_paint/paint_utils.c
@@ -168,7 +168,7 @@ float paint_calc_object_space_radius(ViewContext *vc, const float center[3],
return len_v3(delta) / scale;
}
-float paint_get_tex_pixel(MTex *mtex, float u, float v, struct ImagePool *pool, int thread)
+float paint_get_tex_pixel(const MTex *mtex, float u, float v, struct ImagePool *pool, int thread)
{
float intensity, rgba[4];
float co[3] = {u, v, 0.0f};
@@ -179,7 +179,7 @@ float paint_get_tex_pixel(MTex *mtex, float u, float v, struct ImagePool *pool,
return intensity;
}
-void paint_get_tex_pixel_col(MTex *mtex, float u, float v, float rgba[4], struct ImagePool *pool, int thread, bool convert_to_linear, struct ColorSpace *colorspace)
+void paint_get_tex_pixel_col(const MTex *mtex, float u, float v, float rgba[4], struct ImagePool *pool, int thread, bool convert_to_linear, struct ColorSpace *colorspace)
{
float co[3] = {u, v, 0.0f};
int hasrgb;
diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c
index 1df6030bb10..5d87030bc67 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex.c
@@ -149,7 +149,7 @@ static bool vwpaint_use_normal(const VPaint *vp)
}
-static void defweight_prev_restore_or_init(MDeformVert *dvert_prev, MDeformVert *dvert_curr, int index)
+static MDeformVert *defweight_prev_init(MDeformVert *dvert_prev, MDeformVert *dvert_curr, int index)
{
MDeformVert *dv_curr = &dvert_curr[index];
MDeformVert *dv_prev = &dvert_prev[index];
@@ -157,9 +157,7 @@ static void defweight_prev_restore_or_init(MDeformVert *dvert_prev, MDeformVert
dv_prev->flag = 0;
defvert_copy(dv_prev, dv_curr);
}
- else {
- defvert_copy(dv_curr, dv_prev);
- }
+ return dv_prev;
}
/* check if we can do partial updates and have them draw realtime
@@ -242,11 +240,10 @@ int weight_paint_poll(bContext *C)
return 0;
}
-static VPaint *new_vpaint(int wpaint)
+static VPaint *new_vpaint(void)
{
VPaint *vp = MEM_callocN(sizeof(VPaint), "VPaint");
- vp->flag = (wpaint) ? 0 : VP_FLAG_SPRAY;
vp->paint.flags |= PAINT_SHOW_BRUSH;
return vp;
@@ -263,18 +260,18 @@ uint vpaint_get_current_col(Scene *scene, VPaint *vp)
/* wpaint has 'wpaint_blend' */
static uint vpaint_blend(
- VPaint *vp, uint color_curr, uint color_orig,
+ const VPaint *vp, uint color_curr, uint color_orig,
uint color_paint, const int alpha_i,
/* pre scaled from [0-1] --> [0-255] */
const int brush_alpha_value_i)
{
- Brush *brush = BKE_paint_brush(&vp->paint);
+ const Brush *brush = vp->paint.brush;
const int tool = brush->vertexpaint_tool;
uint color_blend = ED_vpaint_blend_tool(tool, color_curr, color_paint, alpha_i);
- /* if no spray, clip color adding with colorig & orig alpha */
- if ((vp->flag & VP_FLAG_SPRAY) == 0) {
+ /* if no accumulate, clip color adding with colorig & orig alpha */
+ if ((brush->flag & BRUSH_ACCUMULATE) == 0) {
uint color_test, a;
char *cp, *ct, *co;
@@ -384,12 +381,12 @@ static float calc_vp_alpha_col_dl(
/* vpaint has 'vpaint_blend' */
static float wpaint_blend(
- VPaint *wp, float weight,
+ const VPaint *wp, float weight,
const float alpha, float paintval,
const float UNUSED(brush_alpha_value),
const short do_flip)
{
- Brush *brush = BKE_paint_brush(&wp->paint);
+ const Brush *brush = wp->paint.brush;
int tool = brush->vertexpaint_tool;
if (do_flip) {
@@ -414,6 +411,16 @@ static float wpaint_blend(
return weight;
}
+static float wpaint_clamp_monotonic(float oldval, float curval, float newval)
+{
+ if (newval < oldval)
+ return MIN2(newval, curval);
+ else if (newval > oldval)
+ return MAX2(newval, curval);
+ else
+ return newval;
+}
+
/* ----------------------------------------------------- */
static void do_weight_paint_normalize_all(MDeformVert *dvert, const int defbase_tot, const bool *vgroup_validmap)
@@ -699,7 +706,7 @@ typedef struct WeightPaintInfo {
static void do_weight_paint_vertex_single(
/* vars which remain the same for every vert */
- VPaint *wp, Object *ob, const WeightPaintInfo *wpi,
+ const VPaint *wp, Object *ob, const WeightPaintInfo *wpi,
/* vars which change on each stroke */
const uint index, float alpha, float paintweight)
{
@@ -708,6 +715,7 @@ static void do_weight_paint_vertex_single(
bool topology = (me->editflag & ME_EDIT_MIRROR_TOPO) != 0;
MDeformWeight *dw;
+ float weight_prev;
/* mirror vars */
int index_mirr;
@@ -731,14 +739,6 @@ static void do_weight_paint_vertex_single(
index_mirr = vgroup_mirr = -1;
}
- if ((wp->flag & VP_FLAG_SPRAY) == 0) {
- struct MDeformVert *dvert_prev = ob->sculpt->mode.wpaint.dvert_prev;
- defweight_prev_restore_or_init(dvert_prev, me->dvert, index);
- if (index_mirr != -1) {
- defweight_prev_restore_or_init(dvert_prev, me->dvert, index_mirr);
- }
- }
-
if (wp->flag & VP_FLAG_VGROUP_RESTRICT) {
dw = defvert_find_index(dv, wpi->active.index);
}
@@ -783,14 +783,29 @@ static void do_weight_paint_vertex_single(
dw_mirr = NULL;
}
+ if ((wp->paint.brush->flag & BRUSH_ACCUMULATE) == 0) {
+ MDeformVert *dvert_prev = ob->sculpt->mode.wpaint.dvert_prev;
+ MDeformVert *dv_prev = defweight_prev_init(dvert_prev, me->dvert, index);
+ if (index_mirr != -1) {
+ defweight_prev_init(dvert_prev, me->dvert, index_mirr);
+ }
+
+ weight_prev = defvert_find_weight(dv_prev, wpi->active.index);
+ }
+ else {
+ weight_prev = dw->weight;
+ }
+
/* If there are no normalize-locks or multipaint,
* then there is no need to run the more complicated checks */
{
- dw->weight = wpaint_blend(
- wp, dw->weight, alpha, paintweight,
+ float new_weight = wpaint_blend(
+ wp, weight_prev, alpha, paintweight,
wpi->brush_alpha_value, wpi->do_flip);
+ dw->weight = wpaint_clamp_monotonic(weight_prev, dw->weight, new_weight);
+
/* WATCH IT: take care of the ordering of applying mirror -> normalize,
* can give wrong results [#26193], least confusing if normalize is done last */
@@ -848,7 +863,7 @@ static void do_weight_paint_vertex_single(
static void do_weight_paint_vertex_multi(
/* vars which remain the same for every vert */
- VPaint *wp, Object *ob, const WeightPaintInfo *wpi,
+ const VPaint *wp, Object *ob, const WeightPaintInfo *wpi,
/* vars which change on each stroke */
const uint index, float alpha, float paintweight)
{
@@ -861,7 +876,7 @@ static void do_weight_paint_vertex_multi(
MDeformVert *dv_mirr = NULL;
/* weights */
- float curw, neww, change, curw_mirr, change_mirr;
+ float curw, oldw, neww, change, curw_mirr, change_mirr;
/* from now on we can check if mirrors enabled if this var is -1 and not bother with the flag */
if (me->editflag & ME_EDIT_MIRROR_X) {
@@ -875,14 +890,6 @@ static void do_weight_paint_vertex_multi(
}
}
- if ((wp->flag & VP_FLAG_SPRAY) == 0) {
- struct MDeformVert *dvert_prev = ob->sculpt->mode.wpaint.dvert_prev;
- defweight_prev_restore_or_init(dvert_prev, me->dvert, index);
- if (index_mirr != -1) {
- defweight_prev_restore_or_init(dvert_prev, me->dvert, index_mirr);
- }
- }
-
/* compute weight change by applying the brush to average or sum of group weights */
curw = BKE_defvert_multipaint_collective_weight(
dv, wpi->defbase_tot, wpi->defbase_sel, wpi->defbase_tot_sel, wpi->do_auto_normalize);
@@ -892,7 +899,22 @@ static void do_weight_paint_vertex_multi(
return;
}
- neww = wpaint_blend(wp, curw, alpha, paintweight, wpi->brush_alpha_value, wpi->do_flip);
+ if ((wp->paint.brush->flag & BRUSH_ACCUMULATE) == 0) {
+ MDeformVert *dvert_prev = ob->sculpt->mode.wpaint.dvert_prev;
+ MDeformVert *dv_prev = defweight_prev_init(dvert_prev, me->dvert, index);
+ if (index_mirr != -1) {
+ defweight_prev_init(dvert_prev, me->dvert, index_mirr);
+ }
+
+ oldw = BKE_defvert_multipaint_collective_weight(
+ dv_prev, wpi->defbase_tot, wpi->defbase_sel, wpi->defbase_tot_sel, wpi->do_auto_normalize);
+ }
+ else {
+ oldw = curw;
+ }
+
+ neww = wpaint_blend(wp, oldw, alpha, paintweight, wpi->brush_alpha_value, wpi->do_flip);
+ neww = wpaint_clamp_monotonic(oldw, curw, neww);
change = neww / curw;
@@ -946,7 +968,7 @@ static void do_weight_paint_vertex_multi(
static void do_weight_paint_vertex(
/* vars which remain the same for every vert */
- VPaint *wp, Object *ob, const WeightPaintInfo *wpi,
+ const VPaint *wp, Object *ob, const WeightPaintInfo *wpi,
/* vars which change on each stroke */
const uint index, float alpha, float paintweight)
{
@@ -1008,7 +1030,7 @@ static void vertex_paint_init_session_data(const ToolSettings *ts, Object *ob)
/* Create average brush arrays */
if (ob->mode == OB_MODE_VERTEX_PAINT) {
- if ((ts->vpaint->flag & VP_FLAG_SPRAY) == 0) {
+ if ((brush->flag & BRUSH_ACCUMULATE) == 0) {
if (ob->sculpt->mode.vpaint.previous_color == NULL) {
ob->sculpt->mode.vpaint.previous_color =
MEM_callocN(me->totloop * sizeof(uint), __func__);
@@ -1017,19 +1039,9 @@ static void vertex_paint_init_session_data(const ToolSettings *ts, Object *ob)
else {
MEM_SAFE_FREE(ob->sculpt->mode.vpaint.previous_color);
}
-
- if (brush && brush->flag & BRUSH_ACCUMULATE) {
- if (ob->sculpt->mode.vpaint.previous_accum == NULL) {
- ob->sculpt->mode.vpaint.previous_accum =
- MEM_callocN(me->totloop * sizeof(float), __func__);
- }
- }
- else {
- MEM_SAFE_FREE(ob->sculpt->mode.vpaint.previous_accum);
- }
}
else if (ob->mode == OB_MODE_WEIGHT_PAINT) {
- if ((ts->wpaint->flag & VP_FLAG_SPRAY) == 0) {
+ if ((brush->flag & BRUSH_ACCUMULATE) == 0) {
if (ob->sculpt->mode.wpaint.alpha_weight == NULL) {
ob->sculpt->mode.wpaint.alpha_weight =
MEM_callocN(me->totvert * sizeof(float), __func__);
@@ -1052,15 +1064,6 @@ static void vertex_paint_init_session_data(const ToolSettings *ts, Object *ob)
ob->sculpt->mode.wpaint.dvert_prev = NULL;
}
}
- if (brush && brush->flag & BRUSH_ACCUMULATE) {
- if (ob->sculpt->mode.wpaint.previous_accum == NULL) {
- ob->sculpt->mode.wpaint.previous_accum =
- MEM_callocN(me->totvert * sizeof(float), __func__);
- }
- }
- else {
- MEM_SAFE_FREE(ob->sculpt->mode.wpaint.previous_accum);
- }
}
}
@@ -1119,7 +1122,7 @@ static int wpaint_mode_toggle_exec(bContext *C, wmOperator *op)
ob->mode |= mode_flag;
if (wp == NULL)
- wp = scene->toolsettings->wpaint = new_vpaint(1);
+ wp = scene->toolsettings->wpaint = new_vpaint();
paint_cursor_start(C, weight_paint_poll);
@@ -1187,9 +1190,6 @@ struct WPaintData {
struct WeightPaintGroupData active, mirror;
- void *vp_handle;
- DMCoNo *vertexcosnos;
-
float wpimat[3][3];
/* variables for auto normalize */
@@ -1202,16 +1202,22 @@ struct WPaintData {
bool do_multipaint; /* true if multipaint enabled and multiple groups selected */
int defbase_tot;
+
+ /* Special storage for smear brush, avoid feedback loop - update each step and swap. */
+ struct {
+ float *weight_prev;
+ float *weight_curr;
+ } smear;
};
/* Initialize the stroke cache invariants from operator properties */
static void vwpaint_update_cache_invariants(
- bContext *C, VPaint *vp, SculptSession *ss, wmOperator *op, const float mouse[2])
+ bContext *C, const VPaint *vp, SculptSession *ss, wmOperator *op, const float mouse[2])
{
StrokeCache *cache;
Scene *scene = CTX_data_scene(C);
UnifiedPaintSettings *ups = &CTX_data_tool_settings(C)->unified_paint_settings;
- Brush *brush = BKE_paint_brush(&vp->paint);
+ const Brush *brush = vp->paint.brush;
ViewContext *vc = paint_stroke_view_context(op->customdata);
Object *ob = CTX_data_active_object(C);
float mat[3][3];
@@ -1429,10 +1435,25 @@ static bool wpaint_stroke_test_start(bContext *C, wmOperator *op, const float mo
wpd->mirror.lock = tmpflags;
}
- /* painting on subsurfs should give correct points too, this returns me->totvert amount */
- ob->sculpt->building_vp_handle = true;
- wpd->vp_handle = ED_vpaint_proj_handle_create(&eval_ctx, scene, ob, &wpd->vertexcosnos);
- ob->sculpt->building_vp_handle = false;
+ if (vp->paint.brush->vertexpaint_tool == PAINT_BLEND_SMEAR) {
+ wpd->smear.weight_prev = MEM_mallocN(sizeof(float) * me->totvert, __func__);
+ const MDeformVert *dv = me->dvert;
+ if (wpd->do_multipaint) {
+ const bool do_auto_normalize = ((ts->auto_normalize != 0) && (wpd->vgroup_validmap != NULL));
+ for (int i = 0; i < me->totvert; i++, dv++) {
+ float weight = BKE_defvert_multipaint_collective_weight(
+ dv, wpd->defbase_tot, wpd->defbase_sel, wpd->defbase_tot_sel, do_auto_normalize);
+ CLAMP(weight, 0.0f, 1.0f);
+ wpd->smear.weight_prev[i] = weight;
+ }
+ }
+ else {
+ for (int i = 0; i < me->totvert; i++, dv++) {
+ wpd->smear.weight_prev[i] = defvert_find_weight(dv, wpd->active.index);
+ }
+ }
+ wpd->smear.weight_curr = MEM_dupallocN(wpd->smear.weight_prev);
+ }
/* imat for normals */
mul_m4_m4m4(mat, wpd->vc.rv3d->viewmat, ob->obmat);
@@ -1567,14 +1588,17 @@ static void do_wpaint_brush_blur_task_cb_ex(
view_angle_limits_apply_falloff(&data->wpd->normal_angle_precalc, angle_cos, &brush_strength)))
{
const float brush_fade = BKE_brush_curve_strength(brush, sqrtf(test.dist), cache->radius);
- float final_alpha =
+ const float final_alpha =
brush_fade * brush_strength *
grid_alpha * brush_alpha_pressure;
- if (brush->flag & BRUSH_ACCUMULATE) {
- float mask_accum = ss->mode.wpaint.previous_accum[v_index];
- final_alpha = min_ff(final_alpha + mask_accum, brush_strength);
- ss->mode.wpaint.previous_accum[v_index] = final_alpha;
+ if ((brush->flag & BRUSH_ACCUMULATE) == 0) {
+ if (ss->mode.wpaint.alpha_weight[v_index] < final_alpha) {
+ ss->mode.wpaint.alpha_weight[v_index] = final_alpha;
+ }
+ else {
+ continue;
+ }
}
weight_final /= total_hit_loops;
@@ -1611,7 +1635,7 @@ static void do_wpaint_brush_smear_task_cb_ex(
sub_v3_v3v3(brush_dir, cache->location, cache->last_location);
project_plane_v3_v3v3(brush_dir, brush_dir, cache->view_normal);
- if (normalize_v3(brush_dir) != 0.0f) {
+ if (cache->is_last_valid && (normalize_v3(brush_dir) != 0.0f)) {
SculptBrushTest test;
SculptBrushTestFn sculpt_brush_test_sq_fn =
@@ -1667,8 +1691,7 @@ static void do_wpaint_brush_smear_task_cb_ex(
if (stroke_dot > stroke_dot_max) {
stroke_dot_max = stroke_dot;
- MDeformVert *dv = &data->me->dvert[v_other_index];
- weight_final = wpaint_get_active_weight(dv, data->wpi);
+ weight_final = data->wpd->smear.weight_prev[v_other_index];
do_color = true;
}
}
@@ -1676,13 +1699,16 @@ static void do_wpaint_brush_smear_task_cb_ex(
}
/* Apply weight to vertex */
if (do_color) {
- const float brush_fade = BKE_brush_curve_strength(brush, 0.0f, cache->radius);
- float final_alpha =
+ const float brush_fade = BKE_brush_curve_strength(brush, sqrtf(test.dist), cache->radius);
+ const float final_alpha =
brush_fade * brush_strength *
grid_alpha * brush_alpha_pressure;
do_weight_paint_vertex(
data->vp, data->ob, data->wpi,
v_index, final_alpha, (float)weight_final);
+ /* Access the weight again because it might not have been applied completely. */
+ data->wpd->smear.weight_curr[v_index] =
+ wpaint_get_active_weight(&data->me->dvert[v_index], data->wpi);
}
}
}
@@ -1702,7 +1728,9 @@ static void do_wpaint_brush_draw_task_cb_ex(
const Brush *brush = data->brush;
const StrokeCache *cache = ss->cache;
- const float paintweight = BKE_brush_weight_get(scene, brush);
+ /* note: normally `BKE_brush_weight_get(scene, brush)` is used,
+ * however in this case we calculate a new weight each time. */
+ const float paintweight = data->strength;
float brush_size_pressure, brush_alpha_value, brush_alpha_pressure;
get_brush_alpha_data(scene, ss, brush, &brush_size_pressure, &brush_alpha_value, &brush_alpha_pressure);
const bool use_normal = vwpaint_use_normal(data->vp);
@@ -1737,16 +1765,9 @@ static void do_wpaint_brush_draw_task_cb_ex(
view_angle_limits_apply_falloff(&data->wpd->normal_angle_precalc, angle_cos, &brush_strength)))
{
const float brush_fade = BKE_brush_curve_strength(brush, sqrtf(test.dist), cache->radius);
- float final_alpha = brush_fade * brush_strength * grid_alpha * brush_alpha_pressure;
- if (brush->flag & BRUSH_ACCUMULATE) {
- float mask_accum = ss->mode.wpaint.previous_accum[v_index];
- final_alpha = min_ff(final_alpha + mask_accum, brush_strength);
- ss->mode.wpaint.previous_accum[v_index] = final_alpha;
- }
+ const float final_alpha = brush_fade * brush_strength * grid_alpha * brush_alpha_pressure;
- /* Non-spray logic. */
- if ((data->vp->flag & VP_FLAG_SPRAY) == 0) {
- /* Only paint if we have greater alpha. */
+ if ((brush->flag & BRUSH_ACCUMULATE) == 0) {
if (ss->mode.wpaint.alpha_weight[v_index] < final_alpha) {
ss->mode.wpaint.alpha_weight[v_index] = final_alpha;
}
@@ -1812,9 +1833,6 @@ static void do_wpaint_brush_calc_average_weight_cb_ex(
static void calculate_average_weight(SculptThreadedTaskData *data, PBVHNode **UNUSED(nodes), int totnode)
{
- Scene *scene = CTX_data_scene(data->C);
- UnifiedPaintSettings *ups = &scene->toolsettings->unified_paint_settings;
-
struct WPaintAverageAccum *accum = MEM_mallocN(sizeof(*accum) * totnode, __func__);
data->custom_data = accum;
@@ -1830,10 +1848,7 @@ static void calculate_average_weight(SculptThreadedTaskData *data, PBVHNode **UN
}
if (accum_len != 0) {
accum_weight /= accum_len;
- if (ups->flag & UNIFIED_PAINT_WEIGHT)
- ups->weight = (float)accum_weight;
- else
- data->brush->weight = (float)accum_weight;
+ data->strength = (float)accum_weight;
}
MEM_SAFE_FREE(data->custom_data); /* 'accum' */
@@ -1844,13 +1859,17 @@ static void wpaint_paint_leaves(
bContext *C, Object *ob, Sculpt *sd, VPaint *vp, struct WPaintData *wpd, WeightPaintInfo *wpi,
Mesh *me, PBVHNode **nodes, int totnode)
{
- Brush *brush = ob->sculpt->cache->brush;
+ Scene *scene = CTX_data_scene(C);
+ const Brush *brush = ob->sculpt->cache->brush;
/* threaded loop over nodes */
SculptThreadedTaskData data = {
.sd = sd, .ob = ob, .brush = brush, .nodes = nodes, .vp = vp, .wpd = wpd, .wpi = wpi, .me = me, .C = C,
};
+ /* Use this so average can modify its weight without touching the brush. */
+ data.strength = BKE_brush_weight_get(scene, brush);
+
/* current mirroring code cannot be run in parallel */
bool use_threading = !(me->editflag & ME_EDIT_MIRROR_X);
@@ -2055,6 +2074,10 @@ static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P
swap_m4m4(vc->rv3d->persmat, mat);
+ if (wp->paint.brush->vertexpaint_tool == PAINT_BLEND_SMEAR) {
+ SWAP(float *, wpd->smear.weight_curr, wpd->smear.weight_prev);
+ }
+
/* calculate pivot for rotation around seletion if needed */
/* also needed for "View Selected" on last stroke */
paint_last_stroke_update(scene, vc->ar, mval);
@@ -2094,8 +2117,6 @@ static void wpaint_stroke_done(const bContext *C, struct PaintStroke *stroke)
struct WPaintData *wpd = paint_stroke_mode_data(stroke);
if (wpd) {
- ED_vpaint_proj_handle_free(wpd->vp_handle);
-
if (wpd->defbase_sel)
MEM_freeN((void *)wpd->defbase_sel);
if (wpd->vgroup_validmap)
@@ -2106,6 +2127,10 @@ static void wpaint_stroke_done(const bContext *C, struct PaintStroke *stroke)
MEM_freeN((void *)wpd->active.lock);
if (wpd->mirror.lock)
MEM_freeN((void *)wpd->mirror.lock);
+ if (wpd->smear.weight_prev)
+ MEM_freeN(wpd->smear.weight_prev);
+ if (wpd->smear.weight_curr)
+ MEM_freeN(wpd->smear.weight_curr);
MEM_freeN(wpd);
}
@@ -2253,7 +2278,7 @@ static int vpaint_mode_toggle_exec(bContext *C, wmOperator *op)
ED_mesh_color_ensure(me, NULL);
if (vp == NULL)
- vp = scene->toolsettings->vpaint = new_vpaint(0);
+ vp = scene->toolsettings->vpaint = new_vpaint();
paint_cursor_start(C, vertex_paint_poll);
@@ -2342,6 +2367,12 @@ struct VPaintData {
bool *mlooptag;
bool is_texbrush;
+
+ /* Special storage for smear brush, avoid feedback loop - update each step and swap. */
+ struct {
+ uint *color_prev;
+ uint *color_curr;
+ } smear;
};
static bool vpaint_stroke_test_start(bContext *C, struct wmOperator *op, const float mouse[2])
@@ -2396,6 +2427,12 @@ static bool vpaint_stroke_test_start(bContext *C, struct wmOperator *op, const f
vpd->mlooptag = MEM_mallocN(sizeof(bool) * me->totloop, "VPaintData mlooptag");
}
+ if (brush->vertexpaint_tool == PAINT_BLEND_SMEAR) {
+ vpd->smear.color_prev = MEM_mallocN(sizeof(uint) * me->totloop, __func__);
+ memcpy(vpd->smear.color_prev, me->mloopcol, sizeof(uint) * me->totloop);
+ vpd->smear.color_curr = MEM_dupallocN(vpd->smear.color_prev);
+ }
+
/* Create projection handle */
if (vpd->is_texbrush) {
ob->sculpt->building_vp_handle = true;
@@ -2560,14 +2597,9 @@ static void do_vpaint_brush_draw_task_cb_ex(
}
color_orig = ss->mode.vpaint.previous_color[l_index];
}
- float final_alpha =
+ const float final_alpha =
255 * brush_fade * brush_strength *
tex_alpha * brush_alpha_pressure * grid_alpha;
- if (brush->flag & BRUSH_ACCUMULATE) {
- float mask_accum = ss->mode.vpaint.previous_accum[l_index];
- final_alpha = min_ff(final_alpha + mask_accum, 255.0f * brush_strength);
- ss->mode.vpaint.previous_accum[l_index] = final_alpha;
- }
/* Mix the new color with the original based on final_alpha. */
lcol[l_index] = vpaint_blend(
@@ -2671,7 +2703,7 @@ static void do_vpaint_brush_blur_task_cb_ex(
}
color_orig = ss->mode.vpaint.previous_color[l_index];
}
- float final_alpha =
+ const float final_alpha =
255 * brush_fade * brush_strength *
brush_alpha_pressure * grid_alpha;
/* Mix the new color with the original
@@ -2711,7 +2743,7 @@ static void do_vpaint_brush_smear_task_cb_ex(
sub_v3_v3v3(brush_dir, cache->location, cache->last_location);
project_plane_v3_v3v3(brush_dir, brush_dir, cache->view_normal);
- if (normalize_v3(brush_dir) != 0.0f) {
+ if (cache->is_last_valid && (normalize_v3(brush_dir) != 0.0f)) {
SculptBrushTest test;
SculptBrushTestFn sculpt_brush_test_sq_fn =
@@ -2754,6 +2786,7 @@ static void do_vpaint_brush_smear_task_cb_ex(
const int p_index = gmap->vert_to_poly[v_index].indices[j];
const int l_index = gmap->vert_to_loop[v_index].indices[j];
BLI_assert(data->me->mloop[l_index].v == v_index);
+ UNUSED_VARS_NDEBUG(l_index);
const MPoly *mp = &data->me->mpoly[p_index];
if (!use_face_sel || mp->flag & ME_FACE_SEL) {
const MLoop *ml_other = &data->me->mloop[mp->loopstart];
@@ -2773,7 +2806,7 @@ static void do_vpaint_brush_smear_task_cb_ex(
if (stroke_dot > stroke_dot_max) {
stroke_dot_max = stroke_dot;
- color_final = lcol[mp->loopstart + k];
+ color_final = data->vpd->smear.color_prev[mp->loopstart + k];
do_color = true;
}
}
@@ -2782,6 +2815,10 @@ static void do_vpaint_brush_smear_task_cb_ex(
}
if (do_color) {
+ const float final_alpha =
+ 255 * brush_fade * brush_strength *
+ brush_alpha_pressure * grid_alpha;
+
/* For each poly owning this vert, paint each loop belonging to this vert. */
for (int j = 0; j < gmap->vert_to_poly[v_index].count; j++) {
const int p_index = gmap->vert_to_poly[v_index].indices[j];
@@ -2798,14 +2835,13 @@ static void do_vpaint_brush_smear_task_cb_ex(
}
color_orig = ss->mode.vpaint.previous_color[l_index];
}
- float final_alpha =
- 255 * brush_fade * brush_strength *
- brush_alpha_pressure * grid_alpha;
/* Mix the new color with the original
* based on the brush strength and the curve. */
lcol[l_index] = vpaint_blend(
data->vp, lcol[l_index], color_orig, color_final,
final_alpha, 255 * brush_strength);
+
+ data->vpd->smear.color_curr[l_index] = lcol[l_index];
}
}
}
@@ -2850,7 +2886,7 @@ static void vpaint_paint_leaves(
bContext *C, Sculpt *sd, VPaint *vp, struct VPaintData *vpd,
Object *ob, Mesh *me, PBVHNode **nodes, int totnode)
{
- Brush *brush = ob->sculpt->cache->brush;
+ const Brush *brush = ob->sculpt->cache->brush;
SculptThreadedTaskData data = {
.sd = sd, .ob = ob, .brush = brush, .nodes = nodes, .vp = vp, .vpd = vpd,
@@ -2983,6 +3019,10 @@ static void vpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P
BKE_mesh_batch_cache_dirty(ob->data, BKE_MESH_BATCH_DIRTY_ALL);
+ if (vp->paint.brush->vertexpaint_tool == PAINT_BLEND_SMEAR) {
+ SWAP(uint *, vpd->smear.color_curr, vpd->smear.color_prev);
+ }
+
/* calculate pivot for rotation around seletion if needed */
/* also needed for "View Selected" on last stroke */
paint_last_stroke_update(scene, vc->ar, mval);
@@ -3008,6 +3048,10 @@ static void vpaint_stroke_done(const bContext *C, struct PaintStroke *stroke)
if (vpd->mlooptag)
MEM_freeN(vpd->mlooptag);
+ if (vpd->smear.color_prev)
+ MEM_freeN(vpd->smear.color_prev);
+ if (vpd->smear.color_curr)
+ MEM_freeN(vpd->smear.color_curr);
WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob);
diff --git a/source/blender/editors/sculpt_paint/paint_vertex_color_ops.c b/source/blender/editors/sculpt_paint/paint_vertex_color_ops.c
index 32515fa81cb..d7668a48139 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex_color_ops.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex_color_ops.c
@@ -191,7 +191,7 @@ void PAINT_OT_vertex_color_from_weight(wmOperatorType *ot)
/* identifiers */
ot->name = "Vertex Color from Weight";
ot->idname = "PAINT_OT_vertex_color_from_weight";
- ot->description = "Converts active weight into greyscale vertex colors";
+ ot->description = "Convert active weight into gray scale vertex colors";
/* api callback */
ot->exec = vertex_paint_from_weight_exec;
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index ac5138deec7..aa8e536a430 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -634,7 +634,7 @@ bool sculpt_brush_test_cube(SculptBrushTest *test, const float co[3], float loca
}
}
-static float frontface(Brush *br, const float sculpt_normal[3],
+static float frontface(const Brush *br, const float sculpt_normal[3],
const short no[3], const float fno[3])
{
if (br->flag & BRUSH_FRONTFACE) {
@@ -1128,7 +1128,7 @@ static float brush_strength(
}
/* Return a multiplier for brush strength on a particular vertex. */
-float tex_strength(SculptSession *ss, Brush *br,
+float tex_strength(SculptSession *ss, const Brush *br,
const float brush_point[3],
const float len,
const short vno[3],
@@ -1138,7 +1138,7 @@ float tex_strength(SculptSession *ss, Brush *br,
{
StrokeCache *cache = ss->cache;
const Scene *scene = cache->vc->scene;
- MTex *mtex = &br->mtex;
+ const MTex *mtex = &br->mtex;
float avg = 1;
float rgba[4];
float point[3];
@@ -1556,7 +1556,7 @@ static void do_smooth_brush_mesh_task_cb_ex(
SculptThreadedTaskData *data = userdata;
SculptSession *ss = data->ob->sculpt;
Sculpt *sd = data->sd;
- Brush *brush = data->brush;
+ const Brush *brush = data->brush;
const bool smooth_mask = data->smooth_mask;
float bstrength = data->strength;
@@ -1604,7 +1604,7 @@ static void do_smooth_brush_bmesh_task_cb_ex(
SculptThreadedTaskData *data = userdata;
SculptSession *ss = data->ob->sculpt;
Sculpt *sd = data->sd;
- Brush *brush = data->brush;
+ const Brush *brush = data->brush;
const bool smooth_mask = data->smooth_mask;
float bstrength = data->strength;
@@ -1652,7 +1652,7 @@ static void do_smooth_brush_multires_task_cb_ex(
SculptDoBrushSmoothGridDataChunk *data_chunk = userdata_chunk;
SculptSession *ss = data->ob->sculpt;
Sculpt *sd = data->sd;
- Brush *brush = data->brush;
+ const Brush *brush = data->brush;
const bool smooth_mask = data->smooth_mask;
float bstrength = data->strength;
@@ -1866,7 +1866,7 @@ static void do_mask_brush_draw_task_cb_ex(
{
SculptThreadedTaskData *data = userdata;
SculptSession *ss = data->ob->sculpt;
- Brush *brush = data->brush;
+ const Brush *brush = data->brush;
const float bstrength = ss->cache->bstrength;
PBVHVertexIter vd;
@@ -1923,7 +1923,7 @@ static void do_draw_brush_task_cb_ex(
{
SculptThreadedTaskData *data = userdata;
SculptSession *ss = data->ob->sculpt;
- Brush *brush = data->brush;
+ const Brush *brush = data->brush;
const float *offset = data->offset;
PBVHVertexIter vd;
@@ -1982,7 +1982,7 @@ static void do_crease_brush_task_cb_ex(
{
SculptThreadedTaskData *data = userdata;
SculptSession *ss = data->ob->sculpt;
- Brush *brush = data->brush;
+ const Brush *brush = data->brush;
SculptProjectVector *spvc = data->spvc;
const float flippedbstrength = data->flippedbstrength;
const float *offset = data->offset;
@@ -2070,7 +2070,7 @@ static void do_pinch_brush_task_cb_ex(
{
SculptThreadedTaskData *data = userdata;
SculptSession *ss = data->ob->sculpt;
- Brush *brush = data->brush;
+ const Brush *brush = data->brush;
PBVHVertexIter vd;
SculptBrushTest test;
@@ -2116,7 +2116,7 @@ static void do_grab_brush_task_cb_ex(
{
SculptThreadedTaskData *data = userdata;
SculptSession *ss = data->ob->sculpt;
- Brush *brush = data->brush;
+ const Brush *brush = data->brush;
const float *grab_delta = data->grab_delta;
PBVHVertexIter vd;
@@ -2176,7 +2176,7 @@ static void do_nudge_brush_task_cb_ex(
{
SculptThreadedTaskData *data = userdata;
SculptSession *ss = data->ob->sculpt;
- Brush *brush = data->brush;
+ const Brush *brush = data->brush;
const float *cono = data->cono;
PBVHVertexIter vd;
@@ -2230,7 +2230,7 @@ static void do_snake_hook_brush_task_cb_ex(
{
SculptThreadedTaskData *data = userdata;
SculptSession *ss = data->ob->sculpt;
- Brush *brush = data->brush;
+ const Brush *brush = data->brush;
SculptProjectVector *spvc = data->spvc;
const float *grab_delta = data->grab_delta;
@@ -2331,7 +2331,7 @@ static void do_thumb_brush_task_cb_ex(
{
SculptThreadedTaskData *data = userdata;
SculptSession *ss = data->ob->sculpt;
- Brush *brush = data->brush;
+ const Brush *brush = data->brush;
const float *cono = data->cono;
PBVHVertexIter vd;
@@ -2391,7 +2391,7 @@ static void do_rotate_brush_task_cb_ex(
{
SculptThreadedTaskData *data = userdata;
SculptSession *ss = data->ob->sculpt;
- Brush *brush = data->brush;
+ const Brush *brush = data->brush;
const float angle = data->angle;
PBVHVertexIter vd;
@@ -2453,7 +2453,7 @@ static void do_layer_brush_task_cb_ex(
SculptThreadedTaskData *data = userdata;
SculptSession *ss = data->ob->sculpt;
Sculpt *sd = data->sd;
- Brush *brush = data->brush;
+ const Brush *brush = data->brush;
const float *offset = data->offset;
PBVHVertexIter vd;
@@ -2537,7 +2537,7 @@ static void do_inflate_brush_task_cb_ex(
{
SculptThreadedTaskData *data = userdata;
SculptSession *ss = data->ob->sculpt;
- Brush *brush = data->brush;
+ const Brush *brush = data->brush;
PBVHVertexIter vd;
SculptBrushTest test;
@@ -2695,7 +2695,7 @@ static void do_flatten_brush_task_cb_ex(
{
SculptThreadedTaskData *data = userdata;
SculptSession *ss = data->ob->sculpt;
- Brush *brush = data->brush;
+ const Brush *brush = data->brush;
const float *area_no = data->area_no;
const float *area_co = data->area_co;
@@ -2771,7 +2771,7 @@ static void do_clay_brush_task_cb_ex(
{
SculptThreadedTaskData *data = userdata;
SculptSession *ss = data->ob->sculpt;
- Brush *brush = data->brush;
+ const Brush *brush = data->brush;
const float *area_no = data->area_no;
const float *area_co = data->area_co;
@@ -2855,7 +2855,7 @@ static void do_clay_strips_brush_task_cb_ex(
{
SculptThreadedTaskData *data = userdata;
SculptSession *ss = data->ob->sculpt;
- Brush *brush = data->brush;
+ const Brush *brush = data->brush;
float (*mat)[4] = data->mat;
const float *area_no_sp = data->area_no_sp;
const float *area_co = data->area_co;
@@ -2965,7 +2965,7 @@ static void do_fill_brush_task_cb_ex(
{
SculptThreadedTaskData *data = userdata;
SculptSession *ss = data->ob->sculpt;
- Brush *brush = data->brush;
+ const Brush *brush = data->brush;
const float *area_no = data->area_no;
const float *area_co = data->area_co;
@@ -3044,7 +3044,7 @@ static void do_scrape_brush_task_cb_ex(
{
SculptThreadedTaskData *data = userdata;
SculptSession *ss = data->ob->sculpt;
- Brush *brush = data->brush;
+ const Brush *brush = data->brush;
const float *area_no = data->area_no;
const float *area_co = data->area_co;
@@ -3123,7 +3123,7 @@ static void do_gravity_task_cb_ex(
{
SculptThreadedTaskData *data = userdata;
SculptSession *ss = data->ob->sculpt;
- Brush *brush = data->brush;
+ const Brush *brush = data->brush;
float *offset = data->offset;
PBVHVertexIter vd;
@@ -3602,6 +3602,7 @@ void sculpt_cache_calc_brushdata_symm(
const char axis, const float angle)
{
flip_v3_v3(cache->location, cache->true_location, symm);
+ flip_v3_v3(cache->last_location, cache->true_last_location, symm);
flip_v3_v3(cache->grab_delta_symmetry, cache->grab_delta, symm);
flip_v3_v3(cache->view_normal, cache->true_view_normal, symm);
@@ -4667,6 +4668,7 @@ static void sculpt_stroke_done(const bContext *C, struct PaintStroke *UNUSED(str
if (ss->cache) {
UnifiedPaintSettings *ups = &CTX_data_tool_settings(C)->unified_paint_settings;
Brush *brush = BKE_paint_brush(&sd->paint);
+ BLI_assert(brush == ss->cache->brush); /* const, so we shouldn't change. */
ups->draw_inverted = false;
sculpt_stroke_modifiers_check(C, ob);
@@ -4677,11 +4679,10 @@ static void sculpt_stroke_done(const bContext *C, struct PaintStroke *UNUSED(str
brush->mask_tool = ss->cache->saved_mask_brush_tool;
}
else {
- Paint *p = &sd->paint;
- BKE_brush_size_set(scene, ss->cache->brush, ss->cache->saved_smooth_size);
+ BKE_brush_size_set(scene, brush, ss->cache->saved_smooth_size);
brush = (Brush *)BKE_libblock_find_name(ID_BR, ss->cache->saved_active_brush_name);
if (brush) {
- BKE_paint_brush_set(p, brush);
+ BKE_paint_brush_set(&sd->paint, brush);
}
}
}
diff --git a/source/blender/editors/sculpt_paint/sculpt_intern.h b/source/blender/editors/sculpt_paint/sculpt_intern.h
index 425cecb0010..b9b662f4157 100644
--- a/source/blender/editors/sculpt_paint/sculpt_intern.h
+++ b/source/blender/editors/sculpt_paint/sculpt_intern.h
@@ -132,7 +132,7 @@ typedef struct SculptThreadedTaskData {
struct bContext *C;
struct Sculpt *sd;
struct Object *ob;
- struct Brush *brush;
+ const struct Brush *brush;
struct PBVHNode **nodes;
int totnode;
@@ -214,7 +214,7 @@ bool sculpt_brush_test_circle_sq(SculptBrushTest *test, const float co[3]);
bool sculpt_search_sphere_cb(PBVHNode *node, void *data_v);
bool sculpt_search_circle_cb(PBVHNode *node, void *data_v);
float tex_strength(
- struct SculptSession *ss, struct Brush *br,
+ struct SculptSession *ss, const struct Brush *br,
const float point[3],
const float len,
const short vno[3],
@@ -268,7 +268,7 @@ typedef struct StrokeCache {
/* Clean this up! */
struct ViewContext *vc;
- struct Brush *brush;
+ const struct Brush *brush;
float special_rotation;
float grab_delta[3], grab_delta_symmetry[3];
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c
index 4e9e493c318..1f4848636be 100644
--- a/source/blender/editors/space_image/image_ops.c
+++ b/source/blender/editors/space_image/image_ops.c
@@ -2388,8 +2388,8 @@ static int image_new_exec(bContext *C, wmOperator *op)
Main *bmain;
PointerRNA ptr, idptr;
PropertyRNA *prop;
- char _name[MAX_ID_NAME - 2];
- char *name = _name;
+ char name_buffer[MAX_ID_NAME - 2];
+ const char *name;
float color[4];
int width, height, floatbuf, gen_type, alpha;
int gen_context;
@@ -2402,10 +2402,13 @@ static int image_new_exec(bContext *C, wmOperator *op)
bmain = CTX_data_main(C);
prop = RNA_struct_find_property(op->ptr, "name");
- RNA_property_string_get(op->ptr, prop, name);
+ RNA_property_string_get(op->ptr, prop, name_buffer);
if (!RNA_property_is_set(op->ptr, prop)) {
/* Default value, we can translate! */
- name = (char *)DATA_(name);
+ name = DATA_(name_buffer);
+ }
+ else {
+ name = name_buffer;
}
width = RNA_int_get(op->ptr, "width");
height = RNA_int_get(op->ptr, "height");
diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c
index 0d41b641c2b..f3a5af4b164 100644
--- a/source/blender/editors/space_outliner/outliner_tree.c
+++ b/source/blender/editors/space_outliner/outliner_tree.c
@@ -1300,7 +1300,7 @@ static void outliner_add_library_contents(Main *mainvar, SpaceOops *soops, TreeE
ten = outliner_add_element(soops, &te->subtree, lbarray[a], NULL, TSE_ID_BASE, 0);
ten->directdata = lbarray[a];
- ten->name = (char *)BKE_idcode_to_name_plural(GS(id->name));
+ ten->name = BKE_idcode_to_name_plural(GS(id->name));
if (ten->name == NULL)
ten->name = "UNKNOWN";
@@ -1340,7 +1340,7 @@ static void outliner_add_orphaned_datablocks(Main *mainvar, SpaceOops *soops)
ten = outliner_add_element(soops, &soops->tree, lbarray[a], NULL, TSE_ID_BASE, 0);
ten->directdata = lbarray[a];
- ten->name = (char *)BKE_idcode_to_name_plural(GS(id->name));
+ ten->name = BKE_idcode_to_name_plural(GS(id->name));
if (ten->name == NULL)
ten->name = "UNKNOWN";
diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h
index 4c1accdcdf1..85f2f6a9816 100644
--- a/source/blender/makesdna/DNA_scene_types.h
+++ b/source/blender/makesdna/DNA_scene_types.h
@@ -1132,7 +1132,6 @@ enum {
/* TODO */
// VP_FLAG_PROJECT_XRAY = (1 << 1),
VP_FLAG_PROJECT_FLAT = (1 << 3),
- VP_FLAG_SPRAY = (1 << 4),
/* weight paint only */
VP_FLAG_VGROUP_RESTRICT = (1 << 7)
};
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index 359f0ba198b..0dc5ab5d6bf 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -1999,8 +1999,8 @@ static void rna_def_modifier_boolean(BlenderRNA *brna)
/* BMesh intersection options */
static EnumPropertyItem debug_items[] = {
{eBooleanModifierBMeshFlag_BMesh_Separate, "SEPARATE", 0, "Separate", ""},
- {eBooleanModifierBMeshFlag_BMesh_NoDissolve, "NO_DISSOLVE", 0, "NoDissolve", ""},
- {eBooleanModifierBMeshFlag_BMesh_NoConnectRegions, "NO_CONNECT_REGIONS", 0, "NoConnectRegions", ""},
+ {eBooleanModifierBMeshFlag_BMesh_NoDissolve, "NO_DISSOLVE", 0, "No Dissolve", ""},
+ {eBooleanModifierBMeshFlag_BMesh_NoConnectRegions, "NO_CONNECT_REGIONS", 0, "No Connect Regions", ""},
{0, NULL, 0, NULL, NULL}
};
diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c
index adf647d2dd6..f2c4e19a6e4 100644
--- a/source/blender/makesrna/intern/rna_sculpt_paint.c
+++ b/source/blender/makesrna/intern/rna_sculpt_paint.c
@@ -711,12 +711,6 @@ static void rna_def_vertex_paint(BlenderRNA *brna)
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", VP_FLAG_PROJECT_FLAT);
RNA_def_property_ui_text(prop, "Normals", "Paint most on faces pointing towards the view");
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
-
-
- prop = RNA_def_property(srna, "use_spray", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", VP_FLAG_SPRAY);
- RNA_def_property_ui_text(prop, "Spray", "Keep applying paint effect while holding mouse");
- RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
/* weight paint only */
prop = RNA_def_property(srna, "use_group_restrict", PROP_BOOLEAN, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index 5736df4cb9c..bf583654fc6 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -2896,7 +2896,7 @@ static void rna_def_space_view3d(BlenderRNA *brna)
prop = RNA_def_property(srna, "clip_planes", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "clip");
RNA_def_property_multi_array(prop, 2, (int[]){6, 4});
- RNA_def_property_ui_text(prop, "Clipe Planes", "");
+ RNA_def_property_ui_text(prop, "Clip Planes", "");
prop = RNA_def_property(srna, "view_location", PROP_FLOAT, PROP_TRANSLATION);
#if 0
diff --git a/source/blender/python/generic/bpy_internal_import.c b/source/blender/python/generic/bpy_internal_import.c
index 7ab6447d21a..ffac09efdde 100644
--- a/source/blender/python/generic/bpy_internal_import.c
+++ b/source/blender/python/generic/bpy_internal_import.c
@@ -253,7 +253,7 @@ PyObject *bpy_text_reimport(PyObject *module, int *found)
if (module_file == NULL) {
return NULL;
}
- filepath = (char *)_PyUnicode_AsString(module_file);
+ filepath = _PyUnicode_AsString(module_file);
Py_DECREF(module_file);
if (filepath == NULL) {
return NULL;
@@ -285,13 +285,13 @@ static PyObject *blender_import(PyObject *UNUSED(self), PyObject *args, PyObject
int found = 0;
PyObject *globals = NULL, *locals = NULL, *fromlist = NULL;
int level = 0; /* relative imports */
-
PyObject *newmodule;
- //PyObject_Print(args, stderr, 0);
- static const char *kwlist[] = {"name", "globals", "locals", "fromlist", "level", NULL};
-
- if (!PyArg_ParseTupleAndKeywords(args, kw, "s|OOOi:bpy_import_meth", (char **)kwlist,
- &name, &globals, &locals, &fromlist, &level))
+
+ static const char *_keywords[] = {"name", "globals", "locals", "fromlist", "level", NULL};
+ static _PyArg_Parser _parser = {"s|OOOi:bpy_import_meth", _keywords, 0};
+ if (!_PyArg_ParseTupleAndKeywordsFast(
+ args, kw, &_parser,
+ &name, &globals, &locals, &fromlist, &level))
{
return NULL;
}
diff --git a/source/blender/python/intern/bpy_props.c b/source/blender/python/intern/bpy_props.c
index 9ef8f9aa046..a46fda7ea63 100644
--- a/source/blender/python/intern/bpy_props.c
+++ b/source/blender/python/intern/bpy_props.c
@@ -1995,8 +1995,6 @@ static PyObject *BPy_BoolProperty(PyObject *self, PyObject *args, PyObject *kw)
BPY_PROPDEF_HEAD(BoolProperty);
if (srna) {
- static const char *kwlist[] = {"attr", "name", "description", "default",
- "options", "subtype", "update", "get", "set", NULL};
const char *id = NULL, *name = NULL, *description = "";
int id_len;
bool def = false;
@@ -2009,12 +2007,17 @@ static PyObject *BPy_BoolProperty(PyObject *self, PyObject *args, PyObject *kw)
PyObject *get_cb = NULL;
PyObject *set_cb = NULL;
- if (!PyArg_ParseTupleAndKeywords(args, kw,
- "s#|ssO&O!sOOO:BoolProperty",
- (char **)kwlist, &id, &id_len,
- &name, &description, PyC_ParseBool, &def,
- &PySet_Type, &pyopts, &pysubtype,
- &update_cb, &get_cb, &set_cb))
+ static const char *_keywords[] = {
+ "attr", "name", "description", "default",
+ "options", "subtype", "update", "get", "set", NULL,
+ };
+ static _PyArg_Parser _parser = {"s#|ssO&O!sOOO:BoolProperty", _keywords, 0};
+ if (!_PyArg_ParseTupleAndKeywordsFast(
+ args, kw, &_parser,
+ &id, &id_len,
+ &name, &description, PyC_ParseBool, &def,
+ &PySet_Type, &pyopts, &pysubtype,
+ &update_cb, &get_cb, &set_cb))
{
return NULL;
}
@@ -2077,8 +2080,6 @@ static PyObject *BPy_BoolVectorProperty(PyObject *self, PyObject *args, PyObject
BPY_PROPDEF_HEAD(BoolVectorProperty);
if (srna) {
- static const char *kwlist[] = {"attr", "name", "description", "default",
- "options", "subtype", "size", "update", "get", "set", NULL};
const char *id = NULL, *name = NULL, *description = "";
int id_len;
int def[PYRNA_STACK_ARRAY] = {0};
@@ -2093,12 +2094,17 @@ static PyObject *BPy_BoolVectorProperty(PyObject *self, PyObject *args, PyObject
PyObject *get_cb = NULL;
PyObject *set_cb = NULL;
- if (!PyArg_ParseTupleAndKeywords(args, kw,
- "s#|ssOO!siOOO:BoolVectorProperty",
- (char **)kwlist, &id, &id_len,
- &name, &description, &pydef,
- &PySet_Type, &pyopts, &pysubtype, &size,
- &update_cb, &get_cb, &set_cb))
+ static const char *_keywords[] = {
+ "attr", "name", "description", "default",
+ "options", "subtype", "size", "update", "get", "set", NULL,
+ };
+ static _PyArg_Parser _parser = {"s#|ssOO!siOOO:BoolVectorProperty", _keywords, 0};
+ if (!_PyArg_ParseTupleAndKeywordsFast(
+ args, kw, &_parser,
+ &id, &id_len,
+ &name, &description, &pydef,
+ &PySet_Type, &pyopts, &pysubtype, &size,
+ &update_cb, &get_cb, &set_cb))
{
return NULL;
}
@@ -2181,9 +2187,6 @@ static PyObject *BPy_IntProperty(PyObject *self, PyObject *args, PyObject *kw)
BPY_PROPDEF_HEAD(IntProperty);
if (srna) {
- static const char *kwlist[] = {"attr", "name", "description", "default",
- "min", "max", "soft_min", "soft_max",
- "step", "options", "subtype", "update", "get", "set", NULL};
const char *id = NULL, *name = NULL, *description = "";
int id_len;
int min = INT_MIN, max = INT_MAX, soft_min = INT_MIN, soft_max = INT_MAX, step = 1, def = 0;
@@ -2196,13 +2199,19 @@ static PyObject *BPy_IntProperty(PyObject *self, PyObject *args, PyObject *kw)
PyObject *get_cb = NULL;
PyObject *set_cb = NULL;
- if (!PyArg_ParseTupleAndKeywords(args, kw,
- "s#|ssiiiiiiO!sOOO:IntProperty",
- (char **)kwlist, &id, &id_len,
- &name, &description, &def,
- &min, &max, &soft_min, &soft_max,
- &step, &PySet_Type, &pyopts, &pysubtype,
- &update_cb, &get_cb, &set_cb))
+ static const char *_keywords[] = {
+ "attr", "name", "description", "default",
+ "min", "max", "soft_min", "soft_max",
+ "step", "options", "subtype", "update", "get", "set", NULL,
+ };
+ static _PyArg_Parser _parser = {"s#|ssiiiiiiO!sOOO:IntProperty", _keywords, 0};
+ if (!_PyArg_ParseTupleAndKeywordsFast(
+ args, kw, &_parser,
+ &id, &id_len,
+ &name, &description, &def,
+ &min, &max, &soft_min, &soft_max,
+ &step, &PySet_Type, &pyopts, &pysubtype,
+ &update_cb, &get_cb, &set_cb))
{
return NULL;
}
@@ -2278,9 +2287,6 @@ static PyObject *BPy_IntVectorProperty(PyObject *self, PyObject *args, PyObject
BPY_PROPDEF_HEAD(IntVectorProperty);
if (srna) {
- static const char *kwlist[] = {"attr", "name", "description", "default",
- "min", "max", "soft_min", "soft_max",
- "step", "options", "subtype", "size", "update", "get", "set", NULL};
const char *id = NULL, *name = NULL, *description = "";
int id_len;
int min = INT_MIN, max = INT_MAX, soft_min = INT_MIN, soft_max = INT_MAX, step = 1;
@@ -2296,14 +2302,20 @@ static PyObject *BPy_IntVectorProperty(PyObject *self, PyObject *args, PyObject
PyObject *get_cb = NULL;
PyObject *set_cb = NULL;
- if (!PyArg_ParseTupleAndKeywords(args, kw,
- "s#|ssOiiiiiO!siOOO:IntVectorProperty",
- (char **)kwlist, &id, &id_len,
- &name, &description, &pydef,
- &min, &max, &soft_min, &soft_max,
- &step, &PySet_Type, &pyopts,
- &pysubtype, &size,
- &update_cb, &get_cb, &set_cb))
+ static const char *_keywords[] = {
+ "attr", "name", "description", "default",
+ "min", "max", "soft_min", "soft_max",
+ "step", "options", "subtype", "size", "update", "get", "set", NULL,
+ };
+ static _PyArg_Parser _parser = {"s#|ssOiiiiiO!siOOO:IntVectorProperty", _keywords, 0};
+ if (!_PyArg_ParseTupleAndKeywordsFast(
+ args, kw, &_parser,
+ &id, &id_len,
+ &name, &description, &pydef,
+ &min, &max, &soft_min, &soft_max,
+ &step, &PySet_Type, &pyopts,
+ &pysubtype, &size,
+ &update_cb, &get_cb, &set_cb))
{
return NULL;
}
@@ -2391,10 +2403,6 @@ static PyObject *BPy_FloatProperty(PyObject *self, PyObject *args, PyObject *kw)
BPY_PROPDEF_HEAD(FloatProperty);
if (srna) {
- static const char *kwlist[] = {"attr", "name", "description", "default",
- "min", "max", "soft_min", "soft_max",
- "step", "precision", "options", "subtype",
- "unit", "update", "get", "set", NULL};
const char *id = NULL, *name = NULL, *description = "";
int id_len;
float min = -FLT_MAX, max = FLT_MAX, soft_min = -FLT_MAX, soft_max = FLT_MAX, step = 3, def = 0.0f;
@@ -2410,14 +2418,21 @@ static PyObject *BPy_FloatProperty(PyObject *self, PyObject *args, PyObject *kw)
PyObject *get_cb = NULL;
PyObject *set_cb = NULL;
- if (!PyArg_ParseTupleAndKeywords(args, kw,
- "s#|ssffffffiO!ssOOO:FloatProperty",
- (char **)kwlist, &id, &id_len,
- &name, &description, &def,
- &min, &max, &soft_min, &soft_max,
- &step, &precision, &PySet_Type,
- &pyopts, &pysubtype, &pyunit,
- &update_cb, &get_cb, &set_cb))
+ static const char *_keywords[] = {
+ "attr", "name", "description", "default",
+ "min", "max", "soft_min", "soft_max",
+ "step", "precision", "options", "subtype",
+ "unit", "update", "get", "set", NULL,
+ };
+ static _PyArg_Parser _parser = {"s#|ssffffffiO!ssOOO:FloatProperty", _keywords, 0};
+ if (!_PyArg_ParseTupleAndKeywordsFast(
+ args, kw, &_parser,
+ &id, &id_len,
+ &name, &description, &def,
+ &min, &max, &soft_min, &soft_max,
+ &step, &precision, &PySet_Type,
+ &pyopts, &pysubtype, &pyunit,
+ &update_cb, &get_cb, &set_cb))
{
return NULL;
}
@@ -2502,10 +2517,6 @@ static PyObject *BPy_FloatVectorProperty(PyObject *self, PyObject *args, PyObjec
BPY_PROPDEF_HEAD(FloatVectorProperty);
if (srna) {
- static const char *kwlist[] = {"attr", "name", "description", "default",
- "min", "max", "soft_min", "soft_max",
- "step", "precision", "options", "subtype",
- "unit", "size", "update", "get", "set", NULL};
const char *id = NULL, *name = NULL, *description = "";
int id_len;
float min = -FLT_MAX, max = FLT_MAX, soft_min = -FLT_MAX, soft_max = FLT_MAX, step = 3;
@@ -2523,14 +2534,21 @@ static PyObject *BPy_FloatVectorProperty(PyObject *self, PyObject *args, PyObjec
PyObject *get_cb = NULL;
PyObject *set_cb = NULL;
- if (!PyArg_ParseTupleAndKeywords(args, kw,
- "s#|ssOfffffiO!ssiOOO:FloatVectorProperty",
- (char **)kwlist, &id, &id_len,
- &name, &description, &pydef,
- &min, &max, &soft_min, &soft_max,
- &step, &precision, &PySet_Type,
- &pyopts, &pysubtype, &pyunit, &size,
- &update_cb, &get_cb, &set_cb))
+ static const char *_keywords[] = {
+ "attr", "name", "description", "default",
+ "min", "max", "soft_min", "soft_max",
+ "step", "precision", "options", "subtype",
+ "unit", "size", "update", "get", "set", NULL,
+ };
+ static _PyArg_Parser _parser = {"s#|ssOfffffiO!ssiOOO:FloatVectorProperty", _keywords, 0};
+ if (!_PyArg_ParseTupleAndKeywordsFast(
+ args, kw, &_parser,
+ &id, &id_len,
+ &name, &description, &pydef,
+ &min, &max, &soft_min, &soft_max,
+ &step, &precision, &PySet_Type,
+ &pyopts, &pysubtype, &pyunit, &size,
+ &update_cb, &get_cb, &set_cb))
{
return NULL;
}
@@ -2611,8 +2629,6 @@ static PyObject *BPy_StringProperty(PyObject *self, PyObject *args, PyObject *kw
BPY_PROPDEF_HEAD(StringProperty);
if (srna) {
- static const char *kwlist[] = {"attr", "name", "description", "default",
- "maxlen", "options", "subtype", "update", "get", "set", NULL};
const char *id = NULL, *name = NULL, *description = "", *def = "";
int id_len;
int maxlen = 0;
@@ -2625,12 +2641,17 @@ static PyObject *BPy_StringProperty(PyObject *self, PyObject *args, PyObject *kw
PyObject *get_cb = NULL;
PyObject *set_cb = NULL;
- if (!PyArg_ParseTupleAndKeywords(args, kw,
- "s#|sssiO!sOOO:StringProperty",
- (char **)kwlist, &id, &id_len,
- &name, &description, &def,
- &maxlen, &PySet_Type, &pyopts, &pysubtype,
- &update_cb, &get_cb, &set_cb))
+ static const char *_keywords[] = {
+ "attr", "name", "description", "default",
+ "maxlen", "options", "subtype", "update", "get", "set", NULL,
+ };
+ static _PyArg_Parser _parser = {"s#|sssiO!sOOO:StringProperty", _keywords, 0};
+ if (!_PyArg_ParseTupleAndKeywordsFast(
+ args, kw, &_parser,
+ &id, &id_len,
+ &name, &description, &def,
+ &maxlen, &PySet_Type, &pyopts, &pysubtype,
+ &update_cb, &get_cb, &set_cb))
{
return NULL;
}
@@ -2720,8 +2741,6 @@ static PyObject *BPy_EnumProperty(PyObject *self, PyObject *args, PyObject *kw)
BPY_PROPDEF_HEAD(EnumProperty);
if (srna) {
- static const char *kwlist[] = {"attr", "items", "name", "description", "default",
- "options", "update", "get", "set", NULL};
const char *id = NULL, *name = NULL, *description = "";
PyObject *def = NULL;
int id_len;
@@ -2736,12 +2755,17 @@ static PyObject *BPy_EnumProperty(PyObject *self, PyObject *args, PyObject *kw)
PyObject *get_cb = NULL;
PyObject *set_cb = NULL;
- if (!PyArg_ParseTupleAndKeywords(args, kw,
- "s#O|ssOO!OOO:EnumProperty",
- (char **)kwlist, &id, &id_len,
- &items, &name, &description,
- &def, &PySet_Type, &pyopts,
- &update_cb, &get_cb, &set_cb))
+ static const char *_keywords[] = {
+ "attr", "items", "name", "description", "default",
+ "options", "update", "get", "set", NULL,
+ };
+ static _PyArg_Parser _parser = {"s#O|ssOO!OOO:EnumProperty", _keywords, 0};
+ if (!_PyArg_ParseTupleAndKeywordsFast(
+ args, kw, &_parser,
+ &id, &id_len,
+ &items, &name, &description,
+ &def, &PySet_Type, &pyopts,
+ &update_cb, &get_cb, &set_cb))
{
return NULL;
}
@@ -2869,7 +2893,6 @@ PyObject *BPy_PointerProperty(PyObject *self, PyObject *args, PyObject *kw)
BPY_PROPDEF_HEAD(PointerProperty);
if (srna) {
- static const char *kwlist[] = {"attr", "type", "name", "description", "options", "poll", "update", NULL};
const char *id = NULL, *name = NULL, *description = "";
int id_len;
PropertyRNA *prop;
@@ -2879,12 +2902,16 @@ PyObject *BPy_PointerProperty(PyObject *self, PyObject *args, PyObject *kw)
int opts = 0;
PyObject *update_cb = NULL, *poll_cb = NULL;
- if (!PyArg_ParseTupleAndKeywords(args, kw,
- "s#O|ssO!OO:PointerProperty",
- (char **)kwlist, &id, &id_len,
- &type, &name, &description,
- &PySet_Type, &pyopts,
- &poll_cb, &update_cb))
+ static const char *_keywords[] = {
+ "attr", "type", "name", "description", "options", "poll", "update", NULL,
+ };
+ static _PyArg_Parser _parser = {"s#O|ssO!OO:PointerProperty", _keywords, 0};
+ if (!_PyArg_ParseTupleAndKeywordsFast(
+ args, kw, &_parser,
+ &id, &id_len,
+ &type, &name, &description,
+ &PySet_Type, &pyopts,
+ &poll_cb, &update_cb))
{
return NULL;
}
@@ -2943,20 +2970,23 @@ PyObject *BPy_CollectionProperty(PyObject *self, PyObject *args, PyObject *kw)
BPY_PROPDEF_HEAD(CollectionProperty);
if (srna) {
- static const char *kwlist[] = {"attr", "type", "name", "description", "options", NULL};
- const char *id = NULL, *name = NULL, *description = "";
int id_len;
+ const char *id = NULL, *name = NULL, *description = "";
PropertyRNA *prop;
StructRNA *ptype;
PyObject *type = Py_None;
PyObject *pyopts = NULL;
int opts = 0;
- if (!PyArg_ParseTupleAndKeywords(args, kw,
- "s#O|ssO!:CollectionProperty",
- (char **)kwlist, &id, &id_len,
- &type, &name, &description,
- &PySet_Type, &pyopts))
+ static const char *_keywords[] = {
+ "attr", "type", "name", "description", "options", NULL,
+ };
+ static _PyArg_Parser _parser = {"s#O|ssO!:CollectionProperty", _keywords, 0};
+ if (!_PyArg_ParseTupleAndKeywordsFast(
+ args, kw, &_parser,
+ &id, &id_len,
+ &type, &name, &description,
+ &PySet_Type, &pyopts))
{
return NULL;
}
@@ -3028,13 +3058,15 @@ static PyObject *BPy_RemoveProperty(PyObject *self, PyObject *args, PyObject *kw
return NULL;
}
else {
- static const char *kwlist[] = {"attr", NULL};
-
const char *id = NULL;
- if (!PyArg_ParseTupleAndKeywords(args, kw,
- "s:RemoveProperty",
- (char **)kwlist, &id))
+ static const char *_keywords[] = {
+ "attr", NULL,
+ };
+ static _PyArg_Parser _parser = {"s:RemoveProperty", _keywords, 0};
+ if (!_PyArg_ParseTupleAndKeywordsFast(
+ args, kw, &_parser,
+ &id))
{
return NULL;
}
diff --git a/source/blender/python/intern/bpy_util.h b/source/blender/python/intern/bpy_util.h
index 63cb7920bd1..6000bf94aef 100644
--- a/source/blender/python/intern/bpy_util.h
+++ b/source/blender/python/intern/bpy_util.h
@@ -27,8 +27,8 @@
#ifndef __BPY_UTIL_H__
#define __BPY_UTIL_H__
-#if PY_VERSION_HEX < 0x03050000
-# error "Python 3.5 or greater is required, you'll need to update your python."
+#if PY_VERSION_HEX < 0x03060000
+# error "Python 3.6 or greater is required, you'll need to update your python."
#endif
struct EnumPropertyItem;
diff --git a/source/blender/render/extern/include/RE_render_ext.h b/source/blender/render/extern/include/RE_render_ext.h
index f296c117495..82bb265e20c 100644
--- a/source/blender/render/extern/include/RE_render_ext.h
+++ b/source/blender/render/extern/include/RE_render_ext.h
@@ -47,7 +47,7 @@ struct Render;
/* render_texture.c */
/* used by particle.c, effect.c, editmesh_modes.c and brush.c, returns 1 if rgb, 0 otherwise */
int externtex(
- struct MTex *mtex, const float vec[3], float *tin, float *tr, float *tg, float *tb, float *ta,
+ const struct MTex *mtex, const float vec[3], float *tin, float *tr, float *tg, float *tb, float *ta,
const int thread, struct ImagePool *pool, const bool skip_load_image, const bool texnode_preview);
void texture_rgb_blend(float in[3], const float tex[3], const float out[3], float fact, float facg, int blendtype);
float texture_value_blend(float tex, float out, float fact, float facg, int blendtype);
diff --git a/source/blender/render/intern/source/render_texture.c b/source/blender/render/intern/source/render_texture.c
index 22dc2b28900..91d1f63a1be 100644
--- a/source/blender/render/intern/source/render_texture.c
+++ b/source/blender/render/intern/source/render_texture.c
@@ -781,7 +781,8 @@ static int cubemap_glob(const float n[3], float x, float y, float z, float *adr1
/* ------------------------------------------------------------------------- */
/* mtex argument only for projection switches */
-static int cubemap(MTex *mtex, VlakRen *vlr, const float n[3], float x, float y, float z, float *adr1, float *adr2)
+static int cubemap(
+ const MTex *mtex, VlakRen *vlr, const float n[3], float x, float y, float z, float *adr1, float *adr2)
{
int proj[4]={0, ME_PROJXY, ME_PROJXZ, ME_PROJYZ}, ret= 0;
@@ -873,7 +874,8 @@ static int cubemap_ob(Object *ob, const float n[3], float x, float y, float z, f
/* ------------------------------------------------------------------------- */
-static void do_2d_mapping(MTex *mtex, float texvec[3], VlakRen *vlr, const float n[3], float dxt[3], float dyt[3])
+static void do_2d_mapping(
+ const MTex *mtex, float texvec[3], VlakRen *vlr, const float n[3], float dxt[3], float dyt[3])
{
Tex *tex;
Object *ob= NULL;
@@ -3594,7 +3596,7 @@ void do_lamp_tex(LampRen *la, const float lavec[3], ShadeInput *shi, float col_r
/* ------------------------------------------------------------------------- */
-int externtex(MTex *mtex,
+int externtex(const MTex *mtex,
const float vec[3],
float *tin, float *tr, float *tg, float *tb, float *ta,
const int thread,
diff --git a/source/blenderplayer/bad_level_call_stubs/stubs.c b/source/blenderplayer/bad_level_call_stubs/stubs.c
index 78b188b603a..560dc0963ce 100644
--- a/source/blenderplayer/bad_level_call_stubs/stubs.c
+++ b/source/blenderplayer/bad_level_call_stubs/stubs.c
@@ -307,7 +307,7 @@ void RE_Database_Free(struct Render *re) RET_NONE
void RE_FreeRender(struct Render *re) RET_NONE
void RE_DataBase_GetView(struct Render *re, float mat[4][4]) RET_NONE
int externtex(
- struct MTex *mtex, const float vec[3], float *tin, float *tr, float *tg, float *tb, float *ta,
+ const struct MTex *mtex, const float vec[3], float *tin, float *tr, float *tg, float *tb, float *ta,
const int thread, struct ImagePool *pool, const bool skip_load_image, const bool texnode_preview) RET_ZERO
float texture_value_blend(float tex, float out, float fact, float facg, int blendtype) RET_ZERO
void texture_rgb_blend(float in[3], const float tex[3], const float out[3], float fact, float facg, int blendtype) RET_NONE