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/platform/platform_apple.cmake5
-rw-r--r--doc/doxygen/Doxyfile2
-rw-r--r--intern/cycles/blender/addon/ui.py2
-rw-r--r--intern/cycles/blender/blender_geometry.cpp85
-rw-r--r--intern/cycles/blender/blender_object.cpp46
-rw-r--r--intern/cycles/blender/blender_sync.h11
-rw-r--r--release/datafiles/splash.pngbin760281 -> 737984 bytes
-rw-r--r--release/scripts/modules/bl_keymap_utils/io.py23
-rw-r--r--release/scripts/modules/bl_keymap_utils/versioning.py49
-rw-r--r--release/scripts/presets/keyconfig/keymap_data/blender_default.py690
-rw-r--r--release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py358
-rw-r--r--release/scripts/startup/bl_operators/__init__.py1
-rw-r--r--release/scripts/startup/bl_operators/anim.py2
-rw-r--r--release/scripts/startup/bl_operators/clip.py2
-rw-r--r--release/scripts/startup/bl_operators/console.py2
-rw-r--r--release/scripts/startup/bl_operators/gpencil_mesh_bake.py157
-rw-r--r--release/scripts/startup/bl_operators/sequencer.py4
-rw-r--r--release/scripts/startup/bl_operators/userpref.py4
-rw-r--r--release/scripts/startup/bl_operators/wm.py4
-rw-r--r--release/scripts/startup/bl_ui/properties_data_empty.py2
-rw-r--r--release/scripts/startup/bl_ui/properties_data_gpencil.py4
-rw-r--r--release/scripts/startup/bl_ui/properties_data_mesh.py2
-rw-r--r--release/scripts/startup/bl_ui/properties_freestyle.py2
-rw-r--r--release/scripts/startup/bl_ui/properties_grease_pencil_common.py2
-rw-r--r--release/scripts/startup/bl_ui/properties_mask_common.py2
-rw-r--r--release/scripts/startup/bl_ui/properties_material_gpencil.py2
-rw-r--r--release/scripts/startup/bl_ui/properties_object.py2
-rw-r--r--release/scripts/startup/bl_ui/properties_paint_common.py3
-rw-r--r--release/scripts/startup/bl_ui/properties_physics_common.py4
-rw-r--r--release/scripts/startup/bl_ui/properties_physics_field.py4
-rw-r--r--release/scripts/startup/bl_ui/properties_physics_fluid.py2
-rw-r--r--release/scripts/startup/bl_ui/space_clip.py8
-rw-r--r--release/scripts/startup/bl_ui/space_dopesheet.py2
-rw-r--r--release/scripts/startup/bl_ui/space_sequencer.py6
-rw-r--r--release/scripts/startup/bl_ui/space_text.py2
-rw-r--r--release/scripts/startup/bl_ui/space_toolsystem_toolbar.py12
-rw-r--r--release/scripts/startup/bl_ui/space_userpref.py12
-rw-r--r--release/scripts/startup/bl_ui/space_view3d.py30
-rw-r--r--release/scripts/startup/bl_ui/space_view3d_toolbar.py2
-rw-r--r--source/blender/blenfont/BLF_api.h20
-rw-r--r--source/blender/blenfont/CMakeLists.txt1
-rw-r--r--source/blender/blenfont/intern/blf.c71
-rw-r--r--source/blender/blenfont/intern/blf_default.c90
-rw-r--r--source/blender/blenfont/intern/blf_internal.h2
-rw-r--r--source/blender/blenkernel/BKE_armature.h4
-rw-r--r--source/blender/blenkernel/BKE_blender_version.h6
-rw-r--r--source/blender/blenkernel/BKE_multires.h11
-rw-r--r--source/blender/blenkernel/intern/armature.c21
-rw-r--r--source/blender/blenkernel/intern/curve.c776
-rw-r--r--source/blender/blenkernel/intern/displist.c423
-rw-r--r--source/blender/blenkernel/intern/fluid.c36
-rw-r--r--source/blender/blenkernel/intern/lib_override.c9
-rw-r--r--source/blender/blenkernel/intern/mesh.c44
-rw-r--r--source/blender/blenkernel/intern/multires.c866
-rw-r--r--source/blender/blenkernel/intern/multires_reshape.c2
-rw-r--r--source/blender/blenkernel/intern/multires_reshape.h8
-rw-r--r--source/blender/blenkernel/intern/multires_reshape_subdivide.c2
-rw-r--r--source/blender/blenkernel/intern/multires_reshape_util.c8
-rw-r--r--source/blender/blenkernel/intern/shrinkwrap.c4
-rw-r--r--source/blender/blenlib/intern/delaunay_2d.cc4
-rw-r--r--source/blender/blenloader/intern/versioning_250.c16
-rw-r--r--source/blender/blenloader/intern/versioning_legacy.c18
-rw-r--r--source/blender/compositor/CMakeLists.txt2
-rw-r--r--source/blender/compositor/nodes/COM_KeyingNode.cpp4
-rw-r--r--source/blender/compositor/operations/COM_KeyingSetAlphaOperation.cpp55
-rw-r--r--source/blender/compositor/operations/COM_KeyingSetAlphaOperation.h39
-rw-r--r--source/blender/editors/armature/armature_naming.c2
-rw-r--r--source/blender/editors/armature/armature_select.c4
-rw-r--r--source/blender/editors/armature/pose_edit.c2
-rw-r--r--source/blender/editors/curve/editcurve.c570
-rw-r--r--source/blender/editors/curve/editcurve_query.c4
-rw-r--r--source/blender/editors/curve/editcurve_select.c33
-rw-r--r--source/blender/editors/gpencil/gpencil_edit.c24
-rw-r--r--source/blender/editors/gpencil/gpencil_mesh.c140
-rw-r--r--source/blender/editors/interface/interface.c202
-rw-r--r--source/blender/editors/interface/interface_eyedropper.c2
-rw-r--r--source/blender/editors/interface/interface_templates.c2
-rw-r--r--source/blender/editors/mesh/editmesh_bevel.c28
-rw-r--r--source/blender/editors/mesh/editmesh_select_similar.c2
-rw-r--r--source/blender/editors/object/object_hook.c8
-rw-r--r--source/blender/editors/object/object_modifier.c4
-rw-r--r--source/blender/editors/object/object_relations.c2
-rw-r--r--source/blender/editors/physics/particle_object.c4
-rw-r--r--source/blender/editors/screen/screen_ops.c4
-rw-r--r--source/blender/editors/sculpt_paint/paint_mask.c132
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c39
-rw-r--r--source/blender/editors/sculpt_paint/sculpt_cloth.c63
-rw-r--r--source/blender/editors/sculpt_paint/sculpt_face_set.c215
-rw-r--r--source/blender/editors/space_clip/tracking_ops.c6
-rw-r--r--source/blender/editors/space_clip/tracking_select.c12
-rw-r--r--source/blender/editors/space_file/file_ops.c3
-rw-r--r--source/blender/editors/space_file/fsmenu.c44
-rw-r--r--source/blender/editors/space_graph/graph_draw.c6
-rw-r--r--source/blender/editors/space_graph/graph_select.c11
-rw-r--r--source/blender/editors/space_sequencer/sequencer_edit.c4
-rw-r--r--source/blender/editors/space_text/text_ops.c4
-rw-r--r--source/blender/editors/space_view3d/view3d_buttons.c11
-rw-r--r--source/blender/editors/transform/transform.c18
-rw-r--r--source/blender/gpencil_modifiers/intern/MOD_gpencilarmature.c2
-rw-r--r--source/blender/gpencil_modifiers/intern/MOD_gpencilsubdiv.c5
-rw-r--r--source/blender/makesdna/DNA_brush_types.h1
-rw-r--r--source/blender/makesdna/DNA_constraint_types.h2
-rw-r--r--source/blender/makesdna/DNA_gpencil_modifier_types.h2
-rw-r--r--source/blender/makesdna/DNA_mesh_types.h4
-rw-r--r--source/blender/makesdna/DNA_meshdata_types.h50
-rw-r--r--source/blender/makesdna/DNA_modifier_types.h4
-rw-r--r--source/blender/makesdna/DNA_shader_fx_types.h2
-rw-r--r--source/blender/makesrna/intern/rna_action.c2
-rw-r--r--source/blender/makesrna/intern/rna_brush.c6
-rw-r--r--source/blender/makesrna/intern/rna_color.c2
-rw-r--r--source/blender/makesrna/intern/rna_curve.c8
-rw-r--r--source/blender/makesrna/intern/rna_nodetree.c8
-rw-r--r--source/blender/makesrna/intern/rna_scene.c22
-rw-r--r--source/blender/makesrna/intern/rna_sculpt_paint.c2
-rw-r--r--source/blender/makesrna/intern/rna_sequencer.c6
-rw-r--r--source/blender/makesrna/intern/rna_space.c4
-rw-r--r--source/blender/makesrna/intern/rna_texture.c4
-rw-r--r--source/blender/makesrna/intern/rna_userdef.c2
-rw-r--r--source/blender/makesrna/intern/rna_wm_api.c4
-rw-r--r--source/blender/modifiers/intern/MOD_armature.c2
-rw-r--r--source/blender/modifiers/intern/MOD_ui_common.c4
-rw-r--r--source/blender/python/intern/bpy_app.c3
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c4
123 files changed, 2587 insertions, 3267 deletions
diff --git a/build_files/cmake/platform/platform_apple.cmake b/build_files/cmake/platform/platform_apple.cmake
index 4697e6bc766..d9006297c4d 100644
--- a/build_files/cmake/platform/platform_apple.cmake
+++ b/build_files/cmake/platform/platform_apple.cmake
@@ -335,7 +335,10 @@ endif()
if(WITH_CYCLES_EMBREE)
find_package(Embree 3.8.0 REQUIRED)
- set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Xlinker -stack_size -Xlinker 0x100000")
+ # Increase stack size for Embree, only works for executables.
+ if(NOT WITH_PYTHON_MODULE)
+ set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Xlinker -stack_size -Xlinker 0x100000")
+ endif()
# Embree static library linking can mix up SSE and AVX symbols, causing
# crashes on macOS systems with older CPUs that don't have AVX. Using
diff --git a/doc/doxygen/Doxyfile b/doc/doxygen/Doxyfile
index 6e4a087fa36..ca545eec4ca 100644
--- a/doc/doxygen/Doxyfile
+++ b/doc/doxygen/Doxyfile
@@ -38,7 +38,7 @@ PROJECT_NAME = Blender
# could be handy for archiving the generated documentation or if some version
# control system is used.
-PROJECT_NUMBER = "V2.91"
+PROJECT_NUMBER = "V2.92"
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py
index 72d98e78c4d..6b88be3e7aa 100644
--- a/intern/cycles/blender/addon/ui.py
+++ b/intern/cycles/blender/addon/ui.py
@@ -1271,7 +1271,7 @@ class CYCLES_OBJECT_PT_visibility(CyclesButtonsPanel, Panel):
layout.prop(ob, "hide_select", text="Selectable", invert_checkbox=True, toggle=False)
- col = layout.column(heading="Show in")
+ col = layout.column(heading="Show In")
col.prop(ob, "hide_viewport", text="Viewports", invert_checkbox=True, toggle=False)
col.prop(ob, "hide_render", text="Renders", invert_checkbox=True, toggle=False)
diff --git a/intern/cycles/blender/blender_geometry.cpp b/intern/cycles/blender/blender_geometry.cpp
index 002f5e0fdb7..14da8075903 100644
--- a/intern/cycles/blender/blender_geometry.cpp
+++ b/intern/cycles/blender/blender_geometry.cpp
@@ -25,6 +25,7 @@
#include "blender/blender_util.h"
#include "util/util_foreach.h"
+#include "util/util_task.h"
CCL_NAMESPACE_BEGIN
@@ -45,7 +46,8 @@ Geometry *BlenderSync::sync_geometry(BL::Depsgraph &b_depsgraph,
BL::Object &b_ob,
BL::Object &b_ob_instance,
bool object_updated,
- bool use_particle_hair)
+ bool use_particle_hair,
+ TaskPool *task_pool)
{
/* Test if we can instance or if the object is modified. */
BL::ID b_ob_data = b_ob.data();
@@ -77,8 +79,15 @@ Geometry *BlenderSync::sync_geometry(BL::Depsgraph &b_depsgraph,
used_shaders.push_back(default_shader);
}
- /* Test if we need to sync. */
+ /* Ensure we only sync instanced geometry once. */
Geometry *geom = geometry_map.find(key);
+ if (geom) {
+ if (geometry_synced.find(geom) != geometry_synced.end()) {
+ return geom;
+ }
+ }
+
+ /* Test if we need to sync. */
bool sync = true;
if (geom == NULL) {
/* Add new geometry if it did not exist yet. */
@@ -125,28 +134,36 @@ Geometry *BlenderSync::sync_geometry(BL::Depsgraph &b_depsgraph,
}
}
- /* Ensure we only sync instanced geometry once. */
- if (geometry_synced.find(geom) != geometry_synced.end()) {
- return geom;
- }
-
- progress.set_sync_status("Synchronizing object", b_ob.name());
-
geometry_synced.insert(geom);
geom->name = ustring(b_ob_data.name().c_str());
- if (geom_type == Geometry::HAIR) {
- Hair *hair = static_cast<Hair *>(geom);
- sync_hair(b_depsgraph, b_ob, hair, used_shaders);
- }
- else if (geom_type == Geometry::VOLUME) {
- Volume *volume = static_cast<Volume *>(geom);
- sync_volume(b_ob, volume, used_shaders);
+ auto sync_func = [=]() mutable {
+ if (progress.get_cancel())
+ return;
+
+ progress.set_sync_status("Synchronizing object", b_ob.name());
+
+ if (geom_type == Geometry::HAIR) {
+ Hair *hair = static_cast<Hair *>(geom);
+ sync_hair(b_depsgraph, b_ob, hair, used_shaders);
+ }
+ else if (geom_type == Geometry::VOLUME) {
+ Volume *volume = static_cast<Volume *>(geom);
+ sync_volume(b_ob, volume, used_shaders);
+ }
+ else {
+ Mesh *mesh = static_cast<Mesh *>(geom);
+ sync_mesh(b_depsgraph, b_ob, mesh, used_shaders);
+ }
+ };
+
+ /* Defer the actual geometry sync to the task_pool for multithreading */
+ if (task_pool) {
+ task_pool->push(sync_func);
}
else {
- Mesh *mesh = static_cast<Mesh *>(geom);
- sync_mesh(b_depsgraph, b_ob, mesh, used_shaders);
+ sync_func();
}
return geom;
@@ -156,7 +173,8 @@ void BlenderSync::sync_geometry_motion(BL::Depsgraph &b_depsgraph,
BL::Object &b_ob,
Object *object,
float motion_time,
- bool use_particle_hair)
+ bool use_particle_hair,
+ TaskPool *task_pool)
{
/* Ensure we only sync instanced geometry once. */
Geometry *geom = object->geometry;
@@ -177,16 +195,29 @@ void BlenderSync::sync_geometry_motion(BL::Depsgraph &b_depsgraph,
return;
}
- if (b_ob.type() == BL::Object::type_HAIR || use_particle_hair) {
- Hair *hair = static_cast<Hair *>(geom);
- sync_hair_motion(b_depsgraph, b_ob, hair, motion_step);
- }
- else if (b_ob.type() == BL::Object::type_VOLUME || object_fluid_gas_domain_find(b_ob)) {
- /* No volume motion blur support yet. */
+ auto sync_func = [=]() mutable {
+ if (progress.get_cancel())
+ return;
+
+ if (b_ob.type() == BL::Object::type_HAIR || use_particle_hair) {
+ Hair *hair = static_cast<Hair *>(geom);
+ sync_hair_motion(b_depsgraph, b_ob, hair, motion_step);
+ }
+ else if (b_ob.type() == BL::Object::type_VOLUME || object_fluid_gas_domain_find(b_ob)) {
+ /* No volume motion blur support yet. */
+ }
+ else {
+ Mesh *mesh = static_cast<Mesh *>(geom);
+ sync_mesh_motion(b_depsgraph, b_ob, mesh, motion_step);
+ }
+ };
+
+ /* Defer the actual geometry sync to the task_pool for multithreading */
+ if (task_pool) {
+ task_pool->push(sync_func);
}
else {
- Mesh *mesh = static_cast<Mesh *>(geom);
- sync_mesh_motion(b_depsgraph, b_ob, mesh, motion_step);
+ sync_func();
}
}
diff --git a/intern/cycles/blender/blender_object.cpp b/intern/cycles/blender/blender_object.cpp
index 212b9cbe103..23faacc15da 100644
--- a/intern/cycles/blender/blender_object.cpp
+++ b/intern/cycles/blender/blender_object.cpp
@@ -32,6 +32,7 @@
#include "util/util_foreach.h"
#include "util/util_hash.h"
#include "util/util_logging.h"
+#include "util/util_task.h"
CCL_NAMESPACE_BEGIN
@@ -103,7 +104,8 @@ Object *BlenderSync::sync_object(BL::Depsgraph &b_depsgraph,
bool use_particle_hair,
bool show_lights,
BlenderObjectCulling &culling,
- bool *use_portal)
+ bool *use_portal,
+ TaskPool *geom_task_pool)
{
const bool is_instance = b_instance.is_instance();
BL::Object b_ob = b_instance.object();
@@ -181,6 +183,10 @@ Object *BlenderSync::sync_object(BL::Depsgraph &b_depsgraph,
return NULL;
}
+ /* Use task pool only for non-instances, since sync_dupli_particle accesses
+ * geometry. This restriction should be removed for better performance. */
+ TaskPool *object_geom_task_pool = (is_instance) ? NULL : geom_task_pool;
+
/* key to lookup object */
ObjectKey key(b_parent, persistent_id, b_ob_instance, use_particle_hair);
Object *object;
@@ -198,7 +204,12 @@ Object *BlenderSync::sync_object(BL::Depsgraph &b_depsgraph,
/* mesh deformation */
if (object->geometry)
- sync_geometry_motion(b_depsgraph, b_ob, object, motion_time, use_particle_hair);
+ sync_geometry_motion(b_depsgraph,
+ b_ob_instance,
+ object,
+ motion_time,
+ use_particle_hair,
+ object_geom_task_pool);
}
return object;
@@ -211,8 +222,15 @@ Object *BlenderSync::sync_object(BL::Depsgraph &b_depsgraph,
object_updated = true;
/* mesh sync */
- object->geometry = sync_geometry(
- b_depsgraph, b_ob, b_ob_instance, object_updated, use_particle_hair);
+ /* b_ob is owned by the iterator and will go out of scope at the end of the block.
+ * b_ob_instance is the original object and will remain valid for deferred geometry
+ * sync. */
+ object->geometry = sync_geometry(b_depsgraph,
+ b_ob_instance,
+ b_ob_instance,
+ object_updated,
+ use_particle_hair,
+ object_geom_task_pool);
/* special case not tracked by object update flags */
@@ -331,6 +349,9 @@ void BlenderSync::sync_objects(BL::Depsgraph &b_depsgraph,
BL::SpaceView3D &b_v3d,
float motion_time)
{
+ /* Task pool for multithreaded geometry sync. */
+ TaskPool geom_task_pool;
+
/* layer data */
bool motion = motion_time != 0.0f;
@@ -355,8 +376,8 @@ void BlenderSync::sync_objects(BL::Depsgraph &b_depsgraph,
const bool show_lights = BlenderViewportParameters(b_v3d).use_scene_lights;
BL::ViewLayer b_view_layer = b_depsgraph.view_layer_eval();
-
BL::Depsgraph::object_instances_iterator b_instance_iter;
+
for (b_depsgraph.object_instances.begin(b_instance_iter);
b_instance_iter != b_depsgraph.object_instances.end() && !cancel;
++b_instance_iter) {
@@ -372,6 +393,11 @@ void BlenderSync::sync_objects(BL::Depsgraph &b_depsgraph,
/* Load per-object culling data. */
culling.init_object(scene, b_ob);
+ /* Ensure the object geom supporting the hair is processed before adding
+ * the hair processing task to the task pool, calling .to_mesh() on the
+ * same object in parallel does not work. */
+ const bool sync_hair = b_instance.show_particles() && object_has_particle_hair(b_ob);
+
/* Object itself. */
if (b_instance.show_self()) {
sync_object(b_depsgraph,
@@ -381,11 +407,12 @@ void BlenderSync::sync_objects(BL::Depsgraph &b_depsgraph,
false,
show_lights,
culling,
- &use_portal);
+ &use_portal,
+ sync_hair ? NULL : &geom_task_pool);
}
/* Particle hair as separate object. */
- if (b_instance.show_particles() && object_has_particle_hair(b_ob)) {
+ if (sync_hair) {
sync_object(b_depsgraph,
b_view_layer,
b_instance,
@@ -393,12 +420,15 @@ void BlenderSync::sync_objects(BL::Depsgraph &b_depsgraph,
true,
show_lights,
culling,
- &use_portal);
+ &use_portal,
+ &geom_task_pool);
}
cancel = progress.get_cancel();
}
+ geom_task_pool.wait_work();
+
progress.set_sync_status("");
if (!cancel && !motion) {
diff --git a/intern/cycles/blender/blender_sync.h b/intern/cycles/blender/blender_sync.h
index 62fd1ac2351..a17db128957 100644
--- a/intern/cycles/blender/blender_sync.h
+++ b/intern/cycles/blender/blender_sync.h
@@ -50,6 +50,7 @@ class ViewLayer;
class Shader;
class ShaderGraph;
class ShaderNode;
+class TaskPool;
class BlenderSync {
public:
@@ -145,7 +146,8 @@ class BlenderSync {
bool use_particle_hair,
bool show_lights,
BlenderObjectCulling &culling,
- bool *use_portal);
+ bool *use_portal,
+ TaskPool *geom_task_pool);
/* Volume */
void sync_volume(BL::Object &b_ob, Volume *volume, const vector<Shader *> &used_shaders);
@@ -177,12 +179,15 @@ class BlenderSync {
BL::Object &b_ob,
BL::Object &b_ob_instance,
bool object_updated,
- bool use_particle_hair);
+ bool use_particle_hair,
+ TaskPool *task_pool);
+
void sync_geometry_motion(BL::Depsgraph &b_depsgraph,
BL::Object &b_ob,
Object *object,
float motion_time,
- bool use_particle_hair);
+ bool use_particle_hair,
+ TaskPool *task_pool);
/* Light */
void sync_light(BL::Object &b_parent,
diff --git a/release/datafiles/splash.png b/release/datafiles/splash.png
index 9f6078722ee..babb3e30c6d 100644
--- a/release/datafiles/splash.png
+++ b/release/datafiles/splash.png
Binary files differ
diff --git a/release/scripts/modules/bl_keymap_utils/io.py b/release/scripts/modules/bl_keymap_utils/io.py
index 8cddbd37ea3..e850661d6c6 100644
--- a/release/scripts/modules/bl_keymap_utils/io.py
+++ b/release/scripts/modules/bl_keymap_utils/io.py
@@ -73,6 +73,11 @@ def kmi_args_as_data(kmi):
if kmi.key_modifier and kmi.key_modifier != 'NONE':
s.append(f"\"key_modifier\": '{kmi.key_modifier}'")
+ if kmi.repeat:
+ if kmi.map_type == 'KEYBOARD':
+ if kmi.value in {'PRESS', 'ANY'}:
+ s.append("\"repeat\": True")
+
return "{" + ", ".join(s) + "}"
@@ -161,6 +166,13 @@ def keyconfig_export_as_data(wm, kc, filepath, *, all_keymaps=False):
with open(filepath, "w") as fh:
fw = fh.write
+
+ # Use the file version since it includes the sub-version
+ # which we can bump multiple times between releases.
+ from bpy.app import version_file
+ fw(f"keyconfig_version = {version_file!r}\n")
+ del version_file
+
fw("keyconfig_data = \\\n[")
for km, _kc_x in export_keymaps:
@@ -212,7 +224,11 @@ def keyconfig_export_as_data(wm, kc, filepath, *, all_keymaps=False):
fw("if __name__ == \"__main__\":\n")
fw(" import os\n")
fw(" from bl_keymap_utils.io import keyconfig_import_from_data\n")
- fw(" keyconfig_import_from_data(os.path.splitext(os.path.basename(__file__))[0], keyconfig_data)\n")
+ fw(" keyconfig_import_from_data(\n")
+ fw(" os.path.splitext(os.path.basename(__file__))[0],\n")
+ fw(" keyconfig_data,\n")
+ fw(" keyconfig_version=keyconfig_version,\n")
+ fw(" )\n")
# -----------------------------------------------------------------------------
@@ -264,7 +280,7 @@ def keyconfig_init_from_data(kc, keyconfig_data):
keymap_init_from_data(km, km_items, is_modal=km_args.get("modal", False))
-def keyconfig_import_from_data(name, keyconfig_data):
+def keyconfig_import_from_data(name, keyconfig_data, *, keyconfig_version=(0, 0, 0)):
# Load data in the format defined above.
#
# Runs at load time, keep this fast!
@@ -272,6 +288,9 @@ def keyconfig_import_from_data(name, keyconfig_data):
import bpy
wm = bpy.context.window_manager
kc = wm.keyconfigs.new(name)
+ if keyconfig_version is not None:
+ from .versioning import keyconfig_update
+ keyconfig_data = keyconfig_update(keyconfig_data, keyconfig_version)
keyconfig_init_from_data(kc, keyconfig_data)
return kc
diff --git a/release/scripts/modules/bl_keymap_utils/versioning.py b/release/scripts/modules/bl_keymap_utils/versioning.py
new file mode 100644
index 00000000000..4c2e8ed7f54
--- /dev/null
+++ b/release/scripts/modules/bl_keymap_utils/versioning.py
@@ -0,0 +1,49 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
+# <pep8 compliant>
+
+# Update Blender version this key-map was written in:
+#
+# When the version is ``(0, 0, 0)``, the key-map being loaded didn't contain any versioning information.
+# This will older than ``(2, 92, 0)``.
+
+def keyconfig_update(keyconfig_data, keyconfig_version):
+ from bpy.app import version_file as blender_version
+ if keyconfig_version >= blender_version:
+ return keyconfig_data
+
+ # Version the key-map.
+ import copy
+ has_copy = False
+
+ # Default repeat to false.
+ if keyconfig_version <= (2, 92, 0):
+ # Only copy once.
+ if not has_copy:
+ keyconfig_data = copy.deepcopy(keyconfig_data)
+ has_copy = True
+
+ for _km_name, _km_parms, km_items_data in keyconfig_data:
+ for (_item_op, item_event, _item_prop) in km_items_data["items"]:
+ if item_event.get("value") == 'PRESS':
+ # Unfortunately we don't know the 'map_type' at this point.
+ # Setting repeat true on other kinds of events is harmless.
+ item_event["repeat"] = True
+
+ return keyconfig_data
diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
index 03c5e6b18c0..97acdfd311c 100644
--- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py
+++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
@@ -394,7 +394,7 @@ def km_window(params):
("wm.window_new", {"type": 'W', "value": 'PRESS', "ctrl": True, "alt": True}, None),
("wm.window_fullscreen_toggle", {"type": 'F11', "value": 'PRESS', "alt": True}, None),
("wm.doc_view_manual_ui_context", {"type": 'F1', "value": 'PRESS', "alt": True}, None),
- ("wm.search_menu", {"type": 'SPACE', "value": 'PRESS', "repeat": False}, None),
+ ("wm.search_menu", {"type": 'SPACE', "value": 'PRESS'}, None),
("wm.redraw_timer", {"type": 'T', "value": 'PRESS', "ctrl": True, "alt": True}, None),
("wm.debug_menu", {"type": 'D', "value": 'PRESS', "ctrl": True, "alt": True}, None),
])
@@ -470,11 +470,11 @@ def km_window(params):
)
elif params.spacebar_action == 'PLAY':
items.append(
- ("wm.toolbar", {"type": 'SPACE', "value": 'PRESS', "shift": True, "repeat": False}, None),
+ ("wm.toolbar", {"type": 'SPACE', "value": 'PRESS', "shift": True}, None),
)
elif params.spacebar_action == 'SEARCH':
items.append(
- ("wm.search_menu", {"type": 'SPACE', "value": 'PRESS', "repeat": False}, None),
+ ("wm.search_menu", {"type": 'SPACE', "value": 'PRESS'}, None),
)
else:
assert False
@@ -506,14 +506,14 @@ def km_screen(params):
# Quad view
("screen.region_quadview", {"type": 'Q', "value": 'PRESS', "ctrl": True, "alt": True}, None),
# Repeat last
- ("screen.repeat_last", {"type": 'R', "value": 'PRESS', "shift": True}, None),
+ ("screen.repeat_last", {"type": 'R', "value": 'PRESS', "shift": True, "repeat": True}, None),
# Files
("file.execute", {"type": 'RET', "value": 'PRESS'}, None),
("file.execute", {"type": 'NUMPAD_ENTER', "value": 'PRESS'}, None),
("file.cancel", {"type": 'ESC', "value": 'PRESS'}, None),
# Undo
- ("ed.undo", {"type": 'Z', "value": 'PRESS', "ctrl": True}, None),
- ("ed.redo", {"type": 'Z', "value": 'PRESS', "shift": True, "ctrl": True}, None),
+ ("ed.undo", {"type": 'Z', "value": 'PRESS', "ctrl": True, "repeat": True}, None),
+ ("ed.redo", {"type": 'Z', "value": 'PRESS', "shift": True, "ctrl": True, "repeat": True}, None),
# Render
("render.render", {"type": 'F12', "value": 'PRESS'},
{"properties": [("use_viewport", True)]}),
@@ -526,8 +526,8 @@ def km_screen(params):
if not params.legacy:
items.extend([
- ("screen.screen_full_area", {"type": 'SPACE', "value": 'PRESS', "ctrl": True, "repeat": False}, None),
- ("screen.screen_full_area", {"type": 'SPACE', "value": 'PRESS', "ctrl": True, "alt": True, "repeat": False},
+ ("screen.screen_full_area", {"type": 'SPACE', "value": 'PRESS', "ctrl": True}, None),
+ ("screen.screen_full_area", {"type": 'SPACE', "value": 'PRESS', "ctrl": True, "alt": True},
{"properties": [("use_hide_panels", True)]}),
("screen.redo_last", {"type": 'F9', "value": 'PRESS'}, None),
])
@@ -633,8 +633,8 @@ def km_view2d(_params):
# Zoom with single step
("view2d.zoom_out", {"type": 'WHEELOUTMOUSE', "value": 'PRESS'}, None),
("view2d.zoom_in", {"type": 'WHEELINMOUSE', "value": 'PRESS'}, None),
- ("view2d.zoom_out", {"type": 'NUMPAD_MINUS', "value": 'PRESS'}, None),
- ("view2d.zoom_in", {"type": 'NUMPAD_PLUS', "value": 'PRESS'}, None),
+ ("view2d.zoom_out", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "repeat": True}, None),
+ ("view2d.zoom_in", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "repeat": True}, None),
("view2d.zoom", {"type": 'TRACKPADPAN', "value": 'ANY', "ctrl": True}, None),
("view2d.smoothview", {"type": 'TIMER1', "value": 'ANY', "any": True}, None),
# Scroll up/down, only when zoom is not available.
@@ -668,16 +668,16 @@ def km_view2d_buttons_list(_params):
("view2d.pan", {"type": 'TRACKPADPAN', "value": 'ANY'}, None),
("view2d.scroll_down", {"type": 'WHEELDOWNMOUSE', "value": 'PRESS'}, None),
("view2d.scroll_up", {"type": 'WHEELUPMOUSE', "value": 'PRESS'}, None),
- ("view2d.scroll_down", {"type": 'PAGE_DOWN', "value": 'PRESS'},
+ ("view2d.scroll_down", {"type": 'PAGE_DOWN', "value": 'PRESS', "repeat": True},
{"properties": [("page", True)]}),
- ("view2d.scroll_up", {"type": 'PAGE_UP', "value": 'PRESS'},
+ ("view2d.scroll_up", {"type": 'PAGE_UP', "value": 'PRESS', "repeat": True},
{"properties": [("page", True)]}),
# Zoom
("view2d.zoom", {"type": 'MIDDLEMOUSE', "value": 'PRESS', "ctrl": True}, None),
("view2d.zoom", {"type": 'TRACKPADZOOM', "value": 'ANY'}, None),
("view2d.zoom", {"type": 'TRACKPADPAN', "value": 'ANY', "ctrl": True}, None),
- ("view2d.zoom_out", {"type": 'NUMPAD_MINUS', "value": 'PRESS'}, None),
- ("view2d.zoom_in", {"type": 'NUMPAD_PLUS', "value": 'PRESS'}, None),
+ ("view2d.zoom_out", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "repeat": True}, None),
+ ("view2d.zoom_in", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "repeat": True}, None),
("view2d.reset", {"type": 'HOME', "value": 'PRESS'}, None),
])
@@ -789,17 +789,21 @@ def km_outliner(params):
{"properties": [("tweak", True), ("mode", "ADD")]}),
("outliner.select_box", {"type": 'EVT_TWEAK_L', "value": 'ANY', "ctrl": True},
{"properties": [("tweak", True), ("mode", "SUB")]}),
- ("outliner.select_walk", {"type": 'UP_ARROW', "value": 'PRESS'}, {"properties": [("direction", 'UP')]}),
- ("outliner.select_walk", {"type": 'UP_ARROW', "value": 'PRESS', "shift": True},
+ ("outliner.select_walk", {"type": 'UP_ARROW', "value": 'PRESS', "repeat": True},
+ {"properties": [("direction", 'UP')]}),
+ ("outliner.select_walk", {"type": 'UP_ARROW', "value": 'PRESS', "shift": True, "repeat": True},
{"properties": [("direction", 'UP'), ("extend", True)]}),
- ("outliner.select_walk", {"type": 'DOWN_ARROW', "value": 'PRESS'}, {"properties": [("direction", 'DOWN')]}),
- ("outliner.select_walk", {"type": 'DOWN_ARROW', "value": 'PRESS', "shift": True},
+ ("outliner.select_walk", {"type": 'DOWN_ARROW', "value": 'PRESS', "repeat": True},
+ {"properties": [("direction", 'DOWN')]}),
+ ("outliner.select_walk", {"type": 'DOWN_ARROW', "value": 'PRESS', "shift": True, "repeat": True},
{"properties": [("direction", 'DOWN'), ("extend", True)]}),
- ("outliner.select_walk", {"type": 'LEFT_ARROW', "value": 'PRESS'}, {"properties": [("direction", 'LEFT')]}),
- ("outliner.select_walk", {"type": 'LEFT_ARROW', "value": 'PRESS', "shift": True},
+ ("outliner.select_walk", {"type": 'LEFT_ARROW', "value": 'PRESS', "repeat": True},
+ {"properties": [("direction", 'LEFT')]}),
+ ("outliner.select_walk", {"type": 'LEFT_ARROW', "value": 'PRESS', "shift": True, "repeat": True},
{"properties": [("direction", 'LEFT'), ("toggle_all", True)]}),
- ("outliner.select_walk", {"type": 'RIGHT_ARROW', "value": 'PRESS'}, {"properties": [("direction", 'RIGHT')]}),
- ("outliner.select_walk", {"type": 'RIGHT_ARROW', "value": 'PRESS', "shift": True},
+ ("outliner.select_walk", {"type": 'RIGHT_ARROW', "value": 'PRESS', "repeat": True},
+ {"properties": [("direction", 'RIGHT')]}),
+ ("outliner.select_walk", {"type": 'RIGHT_ARROW', "value": 'PRESS', "shift": True, "repeat": True},
{"properties": [("direction", 'RIGHT'), ("toggle_all", True)]}),
("outliner.item_openclose", {"type": 'LEFTMOUSE', "value": 'CLICK'},
{"properties": [("all", False)]}),
@@ -815,9 +819,9 @@ def km_outliner(params):
("outliner.show_hierarchy", {"type": 'HOME', "value": 'PRESS'}, None),
("outliner.show_active", {"type": 'PERIOD', "value": 'PRESS'}, None),
("outliner.show_active", {"type": 'NUMPAD_PERIOD', "value": 'PRESS'}, None),
- ("outliner.scroll_page", {"type": 'PAGE_DOWN', "value": 'PRESS'},
+ ("outliner.scroll_page", {"type": 'PAGE_DOWN', "value": 'PRESS', "repeat": True},
{"properties": [("up", False)]}),
- ("outliner.scroll_page", {"type": 'PAGE_UP', "value": 'PRESS'},
+ ("outliner.scroll_page", {"type": 'PAGE_UP', "value": 'PRESS', "repeat": True},
{"properties": [("up", True)]}),
("outliner.show_one_level", {"type": 'NUMPAD_PLUS', "value": 'PRESS'}, None),
("outliner.show_one_level", {"type": 'NUMPAD_MINUS', "value": 'PRESS'},
@@ -890,8 +894,8 @@ def km_uv_editor(params):
{"properties": [("extend", True), ("deselect", False)]}),
("uv.select_linked_pick", {"type": 'L', "value": 'PRESS', "shift": True},
{"properties": [("extend", False), ("deselect", True)]}),
- ("uv.select_more", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True}, None),
- ("uv.select_less", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True}, None),
+ ("uv.select_more", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True, "repeat": True}, None),
+ ("uv.select_less", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True, "repeat": True}, None),
*_template_items_select_actions(params, "uv.select_all"),
("uv.select_pinned", {"type": 'P', "value": 'PRESS', "shift": True}, None),
op_menu("IMAGE_MT_uvs_merge", {"type": 'M', "value": 'PRESS'}),
@@ -912,12 +916,12 @@ def km_uv_editor(params):
op_menu_pie("IMAGE_MT_uvs_snap_pie", {"type": 'S', "value": 'PRESS', "shift": True}),
op_menu("IMAGE_MT_uvs_select_mode", {"type": 'TAB', "value": 'PRESS', "ctrl": True}),
*_template_items_proportional_editing(connected=False),
- ("transform.translate", {"type": 'G', "value": 'PRESS', "repeat": False}, None),
+ ("transform.translate", {"type": 'G', "value": 'PRESS'}, None),
("transform.translate", {"type": params.select_tweak, "value": 'ANY'}, None),
- ("transform.rotate", {"type": 'R', "value": 'PRESS', "repeat": False}, None),
- ("transform.resize", {"type": 'S', "value": 'PRESS', "repeat": False}, None),
- ("transform.shear", {"type": 'S', "value": 'PRESS', "shift": True, "ctrl": True, "alt": True, "repeat": False}, None),
- ("transform.mirror", {"type": 'M', "value": 'PRESS', "ctrl": True, "repeat": False}, None),
+ ("transform.rotate", {"type": 'R', "value": 'PRESS'}, None),
+ ("transform.resize", {"type": 'S', "value": 'PRESS'}, None),
+ ("transform.shear", {"type": 'S', "value": 'PRESS', "shift": True, "ctrl": True, "alt": True}, None),
+ ("transform.mirror", {"type": 'M', "value": 'PRESS', "ctrl": True}, None),
("wm.context_toggle", {"type": 'TAB', "value": 'PRESS', "shift": True},
{"properties": [("data_path", 'tool_settings.use_snap')]}),
("wm.context_menu_enum", {"type": 'TAB', "value": 'PRESS', "shift": True, "ctrl": True},
@@ -1031,25 +1035,25 @@ def km_view3d(params):
("view3d.smoothview", {"type": 'TIMER1', "value": 'ANY', "any": True}, None),
("view3d.zoom", {"type": 'TRACKPADZOOM', "value": 'ANY'}, None),
("view3d.zoom", {"type": 'TRACKPADPAN', "value": 'ANY', "ctrl": True}, None),
- ("view3d.zoom", {"type": 'NUMPAD_PLUS', "value": 'PRESS'},
+ ("view3d.zoom", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "repeat": True},
{"properties": [("delta", 1)]}),
- ("view3d.zoom", {"type": 'NUMPAD_MINUS', "value": 'PRESS'},
+ ("view3d.zoom", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "repeat": True},
{"properties": [("delta", -1)]}),
- ("view3d.zoom", {"type": 'EQUAL', "value": 'PRESS', "ctrl": True},
+ ("view3d.zoom", {"type": 'EQUAL', "value": 'PRESS', "ctrl": True, "repeat": True},
{"properties": [("delta", 1)]}),
- ("view3d.zoom", {"type": 'MINUS', "value": 'PRESS', "ctrl": True},
+ ("view3d.zoom", {"type": 'MINUS', "value": 'PRESS', "ctrl": True, "repeat": True},
{"properties": [("delta", -1)]}),
("view3d.zoom", {"type": 'WHEELINMOUSE', "value": 'PRESS'},
{"properties": [("delta", 1)]}),
("view3d.zoom", {"type": 'WHEELOUTMOUSE', "value": 'PRESS'},
{"properties": [("delta", -1)]}),
- ("view3d.dolly", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "shift": True},
+ ("view3d.dolly", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "shift": True, "repeat": True},
{"properties": [("delta", 1)]}),
- ("view3d.dolly", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "shift": True},
+ ("view3d.dolly", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "shift": True, "repeat": True},
{"properties": [("delta", -1)]}),
- ("view3d.dolly", {"type": 'EQUAL', "value": 'PRESS', "shift": True, "ctrl": True},
+ ("view3d.dolly", {"type": 'EQUAL', "value": 'PRESS', "shift": True, "ctrl": True, "repeat": True},
{"properties": [("delta", 1)]}),
- ("view3d.dolly", {"type": 'MINUS', "value": 'PRESS', "shift": True, "ctrl": True},
+ ("view3d.dolly", {"type": 'MINUS', "value": 'PRESS', "shift": True, "ctrl": True, "repeat": True},
{"properties": [("delta", -1)]}),
("view3d.view_center_camera", {"type": 'HOME', "value": 'PRESS'}, None),
("view3d.view_center_lock", {"type": 'HOME', "value": 'PRESS'}, None),
@@ -1070,18 +1074,18 @@ def km_view3d(params):
("view3d.view_camera", {"type": 'NUMPAD_0', "value": 'PRESS'}, None),
("view3d.view_axis", {"type": 'NUMPAD_1', "value": 'PRESS'},
{"properties": [("type", 'FRONT')]}),
- ("view3d.view_orbit", {"type": 'NUMPAD_2', "value": 'PRESS'},
+ ("view3d.view_orbit", {"type": 'NUMPAD_2', "value": 'PRESS', "repeat": True},
{"properties": [("type", 'ORBITDOWN')]}),
("view3d.view_axis", {"type": 'NUMPAD_3', "value": 'PRESS'},
{"properties": [("type", 'RIGHT')]}),
- ("view3d.view_orbit", {"type": 'NUMPAD_4', "value": 'PRESS'},
+ ("view3d.view_orbit", {"type": 'NUMPAD_4', "value": 'PRESS', "repeat": True},
{"properties": [("type", 'ORBITLEFT')]}),
("view3d.view_persportho", {"type": 'NUMPAD_5', "value": 'PRESS'}, None),
- ("view3d.view_orbit", {"type": 'NUMPAD_6', "value": 'PRESS'},
+ ("view3d.view_orbit", {"type": 'NUMPAD_6', "value": 'PRESS', "repeat": True},
{"properties": [("type", 'ORBITRIGHT')]}),
("view3d.view_axis", {"type": 'NUMPAD_7', "value": 'PRESS'},
{"properties": [("type", 'TOP')]}),
- ("view3d.view_orbit", {"type": 'NUMPAD_8', "value": 'PRESS'},
+ ("view3d.view_orbit", {"type": 'NUMPAD_8', "value": 'PRESS', "repeat": True},
{"properties": [("type", 'ORBITUP')]}),
("view3d.view_axis", {"type": 'NUMPAD_1', "value": 'PRESS', "ctrl": True},
{"properties": [("type", 'BACK')]}),
@@ -1089,17 +1093,17 @@ def km_view3d(params):
{"properties": [("type", 'LEFT')]}),
("view3d.view_axis", {"type": 'NUMPAD_7', "value": 'PRESS', "ctrl": True},
{"properties": [("type", 'BOTTOM')]}),
- ("view3d.view_pan", {"type": 'NUMPAD_2', "value": 'PRESS', "ctrl": True},
+ ("view3d.view_pan", {"type": 'NUMPAD_2', "value": 'PRESS', "ctrl": True, "repeat": True},
{"properties": [("type", 'PANDOWN')]}),
- ("view3d.view_pan", {"type": 'NUMPAD_4', "value": 'PRESS', "ctrl": True},
+ ("view3d.view_pan", {"type": 'NUMPAD_4', "value": 'PRESS', "ctrl": True, "repeat": True},
{"properties": [("type", 'PANLEFT')]}),
- ("view3d.view_pan", {"type": 'NUMPAD_6', "value": 'PRESS', "ctrl": True},
+ ("view3d.view_pan", {"type": 'NUMPAD_6', "value": 'PRESS', "ctrl": True, "repeat": True},
{"properties": [("type", 'PANRIGHT')]}),
- ("view3d.view_pan", {"type": 'NUMPAD_8', "value": 'PRESS', "ctrl": True},
+ ("view3d.view_pan", {"type": 'NUMPAD_8', "value": 'PRESS', "ctrl": True, "repeat": True},
{"properties": [("type", 'PANUP')]}),
- ("view3d.view_roll", {"type": 'NUMPAD_4', "value": 'PRESS', "shift": True},
+ ("view3d.view_roll", {"type": 'NUMPAD_4', "value": 'PRESS', "shift": True, "repeat": True},
{"properties": [("type", 'LEFT')]}),
- ("view3d.view_roll", {"type": 'NUMPAD_6', "value": 'PRESS', "shift": True},
+ ("view3d.view_roll", {"type": 'NUMPAD_6', "value": 'PRESS', "shift": True, "repeat": True},
{"properties": [("type", 'RIGHT')]}),
("view3d.view_orbit", {"type": 'NUMPAD_9', "value": 'PRESS'},
{"properties": [("angle", 3.1415927), ("type", 'ORBITRIGHT')]}),
@@ -1201,19 +1205,19 @@ def km_view3d(params):
("view3d.copybuffer", {"type": 'C', "value": 'PRESS', "ctrl": True}, None),
("view3d.pastebuffer", {"type": 'V', "value": 'PRESS', "ctrl": True}, None),
# Transform.
- ("transform.translate", {"type": 'G', "value": 'PRESS', "repeat": False}, None),
+ ("transform.translate", {"type": 'G', "value": 'PRESS'}, None),
("transform.translate", {"type": params.select_tweak, "value": 'ANY'}, None),
- ("transform.rotate", {"type": 'R', "value": 'PRESS', "repeat": False}, None),
- ("transform.resize", {"type": 'S', "value": 'PRESS', "repeat": False}, None),
- ("transform.bend", {"type": 'W', "value": 'PRESS', "shift": True, "repeat": False}, None),
- ("transform.tosphere", {"type": 'S', "value": 'PRESS', "shift": True, "alt": True, "repeat": False}, None),
- ("transform.shear", {"type": 'S', "value": 'PRESS', "shift": True, "ctrl": True, "alt": True, "repeat": False}, None),
- ("transform.mirror", {"type": 'M', "value": 'PRESS', "ctrl": True, "repeat": False}, None),
+ ("transform.rotate", {"type": 'R', "value": 'PRESS'}, None),
+ ("transform.resize", {"type": 'S', "value": 'PRESS'}, None),
+ ("transform.bend", {"type": 'W', "value": 'PRESS', "shift": True}, None),
+ ("transform.tosphere", {"type": 'S', "value": 'PRESS', "shift": True, "alt": True}, None),
+ ("transform.shear", {"type": 'S', "value": 'PRESS', "shift": True, "ctrl": True, "alt": True}, None),
+ ("transform.mirror", {"type": 'M', "value": 'PRESS', "ctrl": True}, None),
("wm.context_toggle", {"type": 'TAB', "value": 'PRESS', "shift": True},
{"properties": [("data_path", 'tool_settings.use_snap')]}),
op_panel("VIEW3D_PT_snapping", {"type": 'TAB', "value": 'PRESS', "shift": True, "ctrl": True}, [("keep_open", False)]),
("object.transform_axis_target", {"type": 'T', "value": 'PRESS', "shift": True}, None),
- ("transform.skin_resize", {"type": 'A', "value": 'PRESS', "ctrl": True, "repeat": False}, None),
+ ("transform.skin_resize", {"type": 'A', "value": 'PRESS', "ctrl": True}, None),
])
if not params.legacy:
@@ -1267,11 +1271,11 @@ def km_view3d(params):
{"properties": [("type", 'LEFT')]}),
("view3d.view_roll", {"type": 'WHEELDOWNMOUSE', "value": 'PRESS', "shift": True, "ctrl": True},
{"properties": [("type", 'RIGHT')]}),
- ("transform.create_orientation", {"type": 'SPACE', "value": 'PRESS', "ctrl": True, "alt": True, "repeat": False},
+ ("transform.create_orientation", {"type": 'SPACE', "value": 'PRESS', "ctrl": True, "alt": True},
{"properties": [("use", True)]}),
- ("transform.translate", {"type": 'T', "value": 'PRESS', "shift": True, "repeat": False},
+ ("transform.translate", {"type": 'T', "value": 'PRESS', "shift": True},
{"properties": [("texture_space", True)]}),
- ("transform.resize", {"type": 'T', "value": 'PRESS', "shift": True, "alt": True, "repeat": False},
+ ("transform.resize", {"type": 'T', "value": 'PRESS', "shift": True, "alt": True},
{"properties": [("texture_space", True)]}),
# Old pivot.
("wm.context_set_enum", {"type": 'COMMA', "value": 'PRESS'},
@@ -1280,7 +1284,7 @@ def km_view3d(params):
{"properties": [("data_path", 'tool_settings.transform_pivot_point'), ("value", 'MEDIAN_POINT')]}),
("wm.context_toggle", {"type": 'COMMA', "value": 'PRESS', "alt": True},
{"properties": [("data_path", 'tool_settings.use_transform_pivot_point_align')]}),
- ("wm.context_toggle", {"type": 'SPACE', "value": 'PRESS', "ctrl": True, "repeat": False},
+ ("wm.context_toggle", {"type": 'SPACE', "value": 'PRESS', "ctrl": True},
{"properties": [("data_path", 'space_data.show_gizmo_context')]}),
("wm.context_set_enum", {"type": 'PERIOD', "value": 'PRESS'},
{"properties": [("data_path", 'tool_settings.transform_pivot_point'), ("value", 'CURSOR')]}),
@@ -1350,8 +1354,8 @@ def km_mask_editing(params):
{"properties": [("mode", 'ADD')]}),
("mask.select_lasso", {"type": params.action_tweak, "value": 'ANY', "shift": True, "ctrl": True, "alt": True},
{"properties": [("mode", 'SUB')]}),
- ("mask.select_more", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True}, None),
- ("mask.select_less", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True}, None),
+ ("mask.select_more", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True, "repeat": True}, None),
+ ("mask.select_less", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True, "repeat": True}, None),
("mask.hide_view_clear", {"type": 'H', "value": 'PRESS', "alt": True}, None),
("mask.hide_view_set", {"type": 'H', "value": 'PRESS'},
{"properties": [("unselected", False)]}),
@@ -1371,13 +1375,13 @@ def km_mask_editing(params):
("mask.duplicate_move", {"type": 'D', "value": 'PRESS', "shift": True}, None),
("mask.copy_splines", {"type": 'C', "value": 'PRESS', "ctrl": True}, None),
("mask.paste_splines", {"type": 'V', "value": 'PRESS', "ctrl": True}, None),
- ("transform.translate", {"type": 'G', "value": 'PRESS', "repeat": False}, None),
+ ("transform.translate", {"type": 'G', "value": 'PRESS'}, None),
("transform.translate", {"type": params.select_tweak, "value": 'ANY'}, None),
- ("transform.rotate", {"type": 'R', "value": 'PRESS', "repeat": False}, None),
- ("transform.resize", {"type": 'S', "value": 'PRESS', "repeat": False}, None),
- ("transform.tosphere", {"type": 'S', "value": 'PRESS', "shift": True, "alt": True, "repeat": False}, None),
- ("transform.shear", {"type": 'S', "value": 'PRESS', "shift": True, "ctrl": True, "alt": True, "repeat": False}, None),
- ("transform.transform", {"type": 'S', "value": 'PRESS', "alt": True, "repeat": False},
+ ("transform.rotate", {"type": 'R', "value": 'PRESS'}, None),
+ ("transform.resize", {"type": 'S', "value": 'PRESS'}, None),
+ ("transform.tosphere", {"type": 'S', "value": 'PRESS', "shift": True, "alt": True}, None),
+ ("transform.shear", {"type": 'S', "value": 'PRESS', "shift": True, "ctrl": True, "alt": True}, None),
+ ("transform.transform", {"type": 'S', "value": 'PRESS', "alt": True},
{"properties": [("mode", 'MASK_SHRINKFATTEN')]}),
])
@@ -1544,8 +1548,8 @@ def km_graph_editor(params):
{"properties": [("mode", 'MARKERS_COLUMN')]}),
("graph.select_column", {"type": 'K', "value": 'PRESS', "alt": True},
{"properties": [("mode", 'MARKERS_BETWEEN')]}),
- ("graph.select_more", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True}, None),
- ("graph.select_less", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True}, None),
+ ("graph.select_more", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True, "repeat": True}, None),
+ ("graph.select_less", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True, "repeat": True}, None),
("graph.select_linked", {"type": 'L', "value": 'PRESS'}, None),
("graph.frame_jump", {"type": 'G', "value": 'PRESS', "ctrl": True}, None),
op_menu_pie("GRAPH_MT_snap_pie", {"type": 'S', "value": 'PRESS', "shift": True}),
@@ -1576,12 +1580,12 @@ def km_graph_editor(params):
("graph.fmodifier_add", {"type": 'M', "value": 'PRESS', "shift": True, "ctrl": True},
{"properties": [("only_active", False)]}),
("anim.channels_editable_toggle", {"type": 'TAB', "value": 'PRESS'}, None),
- ("transform.translate", {"type": 'G', "value": 'PRESS', "repeat": False}, None),
+ ("transform.translate", {"type": 'G', "value": 'PRESS'}, None),
("transform.translate", {"type": params.select_tweak, "value": 'ANY'}, None),
- ("transform.transform", {"type": 'E', "value": 'PRESS', "repeat": False},
+ ("transform.transform", {"type": 'E', "value": 'PRESS'},
{"properties": [("mode", 'TIME_EXTEND')]}),
- ("transform.rotate", {"type": 'R', "value": 'PRESS', "repeat": False}, None),
- ("transform.resize", {"type": 'S', "value": 'PRESS', "repeat": False}, None),
+ ("transform.rotate", {"type": 'R', "value": 'PRESS'}, None),
+ ("transform.resize", {"type": 'S', "value": 'PRESS'}, None),
("wm.context_toggle", {"type": 'O', "value": 'PRESS'},
{"properties": [("data_path", 'tool_settings.use_proportional_fcurve')]}),
op_menu_pie("VIEW3D_MT_proportional_editing_falloff_pie", {"type": 'O', "value": 'PRESS', "shift": True}),
@@ -1622,8 +1626,8 @@ def km_image_generic(_params):
("image.read_viewlayers", {"type": 'R', "value": 'PRESS', "ctrl": True}, None),
("image.save", {"type": 'S', "value": 'PRESS', "alt": True}, None),
("image.save_as", {"type": 'S', "value": 'PRESS', "shift": True, "alt": True}, None),
- ("image.cycle_render_slot", {"type": 'J', "value": 'PRESS'}, None),
- ("image.cycle_render_slot", {"type": 'J', "value": 'PRESS', "alt": True},
+ ("image.cycle_render_slot", {"type": 'J', "value": 'PRESS', "repeat": True}, None),
+ ("image.cycle_render_slot", {"type": 'J', "value": 'PRESS', "alt": True, "repeat": True},
{"properties": [("reverse", True)]}),
])
@@ -1650,8 +1654,8 @@ def km_image(params):
("image.view_ndof", {"type": 'NDOF_MOTION', "value": 'ANY'}, None),
("image.view_zoom_in", {"type": 'WHEELINMOUSE', "value": 'PRESS'}, None),
("image.view_zoom_out", {"type": 'WHEELOUTMOUSE', "value": 'PRESS'}, None),
- ("image.view_zoom_in", {"type": 'NUMPAD_PLUS', "value": 'PRESS'}, None),
- ("image.view_zoom_out", {"type": 'NUMPAD_MINUS', "value": 'PRESS'}, None),
+ ("image.view_zoom_in", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "repeat": True}, None),
+ ("image.view_zoom_out", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "repeat": True}, None),
("image.view_zoom", {"type": 'MIDDLEMOUSE', "value": 'PRESS', "ctrl": True}, None),
("image.view_zoom", {"type": 'TRACKPADZOOM', "value": 'ANY'}, None),
("image.view_zoom", {"type": 'TRACKPADPAN', "value": 'ANY', "ctrl": True}, None),
@@ -1775,9 +1779,9 @@ def km_node_editor(params):
("node.links_cut", {"type": 'EVT_TWEAK_R', "value": 'ANY', "ctrl": True}, None),
("node.select_link_viewer", {"type": 'LEFTMOUSE', "value": 'PRESS', "shift": True, "ctrl": True}, None),
("node.backimage_move", {"type": 'MIDDLEMOUSE', "value": 'PRESS', "alt": True}, None),
- ("node.backimage_zoom", {"type": 'V', "value": 'PRESS'},
+ ("node.backimage_zoom", {"type": 'V', "value": 'PRESS', "repeat": True},
{"properties": [("factor", 1.0 / 1.2)]}),
- ("node.backimage_zoom", {"type": 'V', "value": 'PRESS', "alt": True},
+ ("node.backimage_zoom", {"type": 'V', "value": 'PRESS', "alt": True, "repeat": True},
{"properties": [("factor", 1.2)]}),
("node.backimage_fit", {"type": 'HOME', "value": 'PRESS', "alt": True}, None),
("node.backimage_sample", {"type": params.action_mouse, "value": 'PRESS', "alt": True}, None),
@@ -1832,13 +1836,13 @@ def km_node_editor(params):
("node.translate_attach", {"type": 'G', "value": 'PRESS'}, None),
("node.translate_attach", {"type": 'EVT_TWEAK_L', "value": 'ANY'}, None),
("node.translate_attach", {"type": params.select_tweak, "value": 'ANY'}, None),
- ("transform.translate", {"type": 'G', "value": 'PRESS', "repeat": False}, None),
+ ("transform.translate", {"type": 'G', "value": 'PRESS'}, None),
("transform.translate", {"type": 'EVT_TWEAK_L', "value": 'ANY'},
{"properties": [("release_confirm", True)]}),
("transform.translate", {"type": params.select_tweak, "value": 'ANY'},
{"properties": [("release_confirm", True)]}),
- ("transform.rotate", {"type": 'R', "value": 'PRESS', "repeat": False}, None),
- ("transform.resize", {"type": 'S', "value": 'PRESS', "repeat": False}, None),
+ ("transform.rotate", {"type": 'R', "value": 'PRESS'}, None),
+ ("transform.resize", {"type": 'S', "value": 'PRESS'}, None),
("node.move_detach_links", {"type": 'D', "value": 'PRESS', "alt": True}, None),
("node.move_detach_links_release", {"type": params.action_tweak, "value": 'ANY', "alt": True}, None),
("node.move_detach_links", {"type": params.select_tweak, "value": 'ANY', "alt": True}, None),
@@ -1909,17 +1913,17 @@ def km_file_browser(params):
("file.smoothscroll", {"type": 'TIMER1', "value": 'ANY', "any": True}, None),
("file.bookmark_add", {"type": 'B', "value": 'PRESS', "ctrl": True}, None),
("file.start_filter", {"type": 'F', "value": 'PRESS', "ctrl": True}, None),
- ("file.filenum", {"type": 'NUMPAD_PLUS', "value": 'PRESS'},
+ ("file.filenum", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "repeat": True},
{"properties": [("increment", 1)]}),
- ("file.filenum", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "shift": True},
+ ("file.filenum", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "shift": True, "repeat": True},
{"properties": [("increment", 10)]}),
- ("file.filenum", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True},
+ ("file.filenum", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True, "repeat": True},
{"properties": [("increment", 100)]}),
- ("file.filenum", {"type": 'NUMPAD_MINUS', "value": 'PRESS'},
+ ("file.filenum", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "repeat": True},
{"properties": [("increment", -1)]}),
- ("file.filenum", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "shift": True},
+ ("file.filenum", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "shift": True, "repeat": True},
{"properties": [("increment", -10)]}),
- ("file.filenum", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True},
+ ("file.filenum", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True, "repeat": True},
{"properties": [("increment", -100)]}),
*_template_items_context_menu("FILEBROWSER_MT_context_menu", params.context_menu_event),
])
@@ -1951,29 +1955,29 @@ def km_file_browser_main(params):
{"properties": [("extend", True), ("open", False)]}),
("file.select", {"type": 'LEFTMOUSE', "value": 'CLICK', "shift": True},
{"properties": [("extend", True), ("fill", True), ("open", False)]}),
- ("file.select_walk", {"type": 'UP_ARROW', "value": 'PRESS'},
+ ("file.select_walk", {"type": 'UP_ARROW', "value": 'PRESS', "repeat": True},
{"properties": [("direction", 'UP')]}),
("file.select_walk", {"type": 'UP_ARROW', "value": 'PRESS', "shift": True},
{"properties": [("direction", 'UP'), ("extend", True)]}),
- ("file.select_walk", {"type": 'UP_ARROW', "value": 'PRESS', "shift": True, "ctrl": True},
+ ("file.select_walk", {"type": 'UP_ARROW', "value": 'PRESS', "shift": True, "ctrl": True, "repeat": True},
{"properties": [("direction", 'UP'), ("extend", True), ("fill", True)]}),
- ("file.select_walk", {"type": 'DOWN_ARROW', "value": 'PRESS'},
+ ("file.select_walk", {"type": 'DOWN_ARROW', "value": 'PRESS', "repeat": True},
{"properties": [("direction", 'DOWN')]}),
- ("file.select_walk", {"type": 'DOWN_ARROW', "value": 'PRESS', "shift": True},
+ ("file.select_walk", {"type": 'DOWN_ARROW', "value": 'PRESS', "shift": True, "repeat": True},
{"properties": [("direction", 'DOWN'), ("extend", True)]}),
- ("file.select_walk", {"type": 'DOWN_ARROW', "value": 'PRESS', "shift": True, "ctrl": True},
+ ("file.select_walk", {"type": 'DOWN_ARROW', "value": 'PRESS', "shift": True, "ctrl": True, "repeat": True},
{"properties": [("direction", 'DOWN'), ("extend", True), ("fill", True)]}),
- ("file.select_walk", {"type": 'LEFT_ARROW', "value": 'PRESS'},
+ ("file.select_walk", {"type": 'LEFT_ARROW', "value": 'PRESS', "repeat": True},
{"properties": [("direction", 'LEFT')]}),
- ("file.select_walk", {"type": 'LEFT_ARROW', "value": 'PRESS', "shift": True},
+ ("file.select_walk", {"type": 'LEFT_ARROW', "value": 'PRESS', "shift": True, "repeat": True},
{"properties": [("direction", 'LEFT'), ("extend", True)]}),
- ("file.select_walk", {"type": 'LEFT_ARROW', "value": 'PRESS', "shift": True, "ctrl": True},
+ ("file.select_walk", {"type": 'LEFT_ARROW', "value": 'PRESS', "shift": True, "ctrl": True, "repeat": True},
{"properties": [("direction", 'LEFT'), ("extend", True), ("fill", True)]}),
- ("file.select_walk", {"type": 'RIGHT_ARROW', "value": 'PRESS'},
+ ("file.select_walk", {"type": 'RIGHT_ARROW', "value": 'PRESS', "repeat": True},
{"properties": [("direction", 'RIGHT')]}),
- ("file.select_walk", {"type": 'RIGHT_ARROW', "value": 'PRESS', "shift": True},
+ ("file.select_walk", {"type": 'RIGHT_ARROW', "value": 'PRESS', "shift": True, "repeat": True},
{"properties": [("direction", 'RIGHT'), ("extend", True)]}),
- ("file.select_walk", {"type": 'RIGHT_ARROW', "value": 'PRESS', "shift": True, "ctrl": True},
+ ("file.select_walk", {"type": 'RIGHT_ARROW', "value": 'PRESS', "shift": True, "ctrl": True, "repeat": True},
{"properties": [("direction", 'RIGHT'), ("extend", True), ("fill", True)]}),
("file.previous", {"type": 'BUTTON4MOUSE', "value": 'CLICK'}, None),
("file.next", {"type": 'BUTTON5MOUSE', "value": 'CLICK'}, None),
@@ -2000,17 +2004,17 @@ def km_file_browser_buttons(_params):
)
items.extend([
- ("file.filenum", {"type": 'NUMPAD_PLUS', "value": 'PRESS'},
+ ("file.filenum", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "repeat": True},
{"properties": [("increment", 1)]}),
- ("file.filenum", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "shift": True},
+ ("file.filenum", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "shift": True, "repeat": True},
{"properties": [("increment", 10)]}),
- ("file.filenum", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True},
+ ("file.filenum", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True, "repeat": True},
{"properties": [("increment", 100)]}),
- ("file.filenum", {"type": 'NUMPAD_MINUS', "value": 'PRESS'},
+ ("file.filenum", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "repeat": True},
{"properties": [("increment", -1)]}),
- ("file.filenum", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "shift": True},
+ ("file.filenum", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "shift": True, "repeat": True},
{"properties": [("increment", -10)]}),
- ("file.filenum", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True},
+ ("file.filenum", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True, "repeat": True},
{"properties": [("increment", -100)]}),
])
@@ -2094,8 +2098,8 @@ def km_dopesheet(params):
{"properties": [("mode", 'MARKERS_COLUMN')]}),
("action.select_column", {"type": 'K', "value": 'PRESS', "alt": True},
{"properties": [("mode", 'MARKERS_BETWEEN')]}),
- ("action.select_more", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True}, None),
- ("action.select_less", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True}, None),
+ ("action.select_more", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True, "repeat": True}, None),
+ ("action.select_less", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True, "repeat": True}, None),
("action.select_linked", {"type": 'L', "value": 'PRESS'}, None),
("action.frame_jump", {"type": 'G', "value": 'PRESS', "ctrl": True}, None),
op_menu_pie("DOPESHEET_MT_snap_pie", {"type": 'S', "value": 'PRESS', "shift": True}),
@@ -2121,15 +2125,15 @@ def km_dopesheet(params):
("action.view_frame", {"type": 'NUMPAD_0', "value": 'PRESS'}, None),
("anim.channels_editable_toggle", {"type": 'TAB', "value": 'PRESS'}, None),
("anim.channels_find", {"type": 'F', "value": 'PRESS', "ctrl": True}, None),
- ("transform.transform", {"type": 'G', "value": 'PRESS', "repeat": False},
+ ("transform.transform", {"type": 'G', "value": 'PRESS'},
{"properties": [("mode", 'TIME_TRANSLATE')]}),
("transform.transform", {"type": params.select_tweak, "value": 'ANY'},
{"properties": [("mode", 'TIME_TRANSLATE')]}),
- ("transform.transform", {"type": 'E', "value": 'PRESS', "repeat": False},
+ ("transform.transform", {"type": 'E', "value": 'PRESS'},
{"properties": [("mode", 'TIME_EXTEND')]}),
- ("transform.transform", {"type": 'S', "value": 'PRESS', "repeat": False},
+ ("transform.transform", {"type": 'S', "value": 'PRESS'},
{"properties": [("mode", 'TIME_SCALE')]}),
- ("transform.transform", {"type": 'T', "value": 'PRESS', "shift": True, "repeat": False},
+ ("transform.transform", {"type": 'T', "value": 'PRESS', "shift": True},
{"properties": [("mode", 'TIME_SLIDE')]}),
("wm.context_toggle", {"type": 'O', "value": 'PRESS'},
{"properties": [("data_path", 'tool_settings.use_proportional_action')]}),
@@ -2247,19 +2251,19 @@ def km_nla_editor(params):
("nla.split", {"type": 'Y', "value": 'PRESS'}, None),
("nla.mute_toggle", {"type": 'H', "value": 'PRESS'}, None),
("nla.swap", {"type": 'F', "value": 'PRESS', "alt": True}, None),
- ("nla.move_up", {"type": 'PAGE_UP', "value": 'PRESS'}, None),
- ("nla.move_down", {"type": 'PAGE_DOWN', "value": 'PRESS'}, None),
+ ("nla.move_up", {"type": 'PAGE_UP', "value": 'PRESS', "repeat": True}, None),
+ ("nla.move_down", {"type": 'PAGE_DOWN', "value": 'PRESS', "repeat": True}, None),
("nla.apply_scale", {"type": 'A', "value": 'PRESS', "ctrl": True}, None),
("nla.clear_scale", {"type": 'S', "value": 'PRESS', "alt": True}, None),
op_menu_pie("NLA_MT_snap_pie", {"type": 'S', "value": 'PRESS', "shift": True}),
("nla.fmodifier_add", {"type": 'M', "value": 'PRESS', "shift": True, "ctrl": True}, None),
- ("transform.transform", {"type": 'G', "value": 'PRESS', "repeat": False},
+ ("transform.transform", {"type": 'G', "value": 'PRESS'},
{"properties": [("mode", 'TRANSLATION')]}),
("transform.transform", {"type": params.select_tweak, "value": 'ANY'},
{"properties": [("mode", 'TRANSLATION')]}),
- ("transform.transform", {"type": 'E', "value": 'PRESS', "repeat": False},
+ ("transform.transform", {"type": 'E', "value": 'PRESS'},
{"properties": [("mode", 'TIME_EXTEND')]}),
- ("transform.transform", {"type": 'S', "value": 'PRESS', "repeat": False},
+ ("transform.transform", {"type": 'S', "value": 'PRESS'},
{"properties": [("mode", 'TIME_SCALE')]}),
("marker.add", {"type": 'M', "value": 'PRESS'}, None),
("marker.rename", {"type": 'M', "value": 'PRESS', "ctrl": True}, None),
@@ -2304,9 +2308,9 @@ def km_text(params):
{"properties": [("data_path", 'space_data.font_size'), ("reverse", False)]}),
("wm.context_cycle_int", {"type": 'WHEELDOWNMOUSE', "value": 'PRESS', "ctrl": True},
{"properties": [("data_path", 'space_data.font_size'), ("reverse", True)]}),
- ("wm.context_cycle_int", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True},
+ ("wm.context_cycle_int", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True, "repeat": True},
{"properties": [("data_path", 'space_data.font_size'), ("reverse", False)]}),
- ("wm.context_cycle_int", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True},
+ ("wm.context_cycle_int", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True, "repeat": True},
{"properties": [("data_path", 'space_data.font_size'), ("reverse", True)]}),
])
@@ -2318,9 +2322,9 @@ def km_text(params):
items.extend([
("text.new", {"type": 'N', "value": 'PRESS', "ctrl": True}, None),
- ("text.move", {"type": 'LEFT_ARROW', "value": 'PRESS', "alt": True},
+ ("text.move", {"type": 'LEFT_ARROW', "value": 'PRESS', "alt": True, "repeat": True},
{"properties": [("type", 'PREVIOUS_WORD')]}),
- ("text.move", {"type": 'RIGHT_ARROW', "value": 'PRESS', "alt": True},
+ ("text.move", {"type": 'RIGHT_ARROW', "value": 'PRESS', "alt": True, "repeat": True},
{"properties": [("type", 'NEXT_WORD')]}),
])
@@ -2336,16 +2340,16 @@ def km_text(params):
("text.cut", {"type": 'DEL', "value": 'PRESS', "shift": True}, None),
("text.copy", {"type": 'INSERT', "value": 'PRESS', "ctrl": True}, None),
("text.paste", {"type": 'INSERT', "value": 'PRESS', "shift": True}, None),
- ("text.duplicate_line", {"type": 'D', "value": 'PRESS', "ctrl": True}, None),
+ ("text.duplicate_line", {"type": 'D', "value": 'PRESS', "ctrl": True, "repeat": True}, None),
("text.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True}, None),
("text.select_line", {"type": 'A', "value": 'PRESS', "shift": True, "ctrl": True}, None),
("text.select_word", {"type": 'LEFTMOUSE', "value": 'DOUBLE_CLICK'}, None),
- ("text.move_lines", {"type": 'UP_ARROW', "value": 'PRESS', "shift": True, "ctrl": True},
+ ("text.move_lines", {"type": 'UP_ARROW', "value": 'PRESS', "shift": True, "ctrl": True, "repeat": True},
{"properties": [("direction", 'UP')]}),
- ("text.move_lines", {"type": 'DOWN_ARROW', "value": 'PRESS', "shift": True, "ctrl": True},
+ ("text.move_lines", {"type": 'DOWN_ARROW', "value": 'PRESS', "shift": True, "ctrl": True, "repeat": True},
{"properties": [("direction", 'DOWN')]}),
- ("text.indent_or_autocomplete", {"type": 'TAB', "value": 'PRESS'}, None),
- ("text.unindent", {"type": 'TAB', "value": 'PRESS', "shift": True}, None),
+ ("text.indent_or_autocomplete", {"type": 'TAB', "value": 'PRESS', "repeat": True}, None),
+ ("text.unindent", {"type": 'TAB', "value": 'PRESS', "shift": True, "repeat": True}, None),
("text.comment_toggle", {"type": 'SLASH', "value": 'PRESS', "ctrl": True}, None),
("text.move", {"type": 'HOME', "value": 'PRESS'},
{"properties": [("type", 'LINE_BEGIN')]}),
@@ -2355,21 +2359,21 @@ def km_text(params):
{"properties": [("type", 'LINE_END')]}),
("text.move", {"type": 'E', "value": 'PRESS', "shift": True, "ctrl": True},
{"properties": [("type", 'LINE_END')]}),
- ("text.move", {"type": 'LEFT_ARROW', "value": 'PRESS'},
+ ("text.move", {"type": 'LEFT_ARROW', "value": 'PRESS', "repeat": True},
{"properties": [("type", 'PREVIOUS_CHARACTER')]}),
- ("text.move", {"type": 'RIGHT_ARROW', "value": 'PRESS'},
+ ("text.move", {"type": 'RIGHT_ARROW', "value": 'PRESS', "repeat": True},
{"properties": [("type", 'NEXT_CHARACTER')]}),
- ("text.move", {"type": 'LEFT_ARROW', "value": 'PRESS', "ctrl": True},
+ ("text.move", {"type": 'LEFT_ARROW', "value": 'PRESS', "ctrl": True, "repeat": True},
{"properties": [("type", 'PREVIOUS_WORD')]}),
- ("text.move", {"type": 'RIGHT_ARROW', "value": 'PRESS', "ctrl": True},
+ ("text.move", {"type": 'RIGHT_ARROW', "value": 'PRESS', "ctrl": True, "repeat": True},
{"properties": [("type", 'NEXT_WORD')]}),
- ("text.move", {"type": 'UP_ARROW', "value": 'PRESS'},
+ ("text.move", {"type": 'UP_ARROW', "value": 'PRESS', "repeat": True},
{"properties": [("type", 'PREVIOUS_LINE')]}),
- ("text.move", {"type": 'DOWN_ARROW', "value": 'PRESS'},
+ ("text.move", {"type": 'DOWN_ARROW', "value": 'PRESS', "repeat": True},
{"properties": [("type", 'NEXT_LINE')]}),
- ("text.move", {"type": 'PAGE_UP', "value": 'PRESS'},
+ ("text.move", {"type": 'PAGE_UP', "value": 'PRESS', "repeat": True},
{"properties": [("type", 'PREVIOUS_PAGE')]}),
- ("text.move", {"type": 'PAGE_DOWN', "value": 'PRESS'},
+ ("text.move", {"type": 'PAGE_DOWN', "value": 'PRESS', "repeat": True},
{"properties": [("type", 'NEXT_PAGE')]}),
("text.move", {"type": 'HOME', "value": 'PRESS', "ctrl": True},
{"properties": [("type", 'FILE_TOP')]}),
@@ -2379,33 +2383,33 @@ def km_text(params):
{"properties": [("type", 'LINE_BEGIN')]}),
("text.move_select", {"type": 'END', "value": 'PRESS', "shift": True},
{"properties": [("type", 'LINE_END')]}),
- ("text.move_select", {"type": 'LEFT_ARROW', "value": 'PRESS', "shift": True},
+ ("text.move_select", {"type": 'LEFT_ARROW', "value": 'PRESS', "shift": True, "repeat": True},
{"properties": [("type", 'PREVIOUS_CHARACTER')]}),
- ("text.move_select", {"type": 'RIGHT_ARROW', "value": 'PRESS', "shift": True},
+ ("text.move_select", {"type": 'RIGHT_ARROW', "value": 'PRESS', "shift": True, "repeat": True},
{"properties": [("type", 'NEXT_CHARACTER')]}),
- ("text.move_select", {"type": 'LEFT_ARROW', "value": 'PRESS', "shift": True, "ctrl": True},
+ ("text.move_select", {"type": 'LEFT_ARROW', "value": 'PRESS', "shift": True, "ctrl": True, "repeat": True},
{"properties": [("type", 'PREVIOUS_WORD')]}),
- ("text.move_select", {"type": 'RIGHT_ARROW', "value": 'PRESS', "shift": True, "ctrl": True},
+ ("text.move_select", {"type": 'RIGHT_ARROW', "value": 'PRESS', "shift": True, "ctrl": True, "repeat": True},
{"properties": [("type", 'NEXT_WORD')]}),
- ("text.move_select", {"type": 'UP_ARROW', "value": 'PRESS', "shift": True},
+ ("text.move_select", {"type": 'UP_ARROW', "value": 'PRESS', "shift": True, "repeat": True},
{"properties": [("type", 'PREVIOUS_LINE')]}),
- ("text.move_select", {"type": 'DOWN_ARROW', "value": 'PRESS', "shift": True},
+ ("text.move_select", {"type": 'DOWN_ARROW', "value": 'PRESS', "shift": True, "repeat": True},
{"properties": [("type", 'NEXT_LINE')]}),
- ("text.move_select", {"type": 'PAGE_UP', "value": 'PRESS', "shift": True},
+ ("text.move_select", {"type": 'PAGE_UP', "value": 'PRESS', "shift": True, "repeat": True},
{"properties": [("type", 'PREVIOUS_PAGE')]}),
- ("text.move_select", {"type": 'PAGE_DOWN', "value": 'PRESS', "shift": True},
+ ("text.move_select", {"type": 'PAGE_DOWN', "value": 'PRESS', "shift": True, "repeat": True},
{"properties": [("type", 'NEXT_PAGE')]}),
("text.move_select", {"type": 'HOME', "value": 'PRESS', "shift": True, "ctrl": True},
{"properties": [("type", 'FILE_TOP')]}),
("text.move_select", {"type": 'END', "value": 'PRESS', "shift": True, "ctrl": True},
{"properties": [("type", 'FILE_BOTTOM')]}),
- ("text.delete", {"type": 'DEL', "value": 'PRESS'},
+ ("text.delete", {"type": 'DEL', "value": 'PRESS', "repeat": True},
{"properties": [("type", 'NEXT_CHARACTER')]}),
- ("text.delete", {"type": 'BACK_SPACE', "value": 'PRESS'},
+ ("text.delete", {"type": 'BACK_SPACE', "value": 'PRESS', "repeat": True},
{"properties": [("type", 'PREVIOUS_CHARACTER')]}),
- ("text.delete", {"type": 'BACK_SPACE', "value": 'PRESS', "shift": True},
+ ("text.delete", {"type": 'BACK_SPACE', "value": 'PRESS', "shift": True, "repeat": True},
{"properties": [("type", 'PREVIOUS_CHARACTER')]}),
- ("text.delete", {"type": 'DEL', "value": 'PRESS', "ctrl": True},
+ ("text.delete", {"type": 'DEL', "value": 'PRESS', "ctrl": True, "repeat": True},
{"properties": [("type", 'NEXT_WORD')]}),
("text.delete", {"type": 'BACK_SPACE', "value": 'PRESS', "ctrl": True},
{"properties": [("type", 'PREVIOUS_WORD')]}),
@@ -2421,11 +2425,11 @@ def km_text(params):
{"properties": [("lines", -1)]}),
("text.scroll", {"type": 'WHEELDOWNMOUSE', "value": 'PRESS'},
{"properties": [("lines", 1)]}),
- ("text.line_break", {"type": 'RET', "value": 'PRESS'}, None),
- ("text.line_break", {"type": 'NUMPAD_ENTER', "value": 'PRESS'}, None),
- ("text.line_number", {"type": 'TEXTINPUT', "value": 'ANY', "any": True}, None),
+ ("text.line_break", {"type": 'RET', "value": 'PRESS', "repeat": True}, None),
+ ("text.line_break", {"type": 'NUMPAD_ENTER', "value": 'PRESS', "repeat": True}, None),
+ ("text.line_number", {"type": 'TEXTINPUT', "value": 'ANY', "any": True, "repeat": True}, None),
op_menu("TEXT_MT_context_menu", {"type": 'RIGHTMOUSE', "value": 'PRESS'}),
- ("text.insert", {"type": 'TEXTINPUT', "value": 'ANY', "any": True}, None),
+ ("text.insert", {"type": 'TEXTINPUT', "value": 'ANY', "any": True, "repeat": True}, None),
])
return keymap
@@ -2503,17 +2507,17 @@ def km_sequencer(params):
("sequencer.view_all", {"type": 'NDOF_BUTTON_FIT', "value": 'PRESS'}, None),
("sequencer.view_selected", {"type": 'NUMPAD_PERIOD', "value": 'PRESS'}, None),
("sequencer.view_frame", {"type": 'NUMPAD_0', "value": 'PRESS'}, None),
- ("sequencer.strip_jump", {"type": 'PAGE_UP', "value": 'PRESS'},
+ ("sequencer.strip_jump", {"type": 'PAGE_UP', "value": 'PRESS', "repeat": True},
{"properties": [("next", True), ("center", False)]}),
- ("sequencer.strip_jump", {"type": 'PAGE_DOWN', "value": 'PRESS'},
+ ("sequencer.strip_jump", {"type": 'PAGE_DOWN', "value": 'PRESS', "repeat": True},
{"properties": [("next", False), ("center", False)]}),
- ("sequencer.strip_jump", {"type": 'PAGE_UP', "value": 'PRESS', "alt": True},
+ ("sequencer.strip_jump", {"type": 'PAGE_UP', "value": 'PRESS', "alt": True, "repeat": True},
{"properties": [("next", True), ("center", True)]}),
- ("sequencer.strip_jump", {"type": 'PAGE_DOWN', "value": 'PRESS', "alt": True},
+ ("sequencer.strip_jump", {"type": 'PAGE_DOWN', "value": 'PRESS', "alt": True, "repeat": True},
{"properties": [("next", False), ("center", True)]}),
- ("sequencer.swap", {"type": 'LEFT_ARROW', "value": 'PRESS', "alt": True},
+ ("sequencer.swap", {"type": 'LEFT_ARROW', "value": 'PRESS', "alt": True, "repeat": True},
{"properties": [("side", 'LEFT')]}),
- ("sequencer.swap", {"type": 'RIGHT_ARROW', "value": 'PRESS', "alt": True},
+ ("sequencer.swap", {"type": 'RIGHT_ARROW', "value": 'PRESS', "alt": True, "repeat": True},
{"properties": [("side", 'RIGHT')]}),
("sequencer.gap_remove", {"type": 'BACK_SPACE', "value": 'PRESS'},
{"properties": [("all", False)]}),
@@ -2543,8 +2547,8 @@ def km_sequencer(params):
("sequencer.select",
{"type": params.select_mouse, "value": 'PRESS' if params.legacy else 'CLICK', "ctrl": True, "shift": True},
{"properties": [("side_of_frame", True), ("linked_time", True), ("extend", True)]}),
- ("sequencer.select_more", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True}, None),
- ("sequencer.select_less", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True}, None),
+ ("sequencer.select_more", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True, "repeat": True}, None),
+ ("sequencer.select_less", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True, "repeat": True}, None),
("sequencer.select_linked_pick", {"type": 'L', "value": 'PRESS'},
{"properties": [("extend", False)]}),
("sequencer.select_linked_pick", {"type": 'L', "value": 'PRESS', "shift": True},
@@ -2565,9 +2569,9 @@ def km_sequencer(params):
("sequencer.slip", {"type": 'S', "value": 'PRESS'}, None),
("wm.context_set_int", {"type": 'O', "value": 'PRESS'},
{"properties": [("data_path", 'scene.sequence_editor.overlay_frame'), ("value", 0)]}),
- ("transform.seq_slide", {"type": 'G', "value": 'PRESS', "repeat": False}, None),
+ ("transform.seq_slide", {"type": 'G', "value": 'PRESS'}, None),
("transform.seq_slide", {"type": params.select_tweak, "value": 'ANY'}, None),
- ("transform.transform", {"type": 'E', "value": 'PRESS', "repeat": False},
+ ("transform.transform", {"type": 'E', "value": 'PRESS'},
{"properties": [("mode", 'TIME_EXTEND')]}),
("marker.add", {"type": 'M', "value": 'PRESS'}, None),
("marker.rename", {"type": 'M', "value": 'PRESS', "ctrl": True}, None),
@@ -2623,9 +2627,9 @@ def km_console(_params):
)
items.extend([
- ("console.move", {"type": 'LEFT_ARROW', "value": 'PRESS', "ctrl": True},
+ ("console.move", {"type": 'LEFT_ARROW', "value": 'PRESS', "ctrl": True, "repeat": True},
{"properties": [("type", 'PREVIOUS_WORD')]}),
- ("console.move", {"type": 'RIGHT_ARROW', "value": 'PRESS', "ctrl": True},
+ ("console.move", {"type": 'RIGHT_ARROW', "value": 'PRESS', "ctrl": True, "repeat": True},
{"properties": [("type", 'NEXT_WORD')]}),
("console.move", {"type": 'HOME', "value": 'PRESS'},
{"properties": [("type", 'LINE_BEGIN')]}),
@@ -2635,27 +2639,27 @@ def km_console(_params):
{"properties": [("data_path", 'space_data.font_size'), ("reverse", False)]}),
("wm.context_cycle_int", {"type": 'WHEELDOWNMOUSE', "value": 'PRESS', "ctrl": True},
{"properties": [("data_path", 'space_data.font_size'), ("reverse", True)]}),
- ("wm.context_cycle_int", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True},
+ ("wm.context_cycle_int", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True, "repeat": True},
{"properties": [("data_path", 'space_data.font_size'), ("reverse", False)]}),
- ("wm.context_cycle_int", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True},
+ ("wm.context_cycle_int", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True, "repeat": True},
{"properties": [("data_path", 'space_data.font_size'), ("reverse", True)]}),
- ("console.move", {"type": 'LEFT_ARROW', "value": 'PRESS'},
+ ("console.move", {"type": 'LEFT_ARROW', "value": 'PRESS', "repeat": True},
{"properties": [("type", 'PREVIOUS_CHARACTER')]}),
- ("console.move", {"type": 'RIGHT_ARROW', "value": 'PRESS'},
+ ("console.move", {"type": 'RIGHT_ARROW', "value": 'PRESS', "repeat": True},
{"properties": [("type", 'NEXT_CHARACTER')]}),
- ("console.history_cycle", {"type": 'UP_ARROW', "value": 'PRESS'},
+ ("console.history_cycle", {"type": 'UP_ARROW', "value": 'PRESS', "repeat": True},
{"properties": [("reverse", True)]}),
- ("console.history_cycle", {"type": 'DOWN_ARROW', "value": 'PRESS'},
+ ("console.history_cycle", {"type": 'DOWN_ARROW', "value": 'PRESS', "repeat": True},
{"properties": [("reverse", False)]}),
- ("console.delete", {"type": 'DEL', "value": 'PRESS'},
+ ("console.delete", {"type": 'DEL', "value": 'PRESS', "repeat": True},
{"properties": [("type", 'NEXT_CHARACTER')]}),
- ("console.delete", {"type": 'BACK_SPACE', "value": 'PRESS'},
- {"properties": [("type", 'PREVIOUS_CHARACTER')]}),
- ("console.delete", {"type": 'BACK_SPACE', "value": 'PRESS', "shift": True},
+ ("console.delete", {"type": 'BACK_SPACE', "value": 'PRESS', "repeat": True},
{"properties": [("type", 'PREVIOUS_CHARACTER')]}),
- ("console.delete", {"type": 'DEL', "value": 'PRESS', "ctrl": True},
+ ("console.delete", {"type": 'BACK_SPACE', "value": 'PRESS', "shift": True, "repeat": True},
+ {"properties": [("type", 'PREVIOUS_CHARACTER')], "repeat": True}),
+ ("console.delete", {"type": 'DEL', "value": 'PRESS', "ctrl": True, "repeat": True},
{"properties": [("type", 'NEXT_WORD')]}),
- ("console.delete", {"type": 'BACK_SPACE', "value": 'PRESS', "ctrl": True},
+ ("console.delete", {"type": 'BACK_SPACE', "value": 'PRESS', "ctrl": True, "repeat": True},
{"properties": [("type", 'PREVIOUS_WORD')]}),
("console.clear_line", {"type": 'RET', "value": 'PRESS', "shift": True}, None),
("console.clear_line", {"type": 'NUMPAD_ENTER', "value": 'PRESS', "shift": True}, None),
@@ -2668,12 +2672,12 @@ def km_console(_params):
("console.paste", {"type": 'V', "value": 'PRESS', "ctrl": True}, None),
("console.select_set", {"type": 'LEFTMOUSE', "value": 'PRESS'}, None),
("console.select_word", {"type": 'LEFTMOUSE', "value": 'DOUBLE_CLICK'}, None),
- ("console.insert", {"type": 'TAB', "value": 'PRESS', "ctrl": True},
+ ("console.insert", {"type": 'TAB', "value": 'PRESS', "ctrl": True, "repeat": True},
{"properties": [("text", '\t')]}),
- ("console.indent_or_autocomplete", {"type": 'TAB', "value": 'PRESS'}, None),
- ("console.unindent", {"type": 'TAB', "value": 'PRESS', "shift": True}, None),
+ ("console.indent_or_autocomplete", {"type": 'TAB', "value": 'PRESS', "repeat": True}, None),
+ ("console.unindent", {"type": 'TAB', "value": 'PRESS', "shift": True, "repeat": True}, None),
*_template_items_context_menu("CONSOLE_MT_context_menu", {"type": 'RIGHTMOUSE', "value": 'PRESS'}),
- ("console.insert", {"type": 'TEXTINPUT', "value": 'ANY', "any": True}, None),
+ ("console.insert", {"type": 'TEXTINPUT', "value": 'ANY', "any": True, "repeat": True}, None),
])
return keymap
@@ -2693,9 +2697,9 @@ def km_clip(_params):
sidebar_key={"type": 'N', "value": 'PRESS'},
),
("clip.open", {"type": 'O', "value": 'PRESS', "alt": True}, None),
- ("clip.track_markers", {"type": 'LEFT_ARROW', "value": 'PRESS', "alt": True},
+ ("clip.track_markers", {"type": 'LEFT_ARROW', "value": 'PRESS', "alt": True, "repeat": True},
{"properties": [("backwards", True), ("sequence", False)]}),
- ("clip.track_markers", {"type": 'RIGHT_ARROW', "value": 'PRESS', "alt": True},
+ ("clip.track_markers", {"type": 'RIGHT_ARROW', "value": 'PRESS', "alt": True, "repeat": True},
{"properties": [("backwards", False), ("sequence", False)]}),
("clip.track_markers", {"type": 'T', "value": 'PRESS', "ctrl": True},
{"properties": [("backwards", False), ("sequence", True)]}),
@@ -2730,8 +2734,8 @@ def km_clip_editor(params):
("clip.view_zoom", {"type": 'TRACKPADPAN', "value": 'ANY', "ctrl": True}, None),
("clip.view_zoom_in", {"type": 'WHEELINMOUSE', "value": 'PRESS'}, None),
("clip.view_zoom_out", {"type": 'WHEELOUTMOUSE', "value": 'PRESS'}, None),
- ("clip.view_zoom_in", {"type": 'NUMPAD_PLUS', "value": 'PRESS'}, None),
- ("clip.view_zoom_out", {"type": 'NUMPAD_MINUS', "value": 'PRESS'}, None),
+ ("clip.view_zoom_in", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "repeat": True}, None),
+ ("clip.view_zoom_out", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "repeat": True}, None),
("clip.view_zoom_ratio", {"type": 'NUMPAD_8', "value": 'PRESS', "ctrl": True},
{"properties": [("ratio", 8.0)]}),
("clip.view_zoom_ratio", {"type": 'NUMPAD_4', "value": 'PRESS', "ctrl": True},
@@ -2758,13 +2762,13 @@ def km_clip_editor(params):
("clip.view_selected", {"type": 'NUMPAD_PERIOD', "value": 'PRESS'}, None),
("clip.view_all", {"type": 'NDOF_BUTTON_FIT', "value": 'PRESS'}, None),
("clip.view_ndof", {"type": 'NDOF_MOTION', "value": 'ANY'}, None),
- ("clip.frame_jump", {"type": 'LEFT_ARROW', "value": 'PRESS', "shift": True, "ctrl": True},
+ ("clip.frame_jump", {"type": 'LEFT_ARROW', "value": 'PRESS', "shift": True, "ctrl": True, "repeat": True},
{"properties": [("position", 'PATHSTART')]}),
- ("clip.frame_jump", {"type": 'RIGHT_ARROW', "value": 'PRESS', "shift": True, "ctrl": True},
+ ("clip.frame_jump", {"type": 'RIGHT_ARROW', "value": 'PRESS', "shift": True, "ctrl": True, "repeat": True},
{"properties": [("position", 'PATHEND')]}),
- ("clip.frame_jump", {"type": 'LEFT_ARROW', "value": 'PRESS', "shift": True, "alt": True},
+ ("clip.frame_jump", {"type": 'LEFT_ARROW', "value": 'PRESS', "shift": True, "alt": True, "repeat": True},
{"properties": [("position", 'FAILEDPREV')]}),
- ("clip.frame_jump", {"type": 'RIGHT_ARROW', "value": 'PRESS', "shift": True, "alt": True},
+ ("clip.frame_jump", {"type": 'RIGHT_ARROW', "value": 'PRESS', "shift": True, "alt": True, "repeat": True},
{"properties": [("position", 'PATHSTART')]}),
("clip.change_frame", {"type": 'LEFTMOUSE', "value": 'PRESS'}, None),
("clip.select", {"type": params.select_mouse, "value": 'PRESS'},
@@ -2807,10 +2811,10 @@ def km_clip_editor(params):
{"properties": [("data_path", 'space_data.show_marker_search')]}),
("wm.context_toggle", {"type": 'M', "value": 'PRESS'},
{"properties": [("data_path", 'space_data.use_mute_footage')]}),
- ("transform.translate", {"type": 'G', "value": 'PRESS', "repeat": False}, None),
+ ("transform.translate", {"type": 'G', "value": 'PRESS'}, None),
("transform.translate", {"type": params.select_tweak, "value": 'ANY'}, None),
- ("transform.resize", {"type": 'S', "value": 'PRESS', "repeat": False}, None),
- ("transform.rotate", {"type": 'R', "value": 'PRESS', "repeat": False}, None),
+ ("transform.resize", {"type": 'S', "value": 'PRESS'}, None),
+ ("transform.rotate", {"type": 'R', "value": 'PRESS'}, None),
("clip.clear_track_path", {"type": 'T', "value": 'PRESS', "alt": True},
{"properties": [("action", 'REMAINED'), ("clear_active", False)]}),
("clip.clear_track_path", {"type": 'T', "value": 'PRESS', "shift": True},
@@ -2864,10 +2868,10 @@ def km_clip_graph_editor(params):
{"properties": [("action", 'ALL'), ("clear_active", True)]}),
("clip.graph_disable_markers", {"type": 'D', "value": 'PRESS', "shift": True},
{"properties": [("action", 'TOGGLE')]}),
- ("transform.translate", {"type": 'G', "value": 'PRESS', "repeat": False}, None),
+ ("transform.translate", {"type": 'G', "value": 'PRESS'}, None),
("transform.translate", {"type": params.select_tweak, "value": 'ANY'}, None),
- ("transform.resize", {"type": 'S', "value": 'PRESS', "repeat": False}, None),
- ("transform.rotate", {"type": 'R', "value": 'PRESS', "repeat": False}, None),
+ ("transform.resize", {"type": 'S', "value": 'PRESS'}, None),
+ ("transform.rotate", {"type": 'R', "value": 'PRESS'}, None),
])
if params.select_mouse == 'LEFTMOUSE' and not params.legacy:
@@ -2914,17 +2918,17 @@ def km_frames(params):
items.extend([
# Frame offsets
- ("screen.frame_offset", {"type": 'LEFT_ARROW', "value": 'PRESS'},
+ ("screen.frame_offset", {"type": 'LEFT_ARROW', "value": 'PRESS', "repeat": True},
{"properties": [("delta", -1)]}),
- ("screen.frame_offset", {"type": 'RIGHT_ARROW', "value": 'PRESS'},
+ ("screen.frame_offset", {"type": 'RIGHT_ARROW', "value": 'PRESS', "repeat": True},
{"properties": [("delta", 1)]}),
- ("screen.frame_jump", {"type": 'RIGHT_ARROW', "value": 'PRESS', "shift": True},
+ ("screen.frame_jump", {"type": 'RIGHT_ARROW', "value": 'PRESS', "shift": True, "repeat": True},
{"properties": [("end", True)]}),
- ("screen.frame_jump", {"type": 'LEFT_ARROW', "value": 'PRESS', "shift": True},
+ ("screen.frame_jump", {"type": 'LEFT_ARROW', "value": 'PRESS', "shift": True, "repeat": True},
{"properties": [("end", False)]}),
- ("screen.keyframe_jump", {"type": 'UP_ARROW', "value": 'PRESS'},
+ ("screen.keyframe_jump", {"type": 'UP_ARROW', "value": 'PRESS', "repeat": True},
{"properties": [("next", True)]}),
- ("screen.keyframe_jump", {"type": 'DOWN_ARROW', "value": 'PRESS'},
+ ("screen.keyframe_jump", {"type": 'DOWN_ARROW', "value": 'PRESS', "repeat": True},
{"properties": [("next", False)]}),
("screen.keyframe_jump", {"type": 'MEDIA_LAST', "value": 'PRESS'},
{"properties": [("next", True)]}),
@@ -2940,29 +2944,29 @@ def km_frames(params):
# New playback
if params.spacebar_action in {'TOOL', 'SEARCH'}:
items.append(
- ("screen.animation_play", {"type": 'SPACE', "value": 'PRESS', "shift": True, "repeat": False}, None),
+ ("screen.animation_play", {"type": 'SPACE', "value": 'PRESS', "shift": True}, None),
)
elif params.spacebar_action == 'PLAY':
items.append(
- ("screen.animation_play", {"type": 'SPACE', "value": 'PRESS', "repeat": False}, None),
+ ("screen.animation_play", {"type": 'SPACE', "value": 'PRESS'}, None),
)
else:
assert False
items.extend([
- ("screen.animation_play", {"type": 'SPACE', "value": 'PRESS', "shift": True, "ctrl": True, "repeat": False},
+ ("screen.animation_play", {"type": 'SPACE', "value": 'PRESS', "shift": True, "ctrl": True},
{"properties": [("reverse", True)]}),
])
else:
# Old playback
items.extend([
- ("screen.frame_offset", {"type": 'UP_ARROW', "value": 'PRESS', "shift": True},
+ ("screen.frame_offset", {"type": 'UP_ARROW', "value": 'PRESS', "shift": True, "repeat": True},
{"properties": [("delta", 10)]}),
- ("screen.frame_offset", {"type": 'DOWN_ARROW', "value": 'PRESS', "shift": True},
+ ("screen.frame_offset", {"type": 'DOWN_ARROW', "value": 'PRESS', "shift": True, "repeat": True},
{"properties": [("delta", -10)]}),
- ("screen.frame_jump", {"type": 'UP_ARROW', "value": 'PRESS', "shift": True, "ctrl": True},
+ ("screen.frame_jump", {"type": 'UP_ARROW', "value": 'PRESS', "shift": True, "ctrl": True, "repeat": True},
{"properties": [("end", True)]}),
- ("screen.frame_jump", {"type": 'DOWN_ARROW', "value": 'PRESS', "shift": True, "ctrl": True},
+ ("screen.frame_jump", {"type": 'DOWN_ARROW', "value": 'PRESS', "shift": True, "ctrl": True, "repeat": True},
{"properties": [("end", False)]}),
("screen.animation_play", {"type": 'A', "value": 'PRESS', "alt": True}, None),
("screen.animation_play", {"type": 'A', "value": 'PRESS', "shift": True, "alt": True},
@@ -3048,9 +3052,9 @@ def km_animation_channels(params):
("anim.channels_collapse", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True},
{"properties": [("all", False)]}),
# Move.
- ("anim.channels_move", {"type": 'PAGE_UP', "value": 'PRESS'},
+ ("anim.channels_move", {"type": 'PAGE_UP', "value": 'PRESS', "repeat": True},
{"properties": [("direction", 'UP')]}),
- ("anim.channels_move", {"type": 'PAGE_DOWN', "value": 'PRESS'},
+ ("anim.channels_move", {"type": 'PAGE_DOWN', "value": 'PRESS', "repeat": True},
{"properties": [("direction", 'DOWN')]}),
("anim.channels_move", {"type": 'PAGE_UP', "value": 'PRESS', "shift": True},
{"properties": [("direction", 'TOP')]}),
@@ -3135,8 +3139,8 @@ def _grease_pencil_selection(params):
# Select grouped
("gpencil.select_grouped", {"type": 'G', "value": 'PRESS', "shift": True}, None),
# Select more/less
- ("gpencil.select_more", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True}, None),
- ("gpencil.select_less", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True}, None),
+ ("gpencil.select_more", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True, "repeat": True}, None),
+ ("gpencil.select_less", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True, "repeat": True}, None),
]
@@ -3208,17 +3212,17 @@ def km_grease_pencil_stroke_edit_mode(params):
# Move to layer
op_menu("GPENCIL_MT_move_to_layer", {"type": 'M', "value": 'PRESS'}),
# Transform tools
- ("transform.translate", {"type": 'G', "value": 'PRESS', "repeat": False}, None),
+ ("transform.translate", {"type": 'G', "value": 'PRESS'}, None),
("transform.translate", {"type": params.select_tweak, "value": 'ANY'}, None),
- ("transform.rotate", {"type": 'R', "value": 'PRESS', "repeat": False}, None),
- ("transform.resize", {"type": 'S', "value": 'PRESS', "repeat": False}, None),
- ("transform.mirror", {"type": 'M', "value": 'PRESS', "ctrl": True, "repeat": False}, None),
- ("transform.bend", {"type": 'W', "value": 'PRESS', "shift": True, "repeat": False}, None),
- ("transform.tosphere", {"type": 'S', "value": 'PRESS', "shift": True, "alt": True, "repeat": False}, None),
- ("transform.shear", {"type": 'S', "value": 'PRESS', "shift": True, "ctrl": True, "alt": True, "repeat": False}, None),
- ("transform.transform", {"type": 'S', "value": 'PRESS', "alt": True, "repeat": False},
+ ("transform.rotate", {"type": 'R', "value": 'PRESS'}, None),
+ ("transform.resize", {"type": 'S', "value": 'PRESS'}, None),
+ ("transform.mirror", {"type": 'M', "value": 'PRESS', "ctrl": True}, None),
+ ("transform.bend", {"type": 'W', "value": 'PRESS', "shift": True}, None),
+ ("transform.tosphere", {"type": 'S', "value": 'PRESS', "shift": True, "alt": True}, None),
+ ("transform.shear", {"type": 'S', "value": 'PRESS', "shift": True, "ctrl": True, "alt": True}, None),
+ ("transform.transform", {"type": 'S', "value": 'PRESS', "alt": True},
{"properties": [("mode", 'GPENCIL_SHRINKFATTEN')]}),
- ("transform.transform", {"type": 'F', "value": 'PRESS', "shift": True, "repeat": False},
+ ("transform.transform", {"type": 'F', "value": 'PRESS', "shift": True},
{"properties": [("mode", 'GPENCIL_OPACITY')]}),
# Proportional editing.
*_template_items_proportional_editing(connected=True),
@@ -3912,13 +3916,13 @@ def km_pose(params):
{"properties": [("flipped", True)]}),
*_template_items_select_actions(params, "pose.select_all"),
("pose.select_parent", {"type": 'P', "value": 'PRESS', "shift": True}, None),
- ("pose.select_hierarchy", {"type": 'LEFT_BRACKET', "value": 'PRESS'},
+ ("pose.select_hierarchy", {"type": 'LEFT_BRACKET', "value": 'PRESS', "repeat": True},
{"properties": [("direction", 'PARENT'), ("extend", False)]}),
- ("pose.select_hierarchy", {"type": 'LEFT_BRACKET', "value": 'PRESS', "shift": True},
+ ("pose.select_hierarchy", {"type": 'LEFT_BRACKET', "value": 'PRESS', "shift": True, "repeat": True},
{"properties": [("direction", 'PARENT'), ("extend", True)]}),
- ("pose.select_hierarchy", {"type": 'RIGHT_BRACKET', "value": 'PRESS'},
+ ("pose.select_hierarchy", {"type": 'RIGHT_BRACKET', "value": 'PRESS', "repeat": True},
{"properties": [("direction", 'CHILD'), ("extend", False)]}),
- ("pose.select_hierarchy", {"type": 'RIGHT_BRACKET', "value": 'PRESS', "shift": True},
+ ("pose.select_hierarchy", {"type": 'RIGHT_BRACKET', "value": 'PRESS', "shift": True, "repeat": True},
{"properties": [("direction", 'CHILD'), ("extend", True)]}),
("pose.select_linked", {"type": 'L', "value": 'PRESS', "ctrl": True}, None),
("pose.select_linked_pick", {"type": 'L', "value": 'PRESS'}, None),
@@ -3935,7 +3939,7 @@ def km_pose(params):
("armature.layers_show_all", {"type": 'ACCENT_GRAVE', "value": 'PRESS', "ctrl": True}, None),
("armature.armature_layers", {"type": 'M', "value": 'PRESS', "shift": True}, None),
("pose.bone_layers", {"type": 'M', "value": 'PRESS'}, None),
- ("transform.bbone_resize", {"type": 'S', "value": 'PRESS', "ctrl": True, "alt": True, "repeat": False}, None),
+ ("transform.bbone_resize", {"type": 'S', "value": 'PRESS', "ctrl": True, "alt": True}, None),
("anim.keyframe_insert_menu", {"type": 'I', "value": 'PRESS'}, None),
("anim.keyframe_delete_v3d", {"type": 'I', "value": 'PRESS', "alt": True}, None),
("anim.keying_set_active_set", {"type": 'I', "value": 'PRESS', "shift": True, "ctrl": True, "alt": True}, None),
@@ -3973,17 +3977,17 @@ def km_object_mode(params):
("wm.context_toggle", {"type": 'O', "value": 'PRESS'},
{"properties": [("data_path", 'tool_settings.use_proportional_edit_objects')]}),
*_template_items_select_actions(params, "object.select_all"),
- ("object.select_more", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True}, None),
- ("object.select_less", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True}, None),
+ ("object.select_more", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True, "repeat": True}, None),
+ ("object.select_less", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True, "repeat": True}, None),
("object.select_linked", {"type": 'L', "value": 'PRESS', "shift": True}, None),
("object.select_grouped", {"type": 'G', "value": 'PRESS', "shift": True}, None),
- ("object.select_hierarchy", {"type": 'LEFT_BRACKET', "value": 'PRESS'},
+ ("object.select_hierarchy", {"type": 'LEFT_BRACKET', "value": 'PRESS', "repeat": True},
{"properties": [("direction", 'PARENT'), ("extend", False)]}),
- ("object.select_hierarchy", {"type": 'LEFT_BRACKET', "value": 'PRESS', "shift": True},
+ ("object.select_hierarchy", {"type": 'LEFT_BRACKET', "value": 'PRESS', "shift": True, "repeat": True},
{"properties": [("direction", 'PARENT'), ("extend", True)]}),
- ("object.select_hierarchy", {"type": 'RIGHT_BRACKET', "value": 'PRESS'},
+ ("object.select_hierarchy", {"type": 'RIGHT_BRACKET', "value": 'PRESS', "repeat": True},
{"properties": [("direction", 'CHILD'), ("extend", False)]}),
- ("object.select_hierarchy", {"type": 'RIGHT_BRACKET', "value": 'PRESS', "shift": True},
+ ("object.select_hierarchy", {"type": 'RIGHT_BRACKET', "value": 'PRESS', "shift": True, "repeat": True},
{"properties": [("direction", 'CHILD'), ("extend", True)]}),
("object.parent_set", {"type": 'P', "value": 'PRESS', "ctrl": True}, None),
("object.parent_clear", {"type": 'P', "value": 'PRESS', "alt": True}, None),
@@ -4081,10 +4085,10 @@ def km_paint_curve(params):
("paintcurve.delete_point", {"type": 'DEL', "value": 'PRESS'}, None),
("paintcurve.draw", {"type": 'RET', "value": 'PRESS'}, None),
("paintcurve.draw", {"type": 'NUMPAD_ENTER', "value": 'PRESS'}, None),
- ("transform.translate", {"type": 'G', "value": 'PRESS', "repeat": False}, None),
+ ("transform.translate", {"type": 'G', "value": 'PRESS'}, None),
("transform.translate", {"type": params.select_tweak, "value": 'ANY'}, None),
- ("transform.rotate", {"type": 'R', "value": 'PRESS', "repeat": False}, None),
- ("transform.resize", {"type": 'S', "value": 'PRESS', "repeat": False}, None),
+ ("transform.rotate", {"type": 'R', "value": 'PRESS'}, None),
+ ("transform.resize", {"type": 'S', "value": 'PRESS'}, None),
])
return keymap
@@ -4104,8 +4108,8 @@ def km_curve(params):
("curve.vertex_add", {"type": params.action_mouse, "value": 'CLICK', "ctrl": True}, None),
*_template_items_select_actions(params, "curve.select_all"),
("curve.select_row", {"type": 'R', "value": 'PRESS', "shift": True}, None),
- ("curve.select_more", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True}, None),
- ("curve.select_less", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True}, None),
+ ("curve.select_more", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True, "repeat": True}, None),
+ ("curve.select_less", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True, "repeat": True}, None),
("curve.select_linked", {"type": 'L', "value": 'PRESS', "ctrl": True}, None),
("curve.select_similar", {"type": 'G', "value": 'PRESS', "shift": True}, None),
("curve.select_linked_pick", {"type": 'L', "value": 'PRESS'},
@@ -4124,8 +4128,8 @@ def km_curve(params):
("curve.dissolve_verts", {"type": 'X', "value": 'PRESS', "ctrl": True}, None),
("curve.dissolve_verts", {"type": 'DEL', "value": 'PRESS', "ctrl": True}, None),
("curve.tilt_clear", {"type": 'T', "value": 'PRESS', "alt": True}, None),
- ("transform.tilt", {"type": 'T', "value": 'PRESS', "ctrl": True, "repeat": False}, None),
- ("transform.transform", {"type": 'S', "value": 'PRESS', "alt": True, "repeat": False},
+ ("transform.tilt", {"type": 'T', "value": 'PRESS', "ctrl": True}, None),
+ ("transform.transform", {"type": 'S', "value": 'PRESS', "alt": True},
{"properties": [("mode", 'CURVE_SHRINKFATTEN')]}),
("curve.reveal", {"type": 'H', "value": 'PRESS', "alt": True}, None),
("curve.hide", {"type": 'H', "value": 'PRESS'},
@@ -4208,9 +4212,9 @@ def km_image_paint(params):
("paint.brush_colors_flip", {"type": 'X', "value": 'PRESS'}, None),
("paint.grab_clone", {"type": 'RIGHTMOUSE', "value": 'PRESS'}, None),
("paint.sample_color", {"type": 'S', "value": 'PRESS'}, None),
- ("brush.scale_size", {"type": 'LEFT_BRACKET', "value": 'PRESS'},
+ ("brush.scale_size", {"type": 'LEFT_BRACKET', "value": 'PRESS', "repeat": True},
{"properties": [("scalar", 0.9)]}),
- ("brush.scale_size", {"type": 'RIGHT_BRACKET', "value": 'PRESS'},
+ ("brush.scale_size", {"type": 'RIGHT_BRACKET', "value": 'PRESS', "repeat": True},
{"properties": [("scalar", 1.0 / 0.9)]}),
*_template_paint_radial_control("image_paint", color=True, zoom=True, rotation=True, secondary_rotation=True),
("brush.stencil_control", {"type": 'RIGHTMOUSE', "value": 'PRESS'},
@@ -4257,9 +4261,9 @@ def km_vertex_paint(params):
("paint.brush_colors_flip", {"type": 'X', "value": 'PRESS'}, None),
("paint.sample_color", {"type": 'S', "value": 'PRESS'}, None),
("paint.vertex_color_set", {"type": 'K', "value": 'PRESS', "shift": True}, None),
- ("brush.scale_size", {"type": 'LEFT_BRACKET', "value": 'PRESS'},
+ ("brush.scale_size", {"type": 'LEFT_BRACKET', "value": 'PRESS', "repeat": True},
{"properties": [("scalar", 0.9)]}),
- ("brush.scale_size", {"type": 'RIGHT_BRACKET', "value": 'PRESS'},
+ ("brush.scale_size", {"type": 'RIGHT_BRACKET', "value": 'PRESS', "repeat": True},
{"properties": [("scalar", 1.0 / 0.9)]}),
*_template_paint_radial_control("vertex_paint", color=True, rotation=True),
("brush.stencil_control", {"type": 'RIGHTMOUSE', "value": 'PRESS'},
@@ -4312,9 +4316,9 @@ def km_weight_paint(params):
("paint.weight_gradient", {"type": 'LEFTMOUSE', "value": 'PRESS', "ctrl": True, "alt": True},
{"properties": [("type", 'RADIAL')]}),
("paint.weight_set", {"type": 'K', "value": 'PRESS', "shift": True}, None),
- ("brush.scale_size", {"type": 'LEFT_BRACKET', "value": 'PRESS'},
+ ("brush.scale_size", {"type": 'LEFT_BRACKET', "value": 'PRESS', "repeat": True},
{"properties": [("scalar", 0.9)]}),
- ("brush.scale_size", {"type": 'RIGHT_BRACKET', "value": 'PRESS'},
+ ("brush.scale_size", {"type": 'RIGHT_BRACKET', "value": 'PRESS', "repeat": True},
{"properties": [("scalar", 1.0 / 0.9)]}),
*_template_paint_radial_control("weight_paint"),
("wm.radial_control", {"type": 'F', "value": 'PRESS', "ctrl": True},
@@ -4376,9 +4380,9 @@ def km_sculpt(params):
{"properties": [("mode", "SHRINK")]}),
# Subdivision levels
*_template_items_object_subdivision_set(),
- ("object.subdivision_set", {"type": 'PAGE_UP', "value": 'PRESS'},
+ ("object.subdivision_set", {"type": 'PAGE_UP', "value": 'PRESS', "repeat": True},
{"properties": [("level", 1), ("relative", True)]}),
- ("object.subdivision_set", {"type": 'PAGE_DOWN', "value": 'PRESS'},
+ ("object.subdivision_set", {"type": 'PAGE_DOWN', "value": 'PRESS', "repeat": True},
{"properties": [("level", -1), ("relative", True)]}),
# Mask
("paint.mask_flood_fill", {"type": 'M', "value": 'PRESS', "alt": True},
@@ -4404,9 +4408,9 @@ def km_sculpt(params):
# Color
("sculpt.sample_color", {"type": 'S', "value": 'PRESS'}, None),
# Brush properties
- ("brush.scale_size", {"type": 'LEFT_BRACKET', "value": 'PRESS'},
+ ("brush.scale_size", {"type": 'LEFT_BRACKET', "value": 'PRESS', "repeat": True},
{"properties": [("scalar", 0.9)]}),
- ("brush.scale_size", {"type": 'RIGHT_BRACKET', "value": 'PRESS'},
+ ("brush.scale_size", {"type": 'RIGHT_BRACKET', "value": 'PRESS', "repeat": True},
{"properties": [("scalar", 1.0 / 0.9)]}),
*_template_paint_radial_control("sculpt", rotation=True),
# Stencil
@@ -4501,10 +4505,10 @@ def km_mesh(params):
("mesh.shortest_path_pick", {"type": params.select_mouse, "value": params.select_mouse_value, "shift": True, "ctrl": True},
{"properties": [("use_fill", True)]}),
*_template_items_select_actions(params, "mesh.select_all"),
- ("mesh.select_more", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True}, None),
- ("mesh.select_less", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True}, None),
- ("mesh.select_next_item", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "shift": True, "ctrl": True}, None),
- ("mesh.select_prev_item", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "shift": True, "ctrl": True}, None),
+ ("mesh.select_more", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True, "repeat": True}, None),
+ ("mesh.select_less", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True, "repeat": True}, None),
+ ("mesh.select_next_item", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "shift": True, "ctrl": True, "repeat": True}, None),
+ ("mesh.select_prev_item", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "shift": True, "ctrl": True, "repeat": True}, None),
("mesh.select_linked", {"type": 'L', "value": 'PRESS', "ctrl": True}, None),
("mesh.select_linked_pick", {"type": 'L', "value": 'PRESS'},
{"properties": [("deselect", False)]}),
@@ -4525,7 +4529,7 @@ def km_mesh(params):
{"properties": [("inside", True)]}),
("view3d.edit_mesh_extrude_move_normal", {"type": 'E', "value": 'PRESS'}, None),
op_menu("VIEW3D_MT_edit_mesh_extrude", {"type": 'E', "value": 'PRESS', "alt": True}),
- ("transform.edge_crease", {"type": 'E', "value": 'PRESS', "shift": True, "repeat": False}, None),
+ ("transform.edge_crease", {"type": 'E', "value": 'PRESS', "shift": True}, None),
("mesh.fill", {"type": 'F', "value": 'PRESS', "alt": True}, None),
("mesh.quads_convert_to_tris", {"type": 'T', "value": 'PRESS', "ctrl": True},
{"properties": [("quad_method", 'BEAUTY'), ("ngon_method", 'BEAUTY')]}),
@@ -4539,7 +4543,7 @@ def km_mesh(params):
("mesh.rip_edge_move", {"type": 'D', "value": 'PRESS', "alt": True}, None),
op_menu("VIEW3D_MT_edit_mesh_merge", {"type": 'M', "value": 'PRESS'}),
op_menu("VIEW3D_MT_edit_mesh_split", {"type": 'M', "value": 'PRESS', "alt": True}),
- ("transform.shrink_fatten", {"type": 'S', "value": 'PRESS', "alt": True, "repeat": False}, None),
+ ("transform.shrink_fatten", {"type": 'S', "value": 'PRESS', "alt": True}, None),
("mesh.edge_face_add", {"type": 'F', "value": 'PRESS'}, None),
("mesh.duplicate_move", {"type": 'D', "value": 'PRESS', "shift": True}, None),
op_menu("VIEW3D_MT_mesh_add", {"type": 'A', "value": 'PRESS', "shift": True}),
@@ -4547,7 +4551,7 @@ def km_mesh(params):
("mesh.split", {"type": 'Y', "value": 'PRESS'}, None),
("mesh.vert_connect_path", {"type": 'J', "value": 'PRESS'}, None),
("mesh.point_normals", {"type": 'L', "value": 'PRESS', "alt": True}, None),
- ("transform.vert_slide", {"type": 'V', "value": 'PRESS', "shift": True, "repeat": False}, None),
+ ("transform.vert_slide", {"type": 'V', "value": 'PRESS', "shift": True}, None),
("mesh.dupli_extrude_cursor", {"type": params.action_mouse, "value": 'CLICK', "ctrl": True},
{"properties": [("rotate_source", True)]}),
("mesh.dupli_extrude_cursor", {"type": params.action_mouse, "value": 'CLICK', "shift": True, "ctrl": True},
@@ -4639,8 +4643,8 @@ def km_armature(params):
{"properties": [("direction", 'CHILD'), ("extend", False)]}),
("armature.select_hierarchy", {"type": 'RIGHT_BRACKET', "value": 'PRESS', "shift": True},
{"properties": [("direction", 'CHILD'), ("extend", True)]}),
- ("armature.select_more", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True}, None),
- ("armature.select_less", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True}, None),
+ ("armature.select_more", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True, "repeat": True}, None),
+ ("armature.select_less", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True, "repeat": True}, None),
("armature.select_similar", {"type": 'G', "value": 'PRESS', "shift": True}, None),
("armature.select_linked_pick", {"type": 'L', "value": 'PRESS'},
{"properties": [("deselect", False)]}),
@@ -4669,10 +4673,10 @@ def km_armature(params):
("armature.armature_layers", {"type": 'M', "value": 'PRESS', "shift": True}, None),
("armature.bone_layers", {"type": 'M', "value": 'PRESS'}, None),
# Special transforms.
- ("transform.bbone_resize", {"type": 'S', "value": 'PRESS', "ctrl": True, "alt": True, "repeat": False}, None),
- ("transform.transform", {"type": 'S', "value": 'PRESS', "alt": True, "repeat": False},
+ ("transform.bbone_resize", {"type": 'S', "value": 'PRESS', "ctrl": True, "alt": True}, None),
+ ("transform.transform", {"type": 'S', "value": 'PRESS', "alt": True},
{"properties": [("mode", 'BONE_ENVELOPE')]}),
- ("transform.transform", {"type": 'R', "value": 'PRESS', "ctrl": True, "repeat": False},
+ ("transform.transform", {"type": 'R', "value": 'PRESS', "ctrl": True},
{"properties": [("mode", 'BONE_ROLL')]}),
# Menus.
*_template_items_context_menu("VIEW3D_MT_armature_context_menu", params.context_menu_event),
@@ -4720,8 +4724,8 @@ def km_lattice(params):
items.extend([
*_template_items_select_actions(params, "lattice.select_all"),
- ("lattice.select_more", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True}, None),
- ("lattice.select_less", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True}, None),
+ ("lattice.select_more", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True, "repeat": True}, None),
+ ("lattice.select_less", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True, "repeat": True}, None),
("object.vertex_parent_set", {"type": 'P', "value": 'PRESS', "ctrl": True}, None),
("lattice.flip", {"type": 'F', "value": 'PRESS', "alt": True}, None),
op_menu("VIEW3D_MT_hook", {"type": 'H', "value": 'PRESS', "ctrl": True}),
@@ -4743,8 +4747,8 @@ def km_particle(params):
items.extend([
*_template_items_select_actions(params, "particle.select_all"),
- ("particle.select_more", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True}, None),
- ("particle.select_less", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True}, None),
+ ("particle.select_more", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True, "repeat": True}, None),
+ ("particle.select_less", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True, "repeat": True}, None),
("particle.select_linked_pick", {"type": 'L', "value": 'PRESS'},
{"properties": [("deselect", False)]}),
("particle.select_linked_pick", {"type": 'L', "value": 'PRESS', "shift": True},
@@ -4796,71 +4800,71 @@ def km_font(params):
{"properties": [("style", 'UNDERLINE')]}),
("font.style_toggle", {"type": 'P', "value": 'PRESS', "ctrl": True},
{"properties": [("style", 'SMALL_CAPS')]}),
- ("font.delete", {"type": 'DEL', "value": 'PRESS'},
+ ("font.delete", {"type": 'DEL', "value": 'PRESS', "repeat": True},
{"properties": [("type", 'NEXT_OR_SELECTION')]}),
- ("font.delete", {"type": 'DEL', "value": 'PRESS', "ctrl": True},
+ ("font.delete", {"type": 'DEL', "value": 'PRESS', "ctrl": True, "repeat": True},
{"properties": [("type", 'NEXT_WORD')]}),
- ("font.delete", {"type": 'BACK_SPACE', "value": 'PRESS'},
+ ("font.delete", {"type": 'BACK_SPACE', "value": 'PRESS', "repeat": True},
{"properties": [("type", 'PREVIOUS_OR_SELECTION')]}),
- ("font.delete", {"type": 'BACK_SPACE', "value": 'PRESS', "shift": True},
+ ("font.delete", {"type": 'BACK_SPACE', "value": 'PRESS', "shift": True, "repeat": True},
{"properties": [("type", 'PREVIOUS_OR_SELECTION')]}),
- ("font.delete", {"type": 'BACK_SPACE', "value": 'PRESS', "ctrl": True},
+ ("font.delete", {"type": 'BACK_SPACE', "value": 'PRESS', "ctrl": True, "repeat": True},
{"properties": [("type", 'PREVIOUS_WORD')]}),
("font.move", {"type": 'HOME', "value": 'PRESS'},
{"properties": [("type", 'LINE_BEGIN')]}),
("font.move", {"type": 'END', "value": 'PRESS'},
{"properties": [("type", 'LINE_END')]}),
- ("font.move", {"type": 'LEFT_ARROW', "value": 'PRESS'},
+ ("font.move", {"type": 'LEFT_ARROW', "value": 'PRESS', "repeat": True},
{"properties": [("type", 'PREVIOUS_CHARACTER')]}),
- ("font.move", {"type": 'RIGHT_ARROW', "value": 'PRESS'},
+ ("font.move", {"type": 'RIGHT_ARROW', "value": 'PRESS', "repeat": True},
{"properties": [("type", 'NEXT_CHARACTER')]}),
- ("font.move", {"type": 'LEFT_ARROW', "value": 'PRESS', "ctrl": True},
+ ("font.move", {"type": 'LEFT_ARROW', "value": 'PRESS', "ctrl": True, "repeat": True},
{"properties": [("type", 'PREVIOUS_WORD')]}),
- ("font.move", {"type": 'RIGHT_ARROW', "value": 'PRESS', "ctrl": True},
+ ("font.move", {"type": 'RIGHT_ARROW', "value": 'PRESS', "ctrl": True, "repeat": True},
{"properties": [("type", 'NEXT_WORD')]}),
- ("font.move", {"type": 'UP_ARROW', "value": 'PRESS'},
+ ("font.move", {"type": 'UP_ARROW', "value": 'PRESS', "repeat": True},
{"properties": [("type", 'PREVIOUS_LINE')]}),
- ("font.move", {"type": 'DOWN_ARROW', "value": 'PRESS'},
+ ("font.move", {"type": 'DOWN_ARROW', "value": 'PRESS', "repeat": True},
{"properties": [("type", 'NEXT_LINE')]}),
- ("font.move", {"type": 'PAGE_UP', "value": 'PRESS'},
+ ("font.move", {"type": 'PAGE_UP', "value": 'PRESS', "repeat": True},
{"properties": [("type", 'PREVIOUS_PAGE')]}),
- ("font.move", {"type": 'PAGE_DOWN', "value": 'PRESS'},
+ ("font.move", {"type": 'PAGE_DOWN', "value": 'PRESS', "repeat": True},
{"properties": [("type", 'NEXT_PAGE')]}),
("font.move_select", {"type": 'HOME', "value": 'PRESS', "shift": True},
{"properties": [("type", 'LINE_BEGIN')]}),
("font.move_select", {"type": 'END', "value": 'PRESS', "shift": True},
{"properties": [("type", 'LINE_END')]}),
- ("font.move_select", {"type": 'LEFT_ARROW', "value": 'PRESS', "shift": True},
+ ("font.move_select", {"type": 'LEFT_ARROW', "value": 'PRESS', "shift": True, "repeat": True},
{"properties": [("type", 'PREVIOUS_CHARACTER')]}),
- ("font.move_select", {"type": 'RIGHT_ARROW', "value": 'PRESS', "shift": True},
+ ("font.move_select", {"type": 'RIGHT_ARROW', "value": 'PRESS', "shift": True, "repeat": True},
{"properties": [("type", 'NEXT_CHARACTER')]}),
- ("font.move_select", {"type": 'LEFT_ARROW', "value": 'PRESS', "shift": True, "ctrl": True},
+ ("font.move_select", {"type": 'LEFT_ARROW', "value": 'PRESS', "shift": True, "ctrl": True, "repeat": True},
{"properties": [("type", 'PREVIOUS_WORD')]}),
- ("font.move_select", {"type": 'RIGHT_ARROW', "value": 'PRESS', "shift": True, "ctrl": True},
+ ("font.move_select", {"type": 'RIGHT_ARROW', "value": 'PRESS', "shift": True, "ctrl": True, "repeat": True},
{"properties": [("type", 'NEXT_WORD')]}),
- ("font.move_select", {"type": 'UP_ARROW', "value": 'PRESS', "shift": True},
+ ("font.move_select", {"type": 'UP_ARROW', "value": 'PRESS', "shift": True, "repeat": True},
{"properties": [("type", 'PREVIOUS_LINE')]}),
- ("font.move_select", {"type": 'DOWN_ARROW', "value": 'PRESS', "shift": True},
+ ("font.move_select", {"type": 'DOWN_ARROW', "value": 'PRESS', "shift": True, "repeat": True},
{"properties": [("type", 'NEXT_LINE')]}),
- ("font.move_select", {"type": 'PAGE_UP', "value": 'PRESS', "shift": True},
+ ("font.move_select", {"type": 'PAGE_UP', "value": 'PRESS', "shift": True, "repeat": True},
{"properties": [("type", 'PREVIOUS_PAGE')]}),
- ("font.move_select", {"type": 'PAGE_DOWN', "value": 'PRESS', "shift": True},
+ ("font.move_select", {"type": 'PAGE_DOWN', "value": 'PRESS', "shift": True, "repeat": True},
{"properties": [("type", 'NEXT_PAGE')]}),
- ("font.change_spacing", {"type": 'LEFT_ARROW', "value": 'PRESS', "alt": True},
+ ("font.change_spacing", {"type": 'LEFT_ARROW', "value": 'PRESS', "alt": True, "repeat": True},
{"properties": [("delta", -1)]}),
- ("font.change_spacing", {"type": 'RIGHT_ARROW', "value": 'PRESS', "alt": True},
+ ("font.change_spacing", {"type": 'RIGHT_ARROW', "value": 'PRESS', "alt": True, "repeat": True},
{"properties": [("delta", 1)]}),
- ("font.change_character", {"type": 'UP_ARROW', "value": 'PRESS', "alt": True},
+ ("font.change_character", {"type": 'UP_ARROW', "value": 'PRESS', "alt": True, "repeat": True},
{"properties": [("delta", 1)]}),
- ("font.change_character", {"type": 'DOWN_ARROW', "value": 'PRESS', "alt": True},
+ ("font.change_character", {"type": 'DOWN_ARROW', "value": 'PRESS', "alt": True, "repeat": True},
{"properties": [("delta", -1)]}),
("font.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True}, None),
("font.text_copy", {"type": 'C', "value": 'PRESS', "ctrl": True}, None),
("font.text_cut", {"type": 'X', "value": 'PRESS', "ctrl": True}, None),
("font.text_paste", {"type": 'V', "value": 'PRESS', "ctrl": True}, None),
- ("font.line_break", {"type": 'RET', "value": 'PRESS'}, None),
- ("font.text_insert", {"type": 'TEXTINPUT', "value": 'ANY', "any": True}, None),
- ("font.text_insert", {"type": 'BACK_SPACE', "value": 'PRESS', "alt": True},
+ ("font.line_break", {"type": 'RET', "value": 'PRESS', "repeat": True}, None),
+ ("font.text_insert", {"type": 'TEXTINPUT', "value": 'ANY', "any": True, "repeat": True}, None),
+ ("font.text_insert", {"type": 'BACK_SPACE', "value": 'PRESS', "alt": True, "repeat": True},
{"properties": [("accent", True)]}),
*_template_items_context_menu("VIEW3D_MT_edit_font_context_menu", params.context_menu_event),
])
@@ -4977,28 +4981,28 @@ def km_transform_modal_map(_params):
("CONFIRM", {"type": 'SPACE', "value": 'PRESS', "any": True}, None),
("CANCEL", {"type": 'RIGHTMOUSE', "value": 'PRESS', "any": True}, None),
("CANCEL", {"type": 'ESC', "value": 'PRESS', "any": True}, None),
- ("AXIS_X", {"type": 'X', "value": 'PRESS', "repeat": False}, None),
- ("AXIS_Y", {"type": 'Y', "value": 'PRESS', "repeat": False}, None),
- ("AXIS_Z", {"type": 'Z', "value": 'PRESS', "repeat": False}, None),
- ("PLANE_X", {"type": 'X', "value": 'PRESS', "shift": True, "repeat": False}, None),
- ("PLANE_Y", {"type": 'Y', "value": 'PRESS', "shift": True, "repeat": False}, None),
- ("PLANE_Z", {"type": 'Z', "value": 'PRESS', "shift": True, "repeat": False}, None),
- ("CONS_OFF", {"type": 'C', "value": 'PRESS', "repeat": False}, None),
- ("TRANSLATE", {"type": 'G', "value": 'PRESS', "repeat": False}, None),
- ("ROTATE", {"type": 'R', "value": 'PRESS', "repeat": False}, None),
- ("RESIZE", {"type": 'S', "value": 'PRESS', "repeat": False}, None),
- ("SNAP_TOGGLE", {"type": 'TAB', "value": 'PRESS', "shift": True, "repeat": False}, None),
+ ("AXIS_X", {"type": 'X', "value": 'PRESS'}, None),
+ ("AXIS_Y", {"type": 'Y', "value": 'PRESS'}, None),
+ ("AXIS_Z", {"type": 'Z', "value": 'PRESS'}, None),
+ ("PLANE_X", {"type": 'X', "value": 'PRESS', "shift": True}, None),
+ ("PLANE_Y", {"type": 'Y', "value": 'PRESS', "shift": True}, None),
+ ("PLANE_Z", {"type": 'Z', "value": 'PRESS', "shift": True}, None),
+ ("CONS_OFF", {"type": 'C', "value": 'PRESS'}, None),
+ ("TRANSLATE", {"type": 'G', "value": 'PRESS'}, None),
+ ("ROTATE", {"type": 'R', "value": 'PRESS'}, None),
+ ("RESIZE", {"type": 'S', "value": 'PRESS'}, None),
+ ("SNAP_TOGGLE", {"type": 'TAB', "value": 'PRESS', "shift": True}, None),
("SNAP_INV_ON", {"type": 'LEFT_CTRL', "value": 'PRESS', "any": True}, None),
("SNAP_INV_OFF", {"type": 'LEFT_CTRL', "value": 'RELEASE', "any": True}, None),
("SNAP_INV_ON", {"type": 'RIGHT_CTRL', "value": 'PRESS', "any": True}, None),
("SNAP_INV_OFF", {"type": 'RIGHT_CTRL', "value": 'RELEASE', "any": True}, None),
- ("ADD_SNAP", {"type": 'A', "value": 'PRESS', "repeat": False}, None),
- ("ADD_SNAP", {"type": 'A', "value": 'PRESS', "ctrl": True, "repeat": False}, None),
- ("REMOVE_SNAP", {"type": 'A', "value": 'PRESS', "alt": True, "repeat": False}, None),
- ("PROPORTIONAL_SIZE_UP", {"type": 'PAGE_UP', "value": 'PRESS'}, None),
- ("PROPORTIONAL_SIZE_DOWN", {"type": 'PAGE_DOWN', "value": 'PRESS'}, None),
- ("PROPORTIONAL_SIZE_UP", {"type": 'PAGE_UP', "value": 'PRESS', "shift": True}, None),
- ("PROPORTIONAL_SIZE_DOWN", {"type": 'PAGE_DOWN', "value": 'PRESS', "shift": True}, None),
+ ("ADD_SNAP", {"type": 'A', "value": 'PRESS'}, None),
+ ("ADD_SNAP", {"type": 'A', "value": 'PRESS', "ctrl": True}, None),
+ ("REMOVE_SNAP", {"type": 'A', "value": 'PRESS', "alt": True}, None),
+ ("PROPORTIONAL_SIZE_UP", {"type": 'PAGE_UP', "value": 'PRESS', "repeat": True}, None),
+ ("PROPORTIONAL_SIZE_DOWN", {"type": 'PAGE_DOWN', "value": 'PRESS', "repeat": True}, None),
+ ("PROPORTIONAL_SIZE_UP", {"type": 'PAGE_UP', "value": 'PRESS', "shift": True, "repeat": True}, None),
+ ("PROPORTIONAL_SIZE_DOWN", {"type": 'PAGE_DOWN', "value": 'PRESS', "shift": True, "repeat": True}, None),
("PROPORTIONAL_SIZE_UP", {"type": 'WHEELDOWNMOUSE', "value": 'PRESS'}, None),
("PROPORTIONAL_SIZE_DOWN", {"type": 'WHEELUPMOUSE', "value": 'PRESS'}, None),
("PROPORTIONAL_SIZE_UP", {"type": 'WHEELDOWNMOUSE', "value": 'PRESS', "shift": True}, None),
@@ -5006,17 +5010,17 @@ def km_transform_modal_map(_params):
("PROPORTIONAL_SIZE", {"type": 'TRACKPADPAN', "value": 'ANY'}, None),
("EDGESLIDE_EDGE_NEXT", {"type": 'WHEELDOWNMOUSE', "value": 'PRESS', "alt": True}, None),
("EDGESLIDE_PREV_NEXT", {"type": 'WHEELUPMOUSE', "value": 'PRESS', "alt": True}, None),
- ("AUTOIK_CHAIN_LEN_UP", {"type": 'PAGE_UP', "value": 'PRESS'}, None),
- ("AUTOIK_CHAIN_LEN_DOWN", {"type": 'PAGE_DOWN', "value": 'PRESS'}, None),
- ("AUTOIK_CHAIN_LEN_UP", {"type": 'PAGE_UP', "value": 'PRESS', "shift": True}, None),
- ("AUTOIK_CHAIN_LEN_DOWN", {"type": 'PAGE_DOWN', "value": 'PRESS', "shift": True}, None),
+ ("AUTOIK_CHAIN_LEN_UP", {"type": 'PAGE_UP', "value": 'PRESS', "repeat": True}, None),
+ ("AUTOIK_CHAIN_LEN_DOWN", {"type": 'PAGE_DOWN', "value": 'PRESS', "repeat": True}, None),
+ ("AUTOIK_CHAIN_LEN_UP", {"type": 'PAGE_UP', "value": 'PRESS', "shift": True, "repeat": True}, None),
+ ("AUTOIK_CHAIN_LEN_DOWN", {"type": 'PAGE_DOWN', "value": 'PRESS', "shift": True, "repeat": True}, None),
("AUTOIK_CHAIN_LEN_UP", {"type": 'WHEELDOWNMOUSE', "value": 'PRESS'}, None),
("AUTOIK_CHAIN_LEN_DOWN", {"type": 'WHEELUPMOUSE', "value": 'PRESS'}, None),
("AUTOIK_CHAIN_LEN_UP", {"type": 'WHEELDOWNMOUSE', "value": 'PRESS', "shift": True}, None),
("AUTOIK_CHAIN_LEN_DOWN", {"type": 'WHEELUPMOUSE', "value": 'PRESS', "shift": True}, None),
- ("INSERTOFS_TOGGLE_DIR", {"type": 'T', "value": 'PRESS', "repeat": False}, None),
- ("AUTOCONSTRAIN", {"type": 'MIDDLEMOUSE', "value": 'PRESS', "repeat": False}, None),
- ("AUTOCONSTRAINPLANE", {"type": 'MIDDLEMOUSE', "value": 'PRESS', "repeat": False, "shift": True}, None),
+ ("INSERTOFS_TOGGLE_DIR", {"type": 'T', "value": 'PRESS'}, None),
+ ("AUTOCONSTRAIN", {"type": 'MIDDLEMOUSE', "value": 'PRESS'}, None),
+ ("AUTOCONSTRAINPLANE", {"type": 'MIDDLEMOUSE', "value": 'PRESS'}, None),
])
return keymap
@@ -5069,9 +5073,9 @@ def km_view3d_gesture_circle(_params):
("DESELECT", {"type": 'MIDDLEMOUSE', "value": 'PRESS'}, None),
("NOP", {"type": 'MIDDLEMOUSE', "value": 'RELEASE', "any": True}, None),
("SUBTRACT", {"type": 'WHEELUPMOUSE', "value": 'PRESS'}, None),
- ("SUBTRACT", {"type": 'NUMPAD_MINUS', "value": 'PRESS'}, None),
+ ("SUBTRACT", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "repeat": True}, None),
("ADD", {"type": 'WHEELDOWNMOUSE', "value": 'PRESS'}, None),
- ("ADD", {"type": 'NUMPAD_PLUS', "value": 'PRESS'}, None),
+ ("ADD", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "repeat": True}, None),
("SIZE", {"type": 'TRACKPADPAN', "value": 'ANY'}, None),
])
@@ -5096,7 +5100,7 @@ def km_gesture_border(_params):
("SELECT", {"type": 'LEFTMOUSE', "value": 'RELEASE', "any": True}, None),
("BEGIN", {"type": 'MIDDLEMOUSE', "value": 'PRESS'}, None),
("DESELECT", {"type": 'MIDDLEMOUSE', "value": 'RELEASE'}, None),
- ("MOVE", {"type": 'SPACE', "value": 'ANY', "repeat": False, "any": True}, None),
+ ("MOVE", {"type": 'SPACE', "value": 'ANY', "any": True}, None),
])
return keymap
@@ -5135,9 +5139,9 @@ def km_gesture_straight_line(_params):
("CANCEL", {"type": 'RIGHTMOUSE', "value": 'ANY', "any": True}, None),
("BEGIN", {"type": 'LEFTMOUSE', "value": 'PRESS'}, None),
("SELECT", {"type": 'LEFTMOUSE', "value": 'RELEASE', "any": True}, None),
- ("MOVE", {"type": 'SPACE', "value": 'ANY', "repeat": False, "any": True}, None),
- ("SNAP", {"type": 'LEFT_CTRL', "value": 'ANY', "any": True, "repeat": False}, None),
- ("FLIP", {"type": 'F', "value": 'PRESS', "any": True, "repeat": False}, None),
+ ("MOVE", {"type": 'SPACE', "value": 'ANY', "any": True}, None),
+ ("SNAP", {"type": 'LEFT_CTRL', "value": 'ANY', "any": True}, None),
+ ("FLIP", {"type": 'F', "value": 'PRESS', "any": True}, None),
])
return keymap
@@ -5152,7 +5156,7 @@ def km_gesture_lasso(_params):
)
items.extend([
- ("MOVE", {"type": 'SPACE', "value": 'ANY', "repeat": False, "any": True}, None),
+ ("MOVE", {"type": 'SPACE', "value": 'ANY', "any": True}, None),
])
return keymap
@@ -5290,25 +5294,25 @@ def km_view3d_fly_modal(_params):
("CONFIRM", {"type": 'RET', "value": 'PRESS', "any": True}, None),
("CONFIRM", {"type": 'SPACE', "value": 'PRESS', "any": True}, None),
("CONFIRM", {"type": 'NUMPAD_ENTER', "value": 'PRESS', "any": True}, None),
- ("ACCELERATE", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "any": True}, None),
- ("DECELERATE", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "any": True}, None),
+ ("ACCELERATE", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "any": True, "repeat": True}, None),
+ ("DECELERATE", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "any": True, "repeat": True}, None),
("ACCELERATE", {"type": 'WHEELUPMOUSE', "value": 'PRESS', "any": True}, None),
("DECELERATE", {"type": 'WHEELDOWNMOUSE', "value": 'PRESS', "any": True}, None),
("CONFIRM", {"type": 'TRACKPADPAN', "value": 'ANY'}, None),
("PAN_ENABLE", {"type": 'MIDDLEMOUSE', "value": 'PRESS', "any": True}, None),
("PAN_DISABLE", {"type": 'MIDDLEMOUSE', "value": 'RELEASE', "any": True}, None),
- ("FORWARD", {"type": 'W', "value": 'PRESS'}, None),
- ("BACKWARD", {"type": 'S', "value": 'PRESS'}, None),
- ("LEFT", {"type": 'A', "value": 'PRESS'}, None),
- ("RIGHT", {"type": 'D', "value": 'PRESS'}, None),
- ("UP", {"type": 'E', "value": 'PRESS'}, None),
- ("DOWN", {"type": 'Q', "value": 'PRESS'}, None),
- ("UP", {"type": 'R', "value": 'PRESS'}, None),
- ("DOWN", {"type": 'F', "value": 'PRESS'}, None),
- ("FORWARD", {"type": 'UP_ARROW', "value": 'PRESS'}, None),
- ("BACKWARD", {"type": 'DOWN_ARROW', "value": 'PRESS'}, None),
- ("LEFT", {"type": 'LEFT_ARROW', "value": 'PRESS'}, None),
- ("RIGHT", {"type": 'RIGHT_ARROW', "value": 'PRESS'}, None),
+ ("FORWARD", {"type": 'W', "value": 'PRESS', "repeat": True}, None),
+ ("BACKWARD", {"type": 'S', "value": 'PRESS', "repeat": True}, None),
+ ("LEFT", {"type": 'A', "value": 'PRESS', "repeat": True}, None),
+ ("RIGHT", {"type": 'D', "value": 'PRESS', "repeat": True}, None),
+ ("UP", {"type": 'E', "value": 'PRESS', "repeat": True}, None),
+ ("DOWN", {"type": 'Q', "value": 'PRESS', "repeat": True}, None),
+ ("UP", {"type": 'R', "value": 'PRESS', "repeat": True}, None),
+ ("DOWN", {"type": 'F', "value": 'PRESS', "repeat": True}, None),
+ ("FORWARD", {"type": 'UP_ARROW', "value": 'PRESS', "repeat": True}, None),
+ ("BACKWARD", {"type": 'DOWN_ARROW', "value": 'PRESS', "repeat": True}, None),
+ ("LEFT", {"type": 'LEFT_ARROW', "value": 'PRESS', "repeat": True}, None),
+ ("RIGHT", {"type": 'RIGHT_ARROW', "value": 'PRESS', "repeat": True}, None),
("AXIS_LOCK_X", {"type": 'X', "value": 'PRESS'}, None),
("AXIS_LOCK_Z", {"type": 'Z', "value": 'PRESS'}, None),
("PRECISION_ENABLE", {"type": 'LEFT_ALT', "value": 'PRESS', "any": True}, None),
@@ -5366,8 +5370,8 @@ def km_view3d_walk_modal(_params):
("JUMP_STOP", {"type": 'V', "value": 'RELEASE', "any": True}, None),
("TELEPORT", {"type": 'SPACE', "value": 'PRESS', "any": True}, None),
("TELEPORT", {"type": 'MIDDLEMOUSE', "value": 'ANY', "any": True}, None),
- ("ACCELERATE", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "any": True}, None),
- ("DECELERATE", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "any": True}, None),
+ ("ACCELERATE", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "any": True, "repeat": True}, None),
+ ("DECELERATE", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "any": True, "repeat": True}, None),
("ACCELERATE", {"type": 'WHEELUPMOUSE', "value": 'PRESS', "any": True}, None),
("DECELERATE", {"type": 'WHEELDOWNMOUSE', "value": 'PRESS', "any": True}, None),
])
@@ -5687,9 +5691,9 @@ def km_image_editor_tool_uv_sculpt_stroke(params):
{"properties": [("mode", 'INVERT')]}),
("sculpt.uv_sculpt_stroke", {"type": params.tool_mouse, "value": 'PRESS', "shift": True},
{"properties": [("mode", 'RELAX')]}),
- ("brush.scale_size", {"type": 'LEFT_BRACKET', "value": 'PRESS'},
+ ("brush.scale_size", {"type": 'LEFT_BRACKET', "value": 'PRESS', "repeat": True},
{"properties": [("scalar", 0.9)]}),
- ("brush.scale_size", {"type": 'RIGHT_BRACKET', "value": 'PRESS'},
+ ("brush.scale_size", {"type": 'RIGHT_BRACKET', "value": 'PRESS', "repeat": True},
{"properties": [("scalar", 1.0 / 0.9)]}),
*_template_paint_radial_control("uv_sculpt"),
]},
@@ -6486,10 +6490,8 @@ def km_3d_view_tool_sculpt_face_set_edit(params):
"3D View Tool: Sculpt, Face Set Edit",
{"space_type": 'VIEW_3D', "region_type": 'WINDOW'},
{"items": [
- ("sculpt.face_set_edit", {"type": params.tool_mouse, "value": 'ANY'},
+ ("sculpt.face_set_edit", {"type": params.tool_mouse, "value": 'PRESS'},
None),
- ("sculpt.face_set_edit", {"type": params.tool_tweak, "value": 'ANY'},
- None)
]},
)
diff --git a/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py b/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
index e4ff0177ceb..666dbb30365 100644
--- a/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
+++ b/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
@@ -237,7 +237,7 @@ def km_screen(params):
)
items.extend([
- ("screen.repeat_last", {"type": 'G', "value": 'PRESS'}, None),
+ ("screen.repeat_last", {"type": 'G', "value": 'PRESS', "repeat": True}, None),
# Animation
("screen.userpref_show", {"type": 'COMMA', "value": 'PRESS', "ctrl": True}, None),
("screen.animation_step", {"type": 'TIMER0', "value": 'ANY', "any": True}, None),
@@ -256,8 +256,8 @@ def km_screen(params):
("file.execute", {"type": 'NUMPAD_ENTER', "value": 'PRESS'}, None),
("file.cancel", {"type": 'ESC', "value": 'PRESS'}, None),
# Undo
- ("ed.undo", {"type": 'Z', "value": 'PRESS', "ctrl": True}, None),
- ("ed.redo", {"type": 'Z', "value": 'PRESS', "shift": True, "ctrl": True}, None),
+ ("ed.undo", {"type": 'Z', "value": 'PRESS', "ctrl": True, "repeat": True}, None),
+ ("ed.redo", {"type": 'Z', "value": 'PRESS', "shift": True, "ctrl": True, "repeat": True}, None),
("ed.undo_history", {"type": 'Z', "value": 'PRESS', "alt": True, "ctrl": True}, None),
# Render
("render.view_cancel", {"type": 'ESC', "value": 'PRESS'}, None),
@@ -344,8 +344,8 @@ def km_view2d(params):
("view2d.zoom_in", {"type": 'WHEELINMOUSE', "value": 'PRESS'}, None),
("view2d.zoom_out", {"type": 'WHEELOUTMOUSE', "value": 'PRESS', "alt": True}, None),
("view2d.zoom_in", {"type": 'WHEELINMOUSE', "value": 'PRESS', "alt": True}, None),
- ("view2d.zoom_out", {"type": 'NUMPAD_MINUS', "value": 'PRESS'}, None),
- ("view2d.zoom_in", {"type": 'NUMPAD_PLUS', "value": 'PRESS'}, None),
+ ("view2d.zoom_out", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "repeat": True}, None),
+ ("view2d.zoom_in", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "repeat": True}, None),
("view2d.zoom", {"type": 'TRACKPADPAN', "value": 'ANY', "ctrl": True}, None),
("view2d.smoothview", {"type": 'TIMER1', "value": 'ANY', "any": True}, None),
# Scroll up/down, only when zoom is not available.
@@ -379,16 +379,16 @@ def km_view2d_buttons_list(params):
("view2d.pan", {"type": 'TRACKPADPAN', "value": 'ANY'}, None),
("view2d.scroll_down", {"type": 'WHEELDOWNMOUSE', "value": 'PRESS'}, None),
("view2d.scroll_up", {"type": 'WHEELUPMOUSE', "value": 'PRESS'}, None),
- ("view2d.scroll_down", {"type": 'PAGE_DOWN', "value": 'PRESS'},
+ ("view2d.scroll_down", {"type": 'PAGE_DOWN', "value": 'PRESS', "repeat": True},
{"properties": [("page", True)]}),
- ("view2d.scroll_up", {"type": 'PAGE_UP', "value": 'PRESS'},
+ ("view2d.scroll_up", {"type": 'PAGE_UP', "value": 'PRESS', "repeat": True},
{"properties": [("page", True)]}),
# Zoom
("view2d.zoom", {"type": 'RIGHTMOUSE', "value": 'PRESS', "alt": True}, None),
("view2d.zoom", {"type": 'TRACKPADZOOM', "value": 'ANY'}, None),
("view2d.zoom", {"type": 'TRACKPADPAN', "value": 'ANY', "ctrl": True}, None),
- ("view2d.zoom_out", {"type": 'NUMPAD_MINUS', "value": 'PRESS'}, None),
- ("view2d.zoom_in", {"type": 'NUMPAD_PLUS', "value": 'PRESS'}, None),
+ ("view2d.zoom_out", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "repeat": True}, None),
+ ("view2d.zoom_in", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "repeat": True}, None),
("view2d.reset", {"type": 'A', "value": 'PRESS'}, None),
])
@@ -479,17 +479,21 @@ def km_outliner(params):
{"properties": [("tweak", True), ("mode", "ADD")]}),
("outliner.select_box", {"type": 'EVT_TWEAK_L', "value": 'ANY', "ctrl": True},
{"properties": [("tweak", True), ("mode", "SUB")]}),
- ("outliner.select_walk", {"type": 'UP_ARROW', "value": 'PRESS'}, {"properties": [("direction", 'UP')]}),
- ("outliner.select_walk", {"type": 'UP_ARROW', "value": 'PRESS', "shift": True},
+ ("outliner.select_walk", {"type": 'UP_ARROW', "value": 'PRESS', "repeat": True},
+ {"properties": [("direction", 'UP')]}),
+ ("outliner.select_walk", {"type": 'UP_ARROW', "value": 'PRESS', "shift": True, "repeat": True},
{"properties": [("direction", 'UP'), ("extend", True)]}),
- ("outliner.select_walk", {"type": 'DOWN_ARROW', "value": 'PRESS'}, {"properties": [("direction", 'DOWN')]}),
- ("outliner.select_walk", {"type": 'DOWN_ARROW', "value": 'PRESS', "shift": True},
+ ("outliner.select_walk", {"type": 'DOWN_ARROW', "value": 'PRESS', "repeat": True},
+ {"properties": [("direction", 'DOWN')]}),
+ ("outliner.select_walk", {"type": 'DOWN_ARROW', "value": 'PRESS', "shift": True, "repeat": True},
{"properties": [("direction", 'DOWN'), ("extend", True)]}),
- ("outliner.select_walk", {"type": 'LEFT_ARROW', "value": 'PRESS'}, {"properties": [("direction", 'LEFT')]}),
- ("outliner.select_walk", {"type": 'LEFT_ARROW', "value": 'PRESS', "shift": True},
+ ("outliner.select_walk", {"type": 'LEFT_ARROW', "value": 'PRESS', "repeat": True},
+ {"properties": [("direction", 'LEFT')]}),
+ ("outliner.select_walk", {"type": 'LEFT_ARROW', "value": 'PRESS', "shift": True, "repeat": True},
{"properties": [("direction", 'LEFT'), ("toggle_all", True)]}),
- ("outliner.select_walk", {"type": 'RIGHT_ARROW', "value": 'PRESS'}, {"properties": [("direction", 'RIGHT')]}),
- ("outliner.select_walk", {"type": 'RIGHT_ARROW', "value": 'PRESS', "shift": True},
+ ("outliner.select_walk", {"type": 'RIGHT_ARROW', "value": 'PRESS', "repeat": True},
+ {"properties": [("direction", 'RIGHT')]}),
+ ("outliner.select_walk", {"type": 'RIGHT_ARROW', "value": 'PRESS', "shift": True, "repeat": True},
{"properties": [("direction", 'RIGHT'), ("toggle_all", True)]}),
("outliner.item_openclose", {"type": 'LEFTMOUSE', "value": 'CLICK'},
{"properties": [("all", False)]}),
@@ -505,9 +509,9 @@ def km_outliner(params):
("outliner.show_hierarchy", {"type": 'A', "value": 'PRESS'}, None),
("outliner.show_active", {"type": 'PERIOD', "value": 'PRESS'}, None),
("outliner.show_active", {"type": 'F', "value": 'PRESS'}, None),
- ("outliner.scroll_page", {"type": 'PAGE_DOWN', "value": 'PRESS'},
+ ("outliner.scroll_page", {"type": 'PAGE_DOWN', "value": 'PRESS', "repeat": True},
{"properties": [("up", False)]}),
- ("outliner.scroll_page", {"type": 'PAGE_UP', "value": 'PRESS'},
+ ("outliner.scroll_page", {"type": 'PAGE_UP', "value": 'PRESS', "repeat": True},
{"properties": [("up", True)]}),
("outliner.show_one_level", {"type": 'NUMPAD_PLUS', "value": 'PRESS'}, None),
("outliner.show_one_level", {"type": 'NUMPAD_MINUS', "value": 'PRESS'},
@@ -570,8 +574,8 @@ def km_uv_editor(params):
("uv.select_loop", {"type": 'LEFTMOUSE', "value": 'DOUBLE_CLICK'},
{"properties": [("extend", False)]}),
("uv.select_linked", {"type": 'RIGHT_BRACKET', "value": 'PRESS'}, None),
- ("uv.select_more", {"type": 'UP_ARROW', "value": 'PRESS'}, None),
- ("uv.select_less", {"type": 'DOWN_ARROW', "value": 'PRESS'}, None),
+ ("uv.select_more", {"type": 'UP_ARROW', "value": 'PRESS', "repeat": True}, None),
+ ("uv.select_less", {"type": 'DOWN_ARROW', "value": 'PRESS', "repeat": True}, None),
("uv.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True}, {"properties": [("action", 'SELECT')]}),
("uv.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True, "shift": True}, {"properties": [("action", 'DESELECT')]}),
("uv.select_all", {"type": 'I', "value": 'PRESS', "ctrl": True}, {"properties": [("action", 'INVERT')]}),
@@ -649,9 +653,9 @@ def km_view3d(params):
("view3d.zoom", {"type": 'TRACKPADZOOM', "value": 'ANY'}, None),
("view3d.zoom", {"type": 'TRACKPADPAN', "value": 'ANY', "ctrl": True}, None),
# Numpad
- ("view3d.zoom", {"type": 'NUMPAD_PLUS', "value": 'PRESS'},
+ ("view3d.zoom", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "repeat": True},
{"properties": [("delta", 1)]}),
- ("view3d.zoom", {"type": 'NUMPAD_MINUS', "value": 'PRESS'},
+ ("view3d.zoom", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "repeat": True},
{"properties": [("delta", -1)]}),
("view3d.zoom", {"type": 'WHEELINMOUSE', "value": 'PRESS'},
{"properties": [("delta", 1)]}),
@@ -661,9 +665,9 @@ def km_view3d(params):
{"properties": [("delta", 1)]}),
("view3d.zoom", {"type": 'WHEELOUTMOUSE', "value": 'PRESS', "alt": True},
{"properties": [("delta", -1)]}),
- ("view3d.dolly", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "shift": True},
+ ("view3d.dolly", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "shift": True, "repeat": True},
{"properties": [("delta", 1)]}),
- ("view3d.dolly", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "shift": True},
+ ("view3d.dolly", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "shift": True, "repeat": True},
{"properties": [("delta", -1)]}),
("view3d.view_all", {"type": 'A', "value": 'PRESS'},
{"properties": [("center", False)]}),
@@ -777,8 +781,8 @@ def km_mask_editing(params):
{"properties": [("mode", 'ADD')]}),
("mask.select_lasso", {"type": params.action_tweak, "value": 'ANY', "shift": True, "ctrl": True, "alt": True},
{"properties": [("mode", 'SUB')]}),
- ("mask.select_more", {"type": 'UP_ARROW', "value": 'PRESS'}, None),
- ("mask.select_less", {"type": 'DOWN_ARROW', "value": 'PRESS'}, None),
+ ("mask.select_more", {"type": 'UP_ARROW', "value": 'PRESS', "repeat": True}, None),
+ ("mask.select_less", {"type": 'DOWN_ARROW', "value": 'PRESS', "repeat": True}, None),
("mask.hide_view_clear", {"type": 'H', "value": 'PRESS', "alt": True}, None),
("mask.hide_view_set", {"type": 'H', "value": 'PRESS', "ctrl": True},
{"properties": [("unselected", False)]}),
@@ -903,8 +907,8 @@ def km_graph_editor(params):
{"properties":[("tweak", True), ("axis_range", False), ("mode", 'ADD')]}),
("graph.select_box", {"type": 'EVT_TWEAK_L', "value": 'ANY', "ctrl": True},
{"properties":[("tweak", True), ("axis_range", False), ("mode", 'SUB')]}),
- ("graph.select_more", {"type": 'UP_ARROW', "value": 'PRESS'}, None),
- ("graph.select_less", {"type": 'DOWN_ARROW', "value": 'PRESS'}, None),
+ ("graph.select_more", {"type": 'UP_ARROW', "value": 'PRESS', "repeat": True}, None),
+ ("graph.select_less", {"type": 'DOWN_ARROW', "value": 'PRESS', "repeat": True}, None),
("graph.select_linked", {"type": 'RIGHT_BRACKET', "value": 'PRESS'}, None),
op_menu("GRAPH_MT_delete", {"type": 'BACK_SPACE', "value": 'PRESS'}),
op_menu("GRAPH_MT_delete", {"type": 'DEL', "value": 'PRESS'}),
@@ -982,8 +986,8 @@ def km_image(params):
("image.view_zoom_out", {"type": 'WHEELOUTMOUSE', "value": 'PRESS'}, None),
("image.view_zoom_in", {"type": 'WHEELINMOUSE', "value": 'PRESS', "alt": True}, None),
("image.view_zoom_out", {"type": 'WHEELOUTMOUSE', "value": 'PRESS', "alt": True}, None),
- ("image.view_zoom_in", {"type": 'NUMPAD_PLUS', "value": 'PRESS'}, None),
- ("image.view_zoom_out", {"type": 'NUMPAD_MINUS', "value": 'PRESS'}, None),
+ ("image.view_zoom_in", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "repeat": True}, None),
+ ("image.view_zoom_out", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "repeat": True}, None),
("image.view_zoom", {"type": 'RIGHTMOUSE', "value": 'PRESS', "alt": True}, None),
("image.view_zoom", {"type": 'TRACKPADZOOM', "value": 'ANY'}, None),
("image.view_zoom", {"type": 'TRACKPADPAN', "value": 'ANY', "ctrl": True}, None),
@@ -1213,17 +1217,17 @@ def km_file_browser(params):
("wm.context_toggle", {"type": 'T', "value": 'PRESS'},
{"properties": [("data_path", 'space_data.show_region_toolbar')]}),
("file.bookmark_add", {"type": 'B', "value": 'PRESS', "ctrl": True}, None),
- ("file.filenum", {"type": 'NUMPAD_PLUS', "value": 'PRESS'},
+ ("file.filenum", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "repeat": True},
{"properties": [("increment", 1)]}),
- ("file.filenum", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "shift": True},
+ ("file.filenum", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "shift": True, "repeat": True},
{"properties": [("increment", 10)]}),
- ("file.filenum", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True},
+ ("file.filenum", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True, "repeat": True},
{"properties": [("increment", 100)]}),
- ("file.filenum", {"type": 'NUMPAD_MINUS', "value": 'PRESS'},
+ ("file.filenum", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "repeat": True},
{"properties": [("increment", -1)]}),
- ("file.filenum", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "shift": True},
+ ("file.filenum", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "shift": True, "repeat": True},
{"properties": [("increment", -10)]}),
- ("file.filenum", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True},
+ ("file.filenum", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True, "repeat": True},
{"properties": [("increment", -100)]}),
*_template_items_context_menu("FILEBROWSER_MT_context_menu", {"type": 'RIGHTMOUSE', "value": 'PRESS'}),
])
@@ -1301,17 +1305,17 @@ def km_file_browser_buttons(params):
)
items.extend([
- ("file.filenum", {"type": 'NUMPAD_PLUS', "value": 'PRESS'},
+ ("file.filenum", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "repeat": True},
{"properties": [("increment", 1)]}),
- ("file.filenum", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "shift": True},
+ ("file.filenum", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "shift": True, "repeat": True},
{"properties": [("increment", 10)]}),
- ("file.filenum", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True},
+ ("file.filenum", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True, "repeat": True},
{"properties": [("increment", 100)]}),
- ("file.filenum", {"type": 'NUMPAD_MINUS', "value": 'PRESS'},
+ ("file.filenum", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "repeat": True},
{"properties": [("increment", -1)]}),
- ("file.filenum", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "shift": True},
+ ("file.filenum", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "shift": True, "repeat": True},
{"properties": [("increment", -10)]}),
- ("file.filenum", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True},
+ ("file.filenum", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True, "repeat": True},
{"properties": [("increment", -100)]}),
])
@@ -1385,8 +1389,8 @@ def km_dopesheet(params):
{"properties": [("mode", 'MARKERS_COLUMN')]}),
("action.select_column", {"type": 'K', "value": 'PRESS', "alt": True},
{"properties": [("mode", 'MARKERS_BETWEEN')]}),
- ("action.select_more", {"type": 'UP_ARROW', "value": 'PRESS', "ctrl": True}, None),
- ("action.select_less", {"type": 'DOWN_ARROW', "value": 'PRESS', "ctrl": True}, None),
+ ("action.select_more", {"type": 'UP_ARROW', "value": 'PRESS', "ctrl": True, "repeat": True}, None),
+ ("action.select_less", {"type": 'DOWN_ARROW', "value": 'PRESS', "ctrl": True, "repeat": True}, None),
("action.select_linked", {"type": 'RIGHT_BRACKET', "value": 'PRESS'}, None),
("action.frame_jump", {"type": 'G', "value": 'PRESS', "ctrl": True}, None),
("wm.context_menu_enum", {"type": 'X', "value": 'PRESS'},
@@ -1584,9 +1588,9 @@ def km_text(params):
{"properties": [("data_path", 'space_data.font_size'), ("reverse", False)]}),
("wm.context_cycle_int", {"type": 'WHEELDOWNMOUSE', "value": 'PRESS', "ctrl": True},
{"properties": [("data_path", 'space_data.font_size'), ("reverse", True)]}),
- ("wm.context_cycle_int", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True},
+ ("wm.context_cycle_int", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True, "repeat": True},
{"properties": [("data_path", 'space_data.font_size'), ("reverse", False)]}),
- ("wm.context_cycle_int", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True},
+ ("wm.context_cycle_int", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True, "repeat": True},
{"properties": [("data_path", 'space_data.font_size'), ("reverse", True)]}),
("text.new", {"type": 'N', "value": 'PRESS', "ctrl": True}, None),
])
@@ -1603,16 +1607,16 @@ def km_text(params):
("text.cut", {"type": 'DEL', "value": 'PRESS', "shift": True}, None),
("text.copy", {"type": 'INSERT', "value": 'PRESS', "ctrl": True}, None),
("text.paste", {"type": 'INSERT', "value": 'PRESS', "shift": True}, None),
- ("text.duplicate_line", {"type": 'D', "value": 'PRESS', "ctrl": True}, None),
+ ("text.duplicate_line", {"type": 'D', "value": 'PRESS', "ctrl": True, "repeat": True}, None),
("text.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True}, None),
("text.select_line", {"type": 'A', "value": 'PRESS', "shift": True, "ctrl": True}, None),
("text.select_word", {"type": 'LEFTMOUSE', "value": 'DOUBLE_CLICK'}, None),
- ("text.move_lines", {"type": 'UP_ARROW', "value": 'PRESS', "shift": True, "ctrl": True},
+ ("text.move_lines", {"type": 'UP_ARROW', "value": 'PRESS', "shift": True, "ctrl": True, "repeat": True},
{"properties": [("direction", 'UP')]}),
- ("text.move_lines", {"type": 'DOWN_ARROW', "value": 'PRESS', "shift": True, "ctrl": True},
+ ("text.move_lines", {"type": 'DOWN_ARROW', "value": 'PRESS', "shift": True, "ctrl": True, "repeat": True},
{"properties": [("direction", 'DOWN')]}),
- ("text.indent_or_autocomplete", {"type": 'TAB', "value": 'PRESS'}, None),
- ("text.unindent", {"type": 'TAB', "value": 'PRESS', "shift": True}, None),
+ ("text.indent_or_autocomplete", {"type": 'TAB', "value": 'PRESS', "repeat": True}, None),
+ ("text.unindent", {"type": 'TAB', "value": 'PRESS', "shift": True, "repeat": True}, None),
("text.uncomment", {"type": 'D', "value": 'PRESS', "shift": True, "ctrl": True}, None),
("text.move", {"type": 'HOME', "value": 'PRESS'},
{"properties": [("type", 'LINE_BEGIN')]}),
@@ -1622,21 +1626,21 @@ def km_text(params):
{"properties": [("type", 'LINE_END')]}),
("text.move", {"type": 'E', "value": 'PRESS', "shift": True, "ctrl": True},
{"properties": [("type", 'LINE_END')]}),
- ("text.move", {"type": 'LEFT_ARROW', "value": 'PRESS'},
+ ("text.move", {"type": 'LEFT_ARROW', "value": 'PRESS', "repeat": True},
{"properties": [("type", 'PREVIOUS_CHARACTER')]}),
- ("text.move", {"type": 'RIGHT_ARROW', "value": 'PRESS'},
+ ("text.move", {"type": 'RIGHT_ARROW', "value": 'PRESS', "repeat": True},
{"properties": [("type", 'NEXT_CHARACTER')]}),
- ("text.move", {"type": 'LEFT_ARROW', "value": 'PRESS', "ctrl": True},
+ ("text.move", {"type": 'LEFT_ARROW', "value": 'PRESS', "ctrl": True, "repeat": True},
{"properties": [("type", 'PREVIOUS_WORD')]}),
- ("text.move", {"type": 'RIGHT_ARROW', "value": 'PRESS', "ctrl": True},
+ ("text.move", {"type": 'RIGHT_ARROW', "value": 'PRESS', "ctrl": True, "repeat": True},
{"properties": [("type", 'NEXT_WORD')]}),
- ("text.move", {"type": 'UP_ARROW', "value": 'PRESS'},
+ ("text.move", {"type": 'UP_ARROW', "value": 'PRESS', "repeat": True},
{"properties": [("type", 'PREVIOUS_LINE')]}),
- ("text.move", {"type": 'DOWN_ARROW', "value": 'PRESS'},
+ ("text.move", {"type": 'DOWN_ARROW', "value": 'PRESS', "repeat": True},
{"properties": [("type", 'NEXT_LINE')]}),
- ("text.move", {"type": 'PAGE_UP', "value": 'PRESS'},
+ ("text.move", {"type": 'PAGE_UP', "value": 'PRESS', "repeat": True},
{"properties": [("type", 'PREVIOUS_PAGE')]}),
- ("text.move", {"type": 'PAGE_DOWN', "value": 'PRESS'},
+ ("text.move", {"type": 'PAGE_DOWN', "value": 'PRESS', "repeat": True},
{"properties": [("type", 'NEXT_PAGE')]}),
("text.move", {"type": 'HOME', "value": 'PRESS', "ctrl": True},
{"properties": [("type", 'FILE_TOP')]}),
@@ -1646,33 +1650,33 @@ def km_text(params):
{"properties": [("type", 'LINE_BEGIN')]}),
("text.move_select", {"type": 'END', "value": 'PRESS', "shift": True},
{"properties": [("type", 'LINE_END')]}),
- ("text.move_select", {"type": 'LEFT_ARROW', "value": 'PRESS', "shift": True},
+ ("text.move_select", {"type": 'LEFT_ARROW', "value": 'PRESS', "shift": True, "repeat": True},
{"properties": [("type", 'PREVIOUS_CHARACTER')]}),
- ("text.move_select", {"type": 'RIGHT_ARROW', "value": 'PRESS', "shift": True},
+ ("text.move_select", {"type": 'RIGHT_ARROW', "value": 'PRESS', "shift": True, "repeat": True},
{"properties": [("type", 'NEXT_CHARACTER')]}),
- ("text.move_select", {"type": 'LEFT_ARROW', "value": 'PRESS', "shift": True, "ctrl": True},
+ ("text.move_select", {"type": 'LEFT_ARROW', "value": 'PRESS', "shift": True, "ctrl": True, "repeat": True},
{"properties": [("type", 'PREVIOUS_WORD')]}),
- ("text.move_select", {"type": 'RIGHT_ARROW', "value": 'PRESS', "shift": True, "ctrl": True},
+ ("text.move_select", {"type": 'RIGHT_ARROW', "value": 'PRESS', "shift": True, "ctrl": True, "repeat": True},
{"properties": [("type", 'NEXT_WORD')]}),
- ("text.move_select", {"type": 'UP_ARROW', "value": 'PRESS', "shift": True},
+ ("text.move_select", {"type": 'UP_ARROW', "value": 'PRESS', "shift": True, "repeat": True},
{"properties": [("type", 'PREVIOUS_LINE')]}),
- ("text.move_select", {"type": 'DOWN_ARROW', "value": 'PRESS', "shift": True},
+ ("text.move_select", {"type": 'DOWN_ARROW', "value": 'PRESS', "shift": True, "repeat": True},
{"properties": [("type", 'NEXT_LINE')]}),
- ("text.move_select", {"type": 'PAGE_UP', "value": 'PRESS', "shift": True},
+ ("text.move_select", {"type": 'PAGE_UP', "value": 'PRESS', "shift": True, "repeat": True},
{"properties": [("type", 'PREVIOUS_PAGE')]}),
- ("text.move_select", {"type": 'PAGE_DOWN', "value": 'PRESS', "shift": True},
+ ("text.move_select", {"type": 'PAGE_DOWN', "value": 'PRESS', "shift": True, "repeat": True},
{"properties": [("type", 'NEXT_PAGE')]}),
("text.move_select", {"type": 'HOME', "value": 'PRESS', "shift": True, "ctrl": True},
{"properties": [("type", 'FILE_TOP')]}),
("text.move_select", {"type": 'END', "value": 'PRESS', "shift": True, "ctrl": True},
{"properties": [("type", 'FILE_BOTTOM')]}),
- ("text.delete", {"type": 'DEL', "value": 'PRESS'},
+ ("text.delete", {"type": 'DEL', "value": 'PRESS', "repeat": True},
{"properties": [("type", 'NEXT_CHARACTER')]}),
- ("text.delete", {"type": 'BACK_SPACE', "value": 'PRESS'},
+ ("text.delete", {"type": 'BACK_SPACE', "value": 'PRESS', "repeat": True},
{"properties": [("type", 'PREVIOUS_CHARACTER')]}),
- ("text.delete", {"type": 'BACK_SPACE', "value": 'PRESS', "shift": True},
+ ("text.delete", {"type": 'BACK_SPACE', "value": 'PRESS', "shift": True, "repeat": True},
{"properties": [("type", 'PREVIOUS_CHARACTER')]}),
- ("text.delete", {"type": 'DEL', "value": 'PRESS', "ctrl": True},
+ ("text.delete", {"type": 'DEL', "value": 'PRESS', "ctrl": True, "repeat": True},
{"properties": [("type", 'NEXT_WORD')]}),
("text.delete", {"type": 'BACK_SPACE', "value": 'PRESS', "ctrl": True},
{"properties": [("type", 'PREVIOUS_WORD')]}),
@@ -1688,11 +1692,11 @@ def km_text(params):
{"properties": [("lines", -1)]}),
("text.scroll", {"type": 'WHEELDOWNMOUSE', "value": 'PRESS'},
{"properties": [("lines", 1)]}),
- ("text.line_break", {"type": 'RET', "value": 'PRESS'}, None),
- ("text.line_break", {"type": 'NUMPAD_ENTER', "value": 'PRESS'}, None),
+ ("text.line_break", {"type": 'RET', "value": 'PRESS', "repeat": True}, None),
+ ("text.line_break", {"type": 'NUMPAD_ENTER', "value": 'PRESS', "repeat": True}, None),
*_template_items_context_menu("TEXT_MT_context_menu", {"type": 'RIGHTMOUSE', "value": 'PRESS', "any": True}),
("text.line_number", {"type": 'TEXTINPUT', "value": 'ANY', "any": True}, None),
- ("text.insert", {"type": 'TEXTINPUT', "value": 'ANY', "any": True}, None),
+ ("text.insert", {"type": 'TEXTINPUT', "value": 'ANY', "any": True, "repeat": True}, None),
])
return keymap
@@ -1759,17 +1763,17 @@ def km_sequencer(params):
("sequencer.view_all", {"type": 'NDOF_BUTTON_FIT', "value": 'PRESS'}, None),
("sequencer.view_selected", {"type": 'F', "value": 'PRESS'}, None),
("sequencer.view_frame", {"type": 'NUMPAD_0', "value": 'PRESS'}, None),
- ("sequencer.strip_jump", {"type": 'PAGE_UP', "value": 'PRESS'},
+ ("sequencer.strip_jump", {"type": 'PAGE_UP', "value": 'PRESS', "repeat": True},
{"properties": [("next", True), ("center", False)]}),
- ("sequencer.strip_jump", {"type": 'PAGE_DOWN', "value": 'PRESS'},
+ ("sequencer.strip_jump", {"type": 'PAGE_DOWN', "value": 'PRESS', "repeat": True},
{"properties": [("next", False), ("center", False)]}),
- ("sequencer.strip_jump", {"type": 'PAGE_UP', "value": 'PRESS', "alt": True},
+ ("sequencer.strip_jump", {"type": 'PAGE_UP', "value": 'PRESS', "alt": True, "repeat": True},
{"properties": [("next", True), ("center", True)]}),
- ("sequencer.strip_jump", {"type": 'PAGE_DOWN', "value": 'PRESS', "alt": True},
+ ("sequencer.strip_jump", {"type": 'PAGE_DOWN', "value": 'PRESS', "alt": True, "repeat": True},
{"properties": [("next", False), ("center", True)]}),
- ("sequencer.swap", {"type": 'LEFT_ARROW', "value": 'PRESS', "alt": True},
+ ("sequencer.swap", {"type": 'LEFT_ARROW', "value": 'PRESS', "alt": True, "repeat": True},
{"properties": [("side", 'LEFT')]}),
- ("sequencer.swap", {"type": 'RIGHT_ARROW', "value": 'PRESS', "alt": True},
+ ("sequencer.swap", {"type": 'RIGHT_ARROW', "value": 'PRESS', "alt": True, "repeat": True},
{"properties": [("side", 'RIGHT')]}),
("sequencer.gap_remove", {"type": 'BACK_SPACE', "value": 'PRESS'},
{"properties": [("all", False)]}),
@@ -1797,8 +1801,8 @@ def km_sequencer(params):
{"properties": [("side_of_frame", True), ("linked_time", True)]}),
("sequencer.select", {"type": 'LEFTMOUSE', "value": 'PRESS', "shift": True, "ctrl": True},
{"properties": [("extend", True), ("side_of_frame", True), ("linked_time", True)]}),
- ("sequencer.select_more", {"type": 'UP_ARROW', "value": 'PRESS'}, None),
- ("sequencer.select_less", {"type": 'DOWN_ARROW', "value": 'PRESS'}, None),
+ ("sequencer.select_more", {"type": 'UP_ARROW', "value": 'PRESS', "repeat": True}, None),
+ ("sequencer.select_less", {"type": 'DOWN_ARROW', "value": 'PRESS', "repeat": True}, None),
("sequencer.select_linked_pick", {"type": 'RIGHT_BRACKET', "value": 'PRESS'},
{"properties": [("extend", False)]}),
("sequencer.select_linked_pick", {"type": 'RIGHT_BRACKET', "value": 'PRESS', "shift": True},
@@ -1860,9 +1864,9 @@ def km_console(params):
)
items.extend([
- ("console.move", {"type": 'LEFT_ARROW', "value": 'PRESS', "ctrl": True},
+ ("console.move", {"type": 'LEFT_ARROW', "value": 'PRESS', "ctrl": True, "repeat": True},
{"properties": [("type", 'PREVIOUS_WORD')]}),
- ("console.move", {"type": 'RIGHT_ARROW', "value": 'PRESS', "ctrl": True},
+ ("console.move", {"type": 'RIGHT_ARROW', "value": 'PRESS', "ctrl": True, "repeat": True},
{"properties": [("type", 'NEXT_WORD')]}),
("console.move", {"type": 'HOME', "value": 'PRESS'},
{"properties": [("type", 'LINE_BEGIN')]}),
@@ -1872,27 +1876,27 @@ def km_console(params):
{"properties": [("data_path", 'space_data.font_size'), ("reverse", False)]}),
("wm.context_cycle_int", {"type": 'WHEELDOWNMOUSE', "value": 'PRESS', "ctrl": True},
{"properties": [("data_path", 'space_data.font_size'), ("reverse", True)]}),
- ("wm.context_cycle_int", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True},
+ ("wm.context_cycle_int", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True, "repeat": True},
{"properties": [("data_path", 'space_data.font_size'), ("reverse", False)]}),
- ("wm.context_cycle_int", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True},
+ ("wm.context_cycle_int", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True, "repeat": True},
{"properties": [("data_path", 'space_data.font_size'), ("reverse", True)]}),
- ("console.move", {"type": 'LEFT_ARROW', "value": 'PRESS'},
+ ("console.move", {"type": 'LEFT_ARROW', "value": 'PRESS', "repeat": True},
{"properties": [("type", 'PREVIOUS_CHARACTER')]}),
- ("console.move", {"type": 'RIGHT_ARROW', "value": 'PRESS'},
+ ("console.move", {"type": 'RIGHT_ARROW', "value": 'PRESS', "repeat": True},
{"properties": [("type", 'NEXT_CHARACTER')]}),
- ("console.history_cycle", {"type": 'UP_ARROW', "value": 'PRESS'},
+ ("console.history_cycle", {"type": 'UP_ARROW', "value": 'PRESS', "repeat": True},
{"properties": [("reverse", True)]}),
- ("console.history_cycle", {"type": 'DOWN_ARROW', "value": 'PRESS'},
+ ("console.history_cycle", {"type": 'DOWN_ARROW', "value": 'PRESS', "repeat": True},
{"properties": [("reverse", False)]}),
- ("console.delete", {"type": 'DEL', "value": 'PRESS'},
+ ("console.delete", {"type": 'DEL', "value": 'PRESS', "repeat": True},
{"properties": [("type", 'NEXT_CHARACTER')]}),
- ("console.delete", {"type": 'BACK_SPACE', "value": 'PRESS'},
- {"properties": [("type", 'PREVIOUS_CHARACTER')]}),
- ("console.delete", {"type": 'BACK_SPACE', "value": 'PRESS', "shift": True},
+ ("console.delete", {"type": 'BACK_SPACE', "value": 'PRESS', "repeat": True},
{"properties": [("type", 'PREVIOUS_CHARACTER')]}),
- ("console.delete", {"type": 'DEL', "value": 'PRESS', "ctrl": True},
+ ("console.delete", {"type": 'BACK_SPACE', "value": 'PRESS', "shift": True, "repeat": True},
+ {"properties": [("type", 'PREVIOUS_CHARACTER')], "repeat": True}),
+ ("console.delete", {"type": 'DEL', "value": 'PRESS', "ctrl": True, "repeat": True},
{"properties": [("type", 'NEXT_WORD')]}),
- ("console.delete", {"type": 'BACK_SPACE', "value": 'PRESS', "ctrl": True},
+ ("console.delete", {"type": 'BACK_SPACE', "value": 'PRESS', "ctrl": True, "repeat": True},
{"properties": [("type", 'PREVIOUS_WORD')]}),
("console.clear_line", {"type": 'RET', "value": 'PRESS', "shift": True}, None),
("console.clear_line", {"type": 'NUMPAD_ENTER', "value": 'PRESS', "shift": True}, None),
@@ -1905,12 +1909,12 @@ def km_console(params):
("console.paste", {"type": 'V', "value": 'PRESS', "ctrl": True}, None),
("console.select_set", {"type": 'LEFTMOUSE', "value": 'PRESS'}, None),
("console.select_word", {"type": 'LEFTMOUSE', "value": 'DOUBLE_CLICK'}, None),
- ("console.insert", {"type": 'TAB', "value": 'PRESS', "ctrl": True},
+ ("console.insert", {"type": 'TAB', "value": 'PRESS', "ctrl": True, "repeat": True},
{"properties": [("text", '\t')]}),
- ("console.indent_or_autocomplete", {"type": 'TAB', "value": 'PRESS'}, None),
- ("console.unindent", {"type": 'TAB', "value": 'PRESS', "shift": True}, None),
+ ("console.indent_or_autocomplete", {"type": 'TAB', "value": 'PRESS', "repeat": True}, None),
+ ("console.unindent", {"type": 'TAB', "value": 'PRESS', "shift": True, "repeat": True}, None),
*_template_items_context_menu("CONSOLE_MT_context_menu", {"type": 'RIGHTMOUSE', "value": 'PRESS'}),
- ("console.insert", {"type": 'TEXTINPUT', "value": 'ANY', "any": True}, None),
+ ("console.insert", {"type": 'TEXTINPUT', "value": 'ANY', "any": True, "repeat": True}, None),
])
return keymap
@@ -1928,9 +1932,9 @@ def km_clip(params):
op_panel("TOPBAR_PT_name", {"type": 'RET', "value": 'PRESS'}, [("keep_open", False)]),
("wm.search_menu", {"type": 'TAB', "value": 'PRESS'}, None),
("clip.open", {"type": 'O', "value": 'PRESS', "alt": True}, None),
- ("clip.track_markers", {"type": 'LEFT_ARROW', "value": 'PRESS', "alt": True},
+ ("clip.track_markers", {"type": 'LEFT_ARROW', "value": 'PRESS', "alt": True, "repeat": True},
{"properties": [("backwards", True), ("sequence", False)]}),
- ("clip.track_markers", {"type": 'RIGHT_ARROW', "value": 'PRESS', "alt": True},
+ ("clip.track_markers", {"type": 'RIGHT_ARROW', "value": 'PRESS', "alt": True, "repeat": True},
{"properties": [("backwards", False), ("sequence", False)]}),
("clip.track_markers", {"type": 'T', "value": 'PRESS', "ctrl": True},
{"properties": [("backwards", False), ("sequence", True)]}),
@@ -1965,8 +1969,8 @@ def km_clip_editor(params):
("clip.view_zoom_out", {"type": 'WHEELOUTMOUSE', "value": 'PRESS'}, None),
("clip.view_zoom_in", {"type": 'WHEELINMOUSE', "value": 'PRESS', "alt": True}, None),
("clip.view_zoom_out", {"type": 'WHEELOUTMOUSE', "value": 'PRESS', "alt": True}, None),
- ("clip.view_zoom_in", {"type": 'NUMPAD_PLUS', "value": 'PRESS'}, None),
- ("clip.view_zoom_out", {"type": 'NUMPAD_MINUS', "value": 'PRESS'}, None),
+ ("clip.view_zoom_in", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "repeat": True}, None),
+ ("clip.view_zoom_out", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "repeat": True}, None),
("clip.view_zoom_ratio", {"type": 'NUMPAD_8', "value": 'PRESS', "ctrl": True},
{"properties": [("ratio", 8.0)]}),
("clip.view_zoom_ratio", {"type": 'NUMPAD_4', "value": 'PRESS', "ctrl": True},
@@ -1991,13 +1995,13 @@ def km_clip_editor(params):
("clip.view_selected", {"type": 'F', "value": 'PRESS'}, None),
("clip.view_all", {"type": 'NDOF_BUTTON_FIT', "value": 'PRESS'}, None),
("clip.view_ndof", {"type": 'NDOF_MOTION', "value": 'ANY'}, None),
- ("clip.frame_jump", {"type": 'LEFT_ARROW', "value": 'PRESS', "shift": True, "ctrl": True},
+ ("clip.frame_jump", {"type": 'LEFT_ARROW', "value": 'PRESS', "shift": True, "ctrl": True, "repeat": True},
{"properties": [("position", 'PATHSTART')]}),
- ("clip.frame_jump", {"type": 'RIGHT_ARROW', "value": 'PRESS', "shift": True, "ctrl": True},
+ ("clip.frame_jump", {"type": 'RIGHT_ARROW', "value": 'PRESS', "shift": True, "ctrl": True, "repeat": True},
{"properties": [("position", 'PATHEND')]}),
- ("clip.frame_jump", {"type": 'LEFT_ARROW', "value": 'PRESS', "shift": True, "alt": True},
+ ("clip.frame_jump", {"type": 'LEFT_ARROW', "value": 'PRESS', "shift": True, "alt": True, "repeat": True},
{"properties": [("position", 'FAILEDPREV')]}),
- ("clip.frame_jump", {"type": 'RIGHT_ARROW', "value": 'PRESS', "shift": True, "alt": True},
+ ("clip.frame_jump", {"type": 'RIGHT_ARROW', "value": 'PRESS', "shift": True, "alt": True, "repeat": True},
{"properties": [("position", 'PATHSTART')]}),
("clip.change_frame", {"type": 'LEFTMOUSE', "value": 'PRESS'}, None),
("clip.select", {"type": 'LEFTMOUSE', "value": 'PRESS'},
@@ -2139,7 +2143,7 @@ def km_frames(params):
{"properties": [("end", True)]}),
("screen.frame_jump", {"type": 'MEDIA_FIRST', "value": 'PRESS'},
{"properties": [("end", False)]}),
- ("screen.animation_play", {"type": 'SPACE', "value": 'PRESS', "repeat": False}, None),
+ ("screen.animation_play", {"type": 'SPACE', "value": 'PRESS'}, None),
("screen.animation_cancel", {"type": 'ESC', "value": 'PRESS'}, None),
("screen.animation_play", {"type": 'MEDIA_PLAY', "value": 'PRESS'}, None),
("screen.animation_cancel", {"type": 'MEDIA_STOP', "value": 'PRESS'}, None),
@@ -2214,9 +2218,9 @@ def km_animation_channels(params):
("anim.channels_collapse", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True},
{"properties": [("all", False)]}),
# Move.
- ("anim.channels_move", {"type": 'PAGE_UP', "value": 'PRESS'},
+ ("anim.channels_move", {"type": 'PAGE_UP', "value": 'PRESS', "repeat": True},
{"properties": [("direction", 'UP')]}),
- ("anim.channels_move", {"type": 'PAGE_DOWN', "value": 'PRESS'},
+ ("anim.channels_move", {"type": 'PAGE_DOWN', "value": 'PRESS', "repeat": True},
{"properties": [("direction", 'DOWN')]}),
("anim.channels_move", {"type": 'PAGE_UP', "value": 'PRESS', "shift": True},
{"properties": [("direction", 'TOP')]}),
@@ -2268,8 +2272,8 @@ def _grease_pencil_selection(params):
# Select grouped
("gpencil.select_grouped", {"type": 'G', "value": 'PRESS', "shift": True}, None),
# Select more/less
- ("gpencil.select_more", {"type": 'UP_ARROW', "value": 'PRESS'}, None),
- ("gpencil.select_less", {"type": 'DOWN_ARROW', "value": 'PRESS'}, None),
+ ("gpencil.select_more", {"type": 'UP_ARROW', "value": 'PRESS', "repeat": True}, None),
+ ("gpencil.select_less", {"type": 'DOWN_ARROW', "value": 'PRESS', "repeat": True}, None),
]
@@ -2957,13 +2961,13 @@ def km_pose(params):
("pose.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True, "shift": True}, {"properties": [("action", 'DESELECT')]}),
("pose.select_all", {"type": 'I', "value": 'PRESS', "ctrl": True}, {"properties": [("action", 'INVERT')]}),
("pose.select_parent", {"type": 'UP_ARROW', "value": 'PRESS', "ctrl": True}, None),
- ("pose.select_hierarchy", {"type": 'UP_ARROW', "value": 'PRESS'},
+ ("pose.select_hierarchy", {"type": 'UP_ARROW', "value": 'PRESS', "repeat": True},
{"properties": [("direction", 'PARENT'), ("extend", False)]}),
- ("pose.select_hierarchy", {"type": 'UP_ARROW', "value": 'PRESS', "shift": True},
+ ("pose.select_hierarchy", {"type": 'UP_ARROW', "value": 'PRESS', "shift": True, "repeat": True},
{"properties": [("direction", 'PARENT'), ("extend", True)]}),
- ("pose.select_hierarchy", {"type": 'DOWN_ARROW', "value": 'PRESS'},
+ ("pose.select_hierarchy", {"type": 'DOWN_ARROW', "value": 'PRESS', "repeat": True},
{"properties": [("direction", 'CHILD'), ("extend", False)]}),
- ("pose.select_hierarchy", {"type": 'DOWN_ARROW', "value": 'PRESS', "shift": True},
+ ("pose.select_hierarchy", {"type": 'DOWN_ARROW', "value": 'PRESS', "shift": True, "repeat": True},
{"properties": [("direction", 'CHILD'), ("extend", True)]}),
("pose.select_linked", {"type": 'RIGHT_BRACKET', "value": 'PRESS'}, None),
("pose.bone_layers", {"type": 'G', "value": 'PRESS'}, None),
@@ -3007,16 +3011,16 @@ def km_object_mode(params):
("object.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True}, {"properties": [("action", 'SELECT')]}),
("object.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True, "shift": True}, {"properties": [("action", 'DESELECT')]}),
("object.select_all", {"type": 'I', "value": 'PRESS', "ctrl": True}, {"properties": [("action", 'INVERT')]}),
- ("object.select_more", {"type": 'UP_ARROW', "value": 'PRESS'}, None),
- ("object.select_less", {"type": 'DOWN_ARROW', "value": 'PRESS'}, None),
+ ("object.select_more", {"type": 'UP_ARROW', "value": 'PRESS', "repeat": True}, None),
+ ("object.select_less", {"type": 'DOWN_ARROW', "value": 'PRESS', "repeat": True}, None),
("object.select_linked", {"type": 'RIGHT_BRACKET', "value": 'PRESS'}, None),
- ("object.select_hierarchy", {"type": 'LEFT_BRACKET', "value": 'PRESS'},
+ ("object.select_hierarchy", {"type": 'LEFT_BRACKET', "value": 'PRESS', "repeat": True},
{"properties": [("direction", 'PARENT'), ("extend", False)]}),
- ("object.select_hierarchy", {"type": 'LEFT_BRACKET', "value": 'PRESS', "shift": True},
+ ("object.select_hierarchy", {"type": 'LEFT_BRACKET', "value": 'PRESS', "shift": True, "repeat": True},
{"properties": [("direction", 'PARENT'), ("extend", True)]}),
- ("object.select_hierarchy", {"type": 'RIGHT_BRACKET', "value": 'PRESS'},
+ ("object.select_hierarchy", {"type": 'RIGHT_BRACKET', "value": 'PRESS', "repeat": True},
{"properties": [("direction", 'CHILD'), ("extend", False)]}),
- ("object.select_hierarchy", {"type": 'RIGHT_BRACKET', "value": 'PRESS', "shift": True},
+ ("object.select_hierarchy", {"type": 'RIGHT_BRACKET', "value": 'PRESS', "shift": True, "repeat": True},
{"properties": [("direction", 'CHILD'), ("extend", True)]}),
("object.parent_set", {"type": 'P', "value": 'PRESS'}, None),
@@ -3113,8 +3117,8 @@ def km_curve(params):
("curve.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True, "shift": True}, {"properties": [("action", 'DESELECT')]}),
("curve.select_all", {"type": 'I', "value": 'PRESS', "ctrl": True}, {"properties": [("action", 'INVERT')]}),
("curve.select_row", {"type": 'R', "value": 'PRESS', "shift": True}, None),
- ("curve.select_more", {"type": 'UP_ARROW', "value": 'PRESS'}, None),
- ("curve.select_less", {"type": 'DOWN_ARROW', "value": 'PRESS'}, None),
+ ("curve.select_more", {"type": 'UP_ARROW', "value": 'PRESS', "repeat": True}, None),
+ ("curve.select_less", {"type": 'DOWN_ARROW', "value": 'PRESS', "repeat": True}, None),
("curve.select_linked", {"type": 'RIGHT_BRACKET', "value": 'PRESS'}, None),
("curve.shortest_path_pick", {"type": 'LEFTMOUSE', "value": 'PRESS', "ctrl": True, "shift": True}, None),
("curve.duplicate_move", {"type": 'D', "value": 'PRESS', "ctrl": True}, None),
@@ -3208,9 +3212,9 @@ def km_image_paint(params):
("paint.sample_color", {"type": 'I', "value": 'PRESS'}, None),
("paint.brush_colors_flip", {"type": 'X', "value": 'PRESS'}, None),
("paint.grab_clone", {"type": 'MIDDLEMOUSE', "value": 'PRESS'}, None),
- ("brush.scale_size", {"type": 'LEFT_BRACKET', "value": 'PRESS'},
+ ("brush.scale_size", {"type": 'LEFT_BRACKET', "value": 'PRESS', "repeat": True},
{"properties": [("scalar", 0.9)]}),
- ("brush.scale_size", {"type": 'RIGHT_BRACKET', "value": 'PRESS'},
+ ("brush.scale_size", {"type": 'RIGHT_BRACKET', "value": 'PRESS', "repeat": True},
{"properties": [("scalar", 1.0 / 0.9)]}),
*_template_paint_radial_control("image_paint", color=True, zoom=True, rotation=True, secondary_rotation=True),
("brush.stencil_control", {"type": 'RIGHTMOUSE', "value": 'PRESS'},
@@ -3258,9 +3262,9 @@ def km_vertex_paint(params):
("paint.vertex_paint", {"type": 'LEFTMOUSE', "value": 'PRESS', "ctrl": True},
{"properties": [("mode", 'INVERT')]}),
("paint.brush_colors_flip", {"type": 'X', "value": 'PRESS'}, None),
- ("brush.scale_size", {"type": 'LEFT_BRACKET', "value": 'PRESS'},
+ ("brush.scale_size", {"type": 'LEFT_BRACKET', "value": 'PRESS', "repeat": True},
{"properties": [("scalar", 0.9)]}),
- ("brush.scale_size", {"type": 'RIGHT_BRACKET', "value": 'PRESS'},
+ ("brush.scale_size", {"type": 'RIGHT_BRACKET', "value": 'PRESS', "repeat": True},
{"properties": [("scalar", 1.0 / 0.9)]}),
*_template_paint_radial_control("vertex_paint", color=True, rotation=True),
("brush.stencil_control", {"type": 'RIGHTMOUSE', "value": 'PRESS'},
@@ -3303,9 +3307,9 @@ def km_weight_paint(params):
items.extend([
("paint.weight_paint", {"type": 'LEFTMOUSE', "value": 'PRESS'}, None),
("paint.weight_sample_group", {"type": 'LEFTMOUSE', "value": 'PRESS', "shift": True}, None),
- ("brush.scale_size", {"type": 'LEFT_BRACKET', "value": 'PRESS'},
+ ("brush.scale_size", {"type": 'LEFT_BRACKET', "value": 'PRESS', "repeat": True},
{"properties": [("scalar", 0.9)]}),
- ("brush.scale_size", {"type": 'RIGHT_BRACKET', "value": 'PRESS'},
+ ("brush.scale_size", {"type": 'RIGHT_BRACKET', "value": 'PRESS', "repeat": True},
{"properties": [("scalar", 1.0 / 0.9)]}),
*_template_paint_radial_control("weight_paint"),
("wm.context_toggle", {"type": 'M', "value": 'PRESS'},
@@ -3354,9 +3358,9 @@ def km_sculpt(params):
{"properties": [("action", 'SHOW'), ("area", 'ALL')]}),
# Subdivision levels
*_template_items_object_subdivision_set(),
- ("object.subdivision_set", {"type": 'PAGE_UP', "value": 'PRESS'},
+ ("object.subdivision_set", {"type": 'PAGE_UP', "value": 'PRESS', "repeat": True},
{"properties": [("level", 1), ("relative", True)]}),
- ("object.subdivision_set", {"type": 'PAGE_DOWN', "value": 'PRESS'},
+ ("object.subdivision_set", {"type": 'PAGE_DOWN', "value": 'PRESS', "repeat": True},
{"properties": [("level", -1), ("relative", True)]}),
# Mask
("paint.mask_flood_fill", {"type": 'A', "value": 'PRESS', "ctrl": True},
@@ -3381,9 +3385,9 @@ def km_sculpt(params):
("object.voxel_size_edit", {"type": 'R', "value": 'PRESS', "shift": True}, None),
("object.quadriflow_remesh", {"type": 'R', "value": 'PRESS', "ctrl": True, "alt": True}, None),
# Brush properties
- ("brush.scale_size", {"type": 'LEFT_BRACKET', "value": 'PRESS'},
+ ("brush.scale_size", {"type": 'LEFT_BRACKET', "value": 'PRESS', "repeat": True},
{"properties": [("scalar", 0.9)]}),
- ("brush.scale_size", {"type": 'RIGHT_BRACKET', "value": 'PRESS'},
+ ("brush.scale_size", {"type": 'RIGHT_BRACKET', "value": 'PRESS', "repeat": True},
{"properties": [("scalar", 1.0 / 0.9)]}),
*_template_paint_radial_control("sculpt", rotation=True),
# Stencil
@@ -3469,8 +3473,8 @@ def km_mesh(params):
("mesh.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True}, {"properties": [("action", 'SELECT')]}),
("mesh.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True, "shift": True}, {"properties": [("action", 'DESELECT')]}),
("mesh.select_all", {"type": 'I', "value": 'PRESS', "ctrl": True}, {"properties": [("action", 'INVERT')]}),
- ("mesh.select_more", {"type": 'UP_ARROW', "value": 'PRESS'}, None),
- ("mesh.select_less", {"type": 'DOWN_ARROW', "value": 'PRESS'}, None),
+ ("mesh.select_more", {"type": 'UP_ARROW', "value": 'PRESS', "repeat": True}, None),
+ ("mesh.select_less", {"type": 'DOWN_ARROW', "value": 'PRESS', "repeat": True}, None),
("mesh.select_linked", {"type": 'RIGHT_BRACKET', "value": 'PRESS'}, None),
*_template_items_editmode_mesh_select_mode(params),
@@ -3537,8 +3541,8 @@ def km_armature(params):
("armature.select_hierarchy", {"type": 'RIGHT_BRACKET', "value": 'PRESS', "shift": True},
{"properties": [("direction", 'CHILD'), ("extend", True)]}),
- ("armature.select_more", {"type": 'UP_ARROW', "value": 'PRESS'}, None),
- ("armature.select_less", {"type": 'DOWN_ARROW', "value": 'PRESS'}, None),
+ ("armature.select_more", {"type": 'UP_ARROW', "value": 'PRESS', "repeat": True}, None),
+ ("armature.select_less", {"type": 'DOWN_ARROW', "value": 'PRESS', "repeat": True}, None),
("armature.select_similar", {"type": 'G', "value": 'PRESS', "shift": True}, None),
("armature.select_linked_pick", {"type": 'RIGHT_BRACKET', "value": 'PRESS'},
@@ -3610,8 +3614,8 @@ def km_lattice(params):
("lattice.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True}, {"properties": [("action", 'SELECT')]}),
("lattice.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True, "shift": True}, {"properties": [("action", 'DESELECT')]}),
("lattice.select_all", {"type": 'I', "value": 'PRESS', "ctrl": True}, {"properties": [("action", 'INVERT')]}),
- ("lattice.select_more", {"type": 'UP_ARROW', "value": 'PRESS'}, None),
- ("lattice.select_less", {"type": 'DOWN_ARROW', "value": 'PRESS'}, None),
+ ("lattice.select_more", {"type": 'UP_ARROW', "value": 'PRESS', "repeat": True}, None),
+ ("lattice.select_less", {"type": 'DOWN_ARROW', "value": 'PRESS', "repeat": True}, None),
("object.vertex_parent_set", {"type": 'P', "value": 'PRESS', "ctrl": True}, None),
*_template_items_context_menu("VIEW3D_MT_edit_lattice_context_menu", {"type": 'RIGHTMOUSE', "value": 'PRESS'}),
("wm.context_toggle", {"type": 'B', "value": 'PRESS'},
@@ -3641,8 +3645,8 @@ def km_particle(params):
("particle.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True}, {"properties": [("action", 'SELECT')]}),
("particle.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True, "shift": True}, {"properties": [("action", 'DESELECT')]}),
("particle.select_all", {"type": 'I', "value": 'PRESS', "ctrl": True}, {"properties": [("action", 'INVERT')]}),
- ("particle.select_more", {"type": 'UP_ARROW', "value": 'PRESS'}, None),
- ("particle.select_less", {"type": 'DOWN_ARROW', "value": 'PRESS'}, None),
+ ("particle.select_more", {"type": 'UP_ARROW', "value": 'PRESS', "repeat": True}, None),
+ ("particle.select_less", {"type": 'DOWN_ARROW', "value": 'PRESS', "repeat": True}, None),
("particle.select_linked_pick", {"type": 'RIGHT_BRACKET', "value": 'PRESS'},
{"properties": [("deselect", False)]}),
("particle.select_linked_pick", {"type": 'RIGHT_BRACKET', "value": 'PRESS', "shift": True},
@@ -3687,63 +3691,63 @@ def km_font(params):
{"properties": [("style", 'UNDERLINE')]}),
("font.style_toggle", {"type": 'P', "value": 'PRESS', "ctrl": True},
{"properties": [("style", 'SMALL_CAPS')]}),
- ("font.delete", {"type": 'DEL', "value": 'PRESS'},
+ ("font.delete", {"type": 'DEL', "value": 'PRESS', "repeat": True},
{"properties": [("type", 'NEXT_OR_SELECTION')]}),
- ("font.delete", {"type": 'DEL', "value": 'PRESS', "ctrl": True},
+ ("font.delete", {"type": 'DEL', "value": 'PRESS', "ctrl": True, "repeat": True},
{"properties": [("type", 'NEXT_WORD')]}),
- ("font.delete", {"type": 'BACK_SPACE', "value": 'PRESS'},
+ ("font.delete", {"type": 'BACK_SPACE', "value": 'PRESS', "repeat": True},
{"properties": [("type", 'PREVIOUS_OR_SELECTION')]}),
- ("font.delete", {"type": 'BACK_SPACE', "value": 'PRESS', "shift": True},
+ ("font.delete", {"type": 'BACK_SPACE', "value": 'PRESS', "shift": True, "repeat": True},
{"properties": [("type", 'PREVIOUS_OR_SELECTION')]}),
- ("font.delete", {"type": 'BACK_SPACE', "value": 'PRESS', "ctrl": True},
+ ("font.delete", {"type": 'BACK_SPACE', "value": 'PRESS', "ctrl": True, "repeat": True},
{"properties": [("type", 'PREVIOUS_WORD')]}),
("font.move", {"type": 'HOME', "value": 'PRESS'},
{"properties": [("type", 'LINE_BEGIN')]}),
("font.move", {"type": 'END', "value": 'PRESS'},
{"properties": [("type", 'LINE_END')]}),
- ("font.move", {"type": 'LEFT_ARROW', "value": 'PRESS'},
+ ("font.move", {"type": 'LEFT_ARROW', "value": 'PRESS', "repeat": True},
{"properties": [("type", 'PREVIOUS_CHARACTER')]}),
- ("font.move", {"type": 'RIGHT_ARROW', "value": 'PRESS'},
+ ("font.move", {"type": 'RIGHT_ARROW', "value": 'PRESS', "repeat": True},
{"properties": [("type", 'NEXT_CHARACTER')]}),
- ("font.move", {"type": 'LEFT_ARROW', "value": 'PRESS', "ctrl": True},
+ ("font.move", {"type": 'LEFT_ARROW', "value": 'PRESS', "ctrl": True, "repeat": True},
{"properties": [("type", 'PREVIOUS_WORD')]}),
- ("font.move", {"type": 'RIGHT_ARROW', "value": 'PRESS', "ctrl": True},
+ ("font.move", {"type": 'RIGHT_ARROW', "value": 'PRESS', "ctrl": True, "repeat": True},
{"properties": [("type", 'NEXT_WORD')]}),
- ("font.move", {"type": 'UP_ARROW', "value": 'PRESS'},
+ ("font.move", {"type": 'UP_ARROW', "value": 'PRESS', "repeat": True},
{"properties": [("type", 'PREVIOUS_LINE')]}),
- ("font.move", {"type": 'DOWN_ARROW', "value": 'PRESS'},
+ ("font.move", {"type": 'DOWN_ARROW', "value": 'PRESS', "repeat": True},
{"properties": [("type", 'NEXT_LINE')]}),
- ("font.move", {"type": 'PAGE_UP', "value": 'PRESS'},
+ ("font.move", {"type": 'PAGE_UP', "value": 'PRESS', "repeat": True},
{"properties": [("type", 'PREVIOUS_PAGE')]}),
- ("font.move", {"type": 'PAGE_DOWN', "value": 'PRESS'},
+ ("font.move", {"type": 'PAGE_DOWN', "value": 'PRESS', "repeat": True},
{"properties": [("type", 'NEXT_PAGE')]}),
("font.move_select", {"type": 'HOME', "value": 'PRESS', "shift": True},
{"properties": [("type", 'LINE_BEGIN')]}),
("font.move_select", {"type": 'END', "value": 'PRESS', "shift": True},
{"properties": [("type", 'LINE_END')]}),
- ("font.move_select", {"type": 'LEFT_ARROW', "value": 'PRESS', "shift": True},
+ ("font.move_select", {"type": 'LEFT_ARROW', "value": 'PRESS', "shift": True, "repeat": True},
{"properties": [("type", 'PREVIOUS_CHARACTER')]}),
- ("font.move_select", {"type": 'RIGHT_ARROW', "value": 'PRESS', "shift": True},
+ ("font.move_select", {"type": 'RIGHT_ARROW', "value": 'PRESS', "shift": True, "repeat": True},
{"properties": [("type", 'NEXT_CHARACTER')]}),
- ("font.move_select", {"type": 'LEFT_ARROW', "value": 'PRESS', "shift": True, "ctrl": True},
+ ("font.move_select", {"type": 'LEFT_ARROW', "value": 'PRESS', "shift": True, "ctrl": True, "repeat": True},
{"properties": [("type", 'PREVIOUS_WORD')]}),
- ("font.move_select", {"type": 'RIGHT_ARROW', "value": 'PRESS', "shift": True, "ctrl": True},
+ ("font.move_select", {"type": 'RIGHT_ARROW', "value": 'PRESS', "shift": True, "ctrl": True, "repeat": True},
{"properties": [("type", 'NEXT_WORD')]}),
- ("font.move_select", {"type": 'UP_ARROW', "value": 'PRESS', "shift": True},
+ ("font.move_select", {"type": 'UP_ARROW', "value": 'PRESS', "shift": True, "repeat": True},
{"properties": [("type", 'PREVIOUS_LINE')]}),
- ("font.move_select", {"type": 'DOWN_ARROW', "value": 'PRESS', "shift": True},
+ ("font.move_select", {"type": 'DOWN_ARROW', "value": 'PRESS', "shift": True, "repeat": True},
{"properties": [("type", 'NEXT_LINE')]}),
- ("font.move_select", {"type": 'PAGE_UP', "value": 'PRESS', "shift": True},
+ ("font.move_select", {"type": 'PAGE_UP', "value": 'PRESS', "shift": True, "repeat": True},
{"properties": [("type", 'PREVIOUS_PAGE')]}),
- ("font.move_select", {"type": 'PAGE_DOWN', "value": 'PRESS', "shift": True},
+ ("font.move_select", {"type": 'PAGE_DOWN', "value": 'PRESS', "shift": True, "repeat": True},
{"properties": [("type", 'NEXT_PAGE')]}),
- ("font.change_spacing", {"type": 'LEFT_ARROW', "value": 'PRESS', "alt": True},
+ ("font.change_spacing", {"type": 'LEFT_ARROW', "value": 'PRESS', "alt": True, "repeat": True},
{"properties": [("delta", -1)]}),
- ("font.change_spacing", {"type": 'RIGHT_ARROW', "value": 'PRESS', "alt": True},
+ ("font.change_spacing", {"type": 'RIGHT_ARROW', "value": 'PRESS', "alt": True, "repeat": True},
{"properties": [("delta", 1)]}),
- ("font.change_character", {"type": 'UP_ARROW', "value": 'PRESS', "alt": True},
+ ("font.change_character", {"type": 'UP_ARROW', "value": 'PRESS', "alt": True, "repeat": True},
{"properties": [("delta", 1)]}),
- ("font.change_character", {"type": 'DOWN_ARROW', "value": 'PRESS', "alt": True},
+ ("font.change_character", {"type": 'DOWN_ARROW', "value": 'PRESS', "alt": True, "repeat": True},
{"properties": [("delta", -1)]}),
("font.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True}, None),
("font.text_copy", {"type": 'C', "value": 'PRESS', "ctrl": True}, None),
@@ -3918,10 +3922,10 @@ def km_transform_modal_map(_params):
("ADD_SNAP", {"type": 'A', "value": 'PRESS'}, None),
("ADD_SNAP", {"type": 'A', "value": 'PRESS', "ctrl": True}, None),
("REMOVE_SNAP", {"type": 'A', "value": 'PRESS', "alt": True}, None),
- ("PROPORTIONAL_SIZE_UP", {"type": 'PAGE_UP', "value": 'PRESS'}, None),
- ("PROPORTIONAL_SIZE_DOWN", {"type": 'PAGE_DOWN', "value": 'PRESS'}, None),
- ("PROPORTIONAL_SIZE_UP", {"type": 'PAGE_UP', "value": 'PRESS', "shift": True}, None),
- ("PROPORTIONAL_SIZE_DOWN", {"type": 'PAGE_DOWN', "value": 'PRESS', "shift": True}, None),
+ ("PROPORTIONAL_SIZE_UP", {"type": 'PAGE_UP', "value": 'PRESS', "repeat": True}, None),
+ ("PROPORTIONAL_SIZE_DOWN", {"type": 'PAGE_DOWN', "value": 'PRESS', "repeat": True}, None),
+ ("PROPORTIONAL_SIZE_UP", {"type": 'PAGE_UP', "value": 'PRESS', "shift": True, "repeat": True}, None),
+ ("PROPORTIONAL_SIZE_DOWN", {"type": 'PAGE_DOWN', "value": 'PRESS', "shift": True, "repeat": True}, None),
("PROPORTIONAL_SIZE_UP", {"type": 'WHEELDOWNMOUSE', "value": 'PRESS'}, None),
("PROPORTIONAL_SIZE_DOWN", {"type": 'WHEELUPMOUSE', "value": 'PRESS'}, None),
("PROPORTIONAL_SIZE_UP", {"type": 'WHEELDOWNMOUSE', "value": 'PRESS', "shift": True}, None),
@@ -3929,10 +3933,10 @@ def km_transform_modal_map(_params):
("PROPORTIONAL_SIZE", {"type": 'TRACKPADPAN', "value": 'ANY'}, None),
("EDGESLIDE_EDGE_NEXT", {"type": 'WHEELDOWNMOUSE', "value": 'PRESS', "alt": True}, None),
("EDGESLIDE_PREV_NEXT", {"type": 'WHEELUPMOUSE', "value": 'PRESS', "alt": True}, None),
- ("AUTOIK_CHAIN_LEN_UP", {"type": 'PAGE_UP', "value": 'PRESS'}, None),
- ("AUTOIK_CHAIN_LEN_DOWN", {"type": 'PAGE_DOWN', "value": 'PRESS'}, None),
- ("AUTOIK_CHAIN_LEN_UP", {"type": 'PAGE_UP', "value": 'PRESS', "shift": True}, None),
- ("AUTOIK_CHAIN_LEN_DOWN", {"type": 'PAGE_DOWN', "value": 'PRESS', "shift": True}, None),
+ ("AUTOIK_CHAIN_LEN_UP", {"type": 'PAGE_UP', "value": 'PRESS', "repeat": True}, None),
+ ("AUTOIK_CHAIN_LEN_DOWN", {"type": 'PAGE_DOWN', "value": 'PRESS', "repeat": True}, None),
+ ("AUTOIK_CHAIN_LEN_UP", {"type": 'PAGE_UP', "value": 'PRESS', "shift": True, "repeat": True}, None),
+ ("AUTOIK_CHAIN_LEN_DOWN", {"type": 'PAGE_DOWN', "value": 'PRESS', "shift": True, "repeat": True}, None),
("AUTOIK_CHAIN_LEN_UP", {"type": 'WHEELDOWNMOUSE', "value": 'PRESS'}, None),
("AUTOIK_CHAIN_LEN_DOWN", {"type": 'WHEELUPMOUSE', "value": 'PRESS'}, None),
("AUTOIK_CHAIN_LEN_UP", {"type": 'WHEELDOWNMOUSE', "value": 'PRESS', "shift": True}, None),
diff --git a/release/scripts/startup/bl_operators/__init__.py b/release/scripts/startup/bl_operators/__init__.py
index c927cc184a3..eff88c835e7 100644
--- a/release/scripts/startup/bl_operators/__init__.py
+++ b/release/scripts/startup/bl_operators/__init__.py
@@ -48,7 +48,6 @@ _modules = [
"uvcalc_lightmap",
"vertexpaint_dirt",
"view3d",
- "gpencil_mesh_bake",
"wm",
]
diff --git a/release/scripts/startup/bl_operators/anim.py b/release/scripts/startup/bl_operators/anim.py
index d0b4b485d82..8334557d1f6 100644
--- a/release/scripts/startup/bl_operators/anim.py
+++ b/release/scripts/startup/bl_operators/anim.py
@@ -348,7 +348,7 @@ class UpdateAnimatedTransformConstraint(Operator):
bl_options = {'REGISTER', 'UNDO'}
use_convert_to_radians: BoolProperty(
- name="Convert To Radians",
+ name="Convert to Radians",
description="Convert fcurves/drivers affecting rotations to radians (Warning: use this only once!)",
default=True,
)
diff --git a/release/scripts/startup/bl_operators/clip.py b/release/scripts/startup/bl_operators/clip.py
index b4795168a19..a3c54a7b069 100644
--- a/release/scripts/startup/bl_operators/clip.py
+++ b/release/scripts/startup/bl_operators/clip.py
@@ -1011,7 +1011,7 @@ class CLIP_OT_track_settings_as_default(Operator):
"""Copy tracking settings from active track to default settings"""
bl_idname = "clip.track_settings_as_default"
- bl_label = "Track Settings As Default"
+ bl_label = "Track Settings as Default"
bl_options = {'UNDO', 'REGISTER'}
@classmethod
diff --git a/release/scripts/startup/bl_operators/console.py b/release/scripts/startup/bl_operators/console.py
index b62b9310224..bffac4eef55 100644
--- a/release/scripts/startup/bl_operators/console.py
+++ b/release/scripts/startup/bl_operators/console.py
@@ -85,7 +85,7 @@ class ConsoleAutocomplete(Operator):
class ConsoleCopyAsScript(Operator):
"""Copy the console contents for use in a script"""
bl_idname = "console.copy_as_script"
- bl_label = "Copy to Clipboard (as script)"
+ bl_label = "Copy to Clipboard (as Script)"
@classmethod
def poll(cls, context):
diff --git a/release/scripts/startup/bl_operators/gpencil_mesh_bake.py b/release/scripts/startup/bl_operators/gpencil_mesh_bake.py
deleted file mode 100644
index d4b1b11ed69..00000000000
--- a/release/scripts/startup/bl_operators/gpencil_mesh_bake.py
+++ /dev/null
@@ -1,157 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-# <pep8-80 compliant>
-
-import bpy
-from bpy.types import Operator
-from bpy.props import (
- IntProperty,
- FloatProperty,
- BoolProperty,
- EnumProperty,
-)
-
-gp_object_items = []
-
-
-def my_objlist_callback(scene, context):
- gp_object_items.clear()
- gp_object_items.append(('*NEW', "New Object", ""))
- for o in context.scene.objects:
- if o.type == 'GPENCIL':
- gp_object_items.append((o.name, o.name, ""))
-
- return gp_object_items
-
-
-class GPENCIL_OT_mesh_bake(Operator):
- """Bake all mesh animation into grease pencil strokes"""
- bl_idname = "gpencil.mesh_bake"
- bl_label = "Bake Mesh to Grease Pencil"
- bl_options = {'REGISTER', 'UNDO'}
-
- frame_start: IntProperty(
- name="Start Frame",
- description="Start frame for baking",
- min=0, max=300000,
- default=1,
- )
- frame_end: IntProperty(
- name="End Frame",
- description="End frame for baking",
- min=1, max=300000,
- default=250,
- )
- step: IntProperty(
- name="Frame Step",
- description="Frame Step",
- min=1, max=120,
- default=1,
- )
- thickness: IntProperty(
- name="Thickness",
- description="Thickness of the stroke lines",
- min=1, max=100,
- default=1,
- )
- angle: FloatProperty(
- name="Threshold Angle",
- description="Threshold to determine ends of the strokes",
- min=0,
- max=+3.141592,
- default=+1.22173, # 70 Degress
- subtype='ANGLE',
- )
- offset: FloatProperty(
- name="Stroke Offset",
- description="Offset strokes from fill",
- soft_min=0.0, soft_max=100.0,
- min=0.0, max=100.0,
- default=0.001,
- precision=3,
- step=1,
- subtype='DISTANCE',
- unit='LENGTH',
- )
- seams: BoolProperty(
- name="Only Seam Edges",
- description="Convert only seam edges",
- default=False,
- )
- faces: BoolProperty(
- name="Export Faces",
- description="Export faces as filled strokes",
- default=True,
- )
- target: EnumProperty(
- name="Target Object",
- description="Grease Pencil Object",
- items=my_objlist_callback
- )
- frame_target: IntProperty(
- name="Target Frame",
- description="Destination frame for the baked animation",
- min=1, max=300000,
- default=1,
- )
- project_type: EnumProperty(
- name="Reproject Type",
- description="Type of projection",
- items=(
- ("KEEP", "No Reproject", ""),
- ("FRONT", "Front", "Reproject the strokes using the X-Z plane"),
- ("SIDE", "Side", "Reproject the strokes using the Y-Z plane"),
- ("TOP", "Top", "Reproject the strokes using the X-Y plane"),
- ("VIEW", "View", "Reproject the strokes to current viewpoint"),
- ("CURSOR", "Cursor", "Reproject the strokes using the orientation of 3D cursor")
- )
- )
-
- @classmethod
- def poll(self, context):
- ob = context.active_object
- return ((ob is not None) and
- (ob.type in {'EMPTY', 'MESH'}) and
- (context.mode == 'OBJECT'))
-
- def execute(self, context):
- bpy.ops.gpencil.bake_mesh_animation(
- frame_start=self.frame_start,
- frame_end=self.frame_end,
- step=self.step,
- angle=self.angle,
- thickness=self.thickness,
- seams=self.seams,
- faces=self.faces,
- offset=self.offset,
- target=self.target,
- frame_target=self.frame_target,
- project_type=self.project_type
- )
-
- return {'FINISHED'}
-
- def invoke(self, context, _event):
- wm = context.window_manager
- return wm.invoke_props_dialog(self)
-
-
-classes = (
- GPENCIL_OT_mesh_bake,
-)
diff --git a/release/scripts/startup/bl_operators/sequencer.py b/release/scripts/startup/bl_operators/sequencer.py
index 6b420d20e14..df1098bdd3f 100644
--- a/release/scripts/startup/bl_operators/sequencer.py
+++ b/release/scripts/startup/bl_operators/sequencer.py
@@ -32,7 +32,7 @@ class SequencerCrossfadeSounds(Operator):
"""Do cross-fading volume animation of two selected sound strips"""
bl_idname = "sequencer.crossfade_sounds"
- bl_label = "Crossfade sounds"
+ bl_label = "Crossfade Sounds"
bl_options = {'REGISTER', 'UNDO'}
@classmethod
@@ -83,7 +83,7 @@ class SequencerSplitMulticam(Operator):
"""Split multi-cam strip and select camera"""
bl_idname = "sequencer.split_multicam"
- bl_label = "Split multicam"
+ bl_label = "Split Multicam"
bl_options = {'REGISTER', 'UNDO'}
camera: IntProperty(
diff --git a/release/scripts/startup/bl_operators/userpref.py b/release/scripts/startup/bl_operators/userpref.py
index 31d601debba..07dba491dbd 100644
--- a/release/scripts/startup/bl_operators/userpref.py
+++ b/release/scripts/startup/bl_operators/userpref.py
@@ -1112,9 +1112,9 @@ class PREFERENCES_OT_studiolight_uninstall(Operator):
class PREFERENCES_OT_studiolight_copy_settings(Operator):
- """Copy Studio Light settings to the Studio light editor"""
+ """Copy Studio Light settings to the Studio Light editor"""
bl_idname = "preferences.studiolight_copy_settings"
- bl_label = "Copy Studio Light settings"
+ bl_label = "Copy Studio Light Settings"
index: IntProperty()
def execute(self, context):
diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py
index e9a658bdc10..aa4e4e77993 100644
--- a/release/scripts/startup/bl_operators/wm.py
+++ b/release/scripts/startup/bl_operators/wm.py
@@ -1660,7 +1660,7 @@ class WM_OT_owner_disable(Operator):
class WM_OT_tool_set_by_id(Operator):
"""Set the tool by name (for keymaps)"""
bl_idname = "wm.tool_set_by_id"
- bl_label = "Set Tool By Name"
+ bl_label = "Set Tool by Name"
name: StringProperty(
name="Identifier",
@@ -1718,7 +1718,7 @@ class WM_OT_tool_set_by_id(Operator):
class WM_OT_tool_set_by_index(Operator):
"""Set the tool by index (for keymaps)"""
bl_idname = "wm.tool_set_by_index"
- bl_label = "Set Tool By Index"
+ bl_label = "Set Tool by Index"
index: IntProperty(
name="Index in toolbar",
default=0,
diff --git a/release/scripts/startup/bl_ui/properties_data_empty.py b/release/scripts/startup/bl_ui/properties_data_empty.py
index c8a1d9e238c..7ded4c775a7 100644
--- a/release/scripts/startup/bl_ui/properties_data_empty.py
+++ b/release/scripts/startup/bl_ui/properties_data_empty.py
@@ -54,7 +54,7 @@ class DATA_PT_empty(DataButtonsPanel, Panel):
depth_row.prop(ob, "empty_image_depth", text="Depth", expand=True)
col.row().prop(ob, "empty_image_side", text="Side", expand=True)
- col = layout.column(heading="Show in", align=True)
+ col = layout.column(heading="Show In", align=True)
col.prop(ob, "show_empty_image_orthographic", text="Orthographic")
col.prop(ob, "show_empty_image_perspective", text="Perspective")
col.prop(ob, "show_empty_image_only_axis_aligned", text="Only Axis Aligned")
diff --git a/release/scripts/startup/bl_ui/properties_data_gpencil.py b/release/scripts/startup/bl_ui/properties_data_gpencil.py
index 946578937bb..affdba6f693 100644
--- a/release/scripts/startup/bl_ui/properties_data_gpencil.py
+++ b/release/scripts/startup/bl_ui/properties_data_gpencil.py
@@ -101,7 +101,7 @@ class GPENCIL_MT_layer_context_menu(Menu):
layout.separator()
layout.operator("gpencil.lock_all", icon='LOCKED', text="Lock All")
- layout.operator("gpencil.unlock_all", icon='UNLOCKED', text="UnLock All")
+ layout.operator("gpencil.unlock_all", icon='UNLOCKED', text="Unlock All")
layout.prop(gpd, "use_autolock_layers", text="Autolock Inactive Layers")
layout.separator()
@@ -263,7 +263,7 @@ class DATA_PT_gpencil_onion_skinning_display(DataButtonsPanel, Panel):
layout.use_property_split = True
layout.enabled = gpd.users <= 1
- layout.prop(gpd, "use_ghosts_always", text="View In Render")
+ layout.prop(gpd, "use_ghosts_always", text="View in Render")
col = layout.column(align=True)
col.prop(gpd, "use_onion_fade", text="Fade")
diff --git a/release/scripts/startup/bl_ui/properties_data_mesh.py b/release/scripts/startup/bl_ui/properties_data_mesh.py
index 2ea439a7e89..924a89755f8 100644
--- a/release/scripts/startup/bl_ui/properties_data_mesh.py
+++ b/release/scripts/startup/bl_ui/properties_data_mesh.py
@@ -57,7 +57,7 @@ class MESH_MT_vertex_group_context_menu(Menu):
layout.separator()
props = layout.operator("object.vertex_group_lock", icon='LOCKED', text="Lock All")
props.action, props.mask = 'LOCK', 'ALL'
- props = layout.operator("object.vertex_group_lock", icon='UNLOCKED', text="UnLock All")
+ props = layout.operator("object.vertex_group_lock", icon='UNLOCKED', text="Unlock All")
props.action, props.mask = 'UNLOCK', 'ALL'
props = layout.operator("object.vertex_group_lock", text="Lock Invert All")
props.action, props.mask = 'INVERT', 'ALL'
diff --git a/release/scripts/startup/bl_ui/properties_freestyle.py b/release/scripts/startup/bl_ui/properties_freestyle.py
index 3a2b26aaebb..3d574fca2ff 100644
--- a/release/scripts/startup/bl_ui/properties_freestyle.py
+++ b/release/scripts/startup/bl_ui/properties_freestyle.py
@@ -162,7 +162,7 @@ class VIEWLAYER_PT_freestyle(ViewLayerFreestyleButtonsPanel, Panel):
if freestyle.mode == 'SCRIPT':
row = layout.row()
- row.label(text="Style modules:")
+ row.label(text="Style Modules:")
row.operator("scene.freestyle_module_add", text="Add")
for module in freestyle.modules:
box = layout.box()
diff --git a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
index 910d6b64b74..97e87f5451c 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -884,7 +884,7 @@ class GreasePencilLayerDisplayPanel:
col.prop(gpl, "channel_color")
col = layout.row(align=True)
- col.prop(gpl, "use_solo_mode", text="Show Only On Keyframed")
+ col.prop(gpl, "use_solo_mode", text="Show Only on Keyframed")
class GreasePencilFlipTintColors(Operator):
diff --git a/release/scripts/startup/bl_ui/properties_mask_common.py b/release/scripts/startup/bl_ui/properties_mask_common.py
index 6ee755722f3..4d25b8ca309 100644
--- a/release/scripts/startup/bl_ui/properties_mask_common.py
+++ b/release/scripts/startup/bl_ui/properties_mask_common.py
@@ -37,7 +37,7 @@ def draw_mask_context_menu(layout, context):
layout.separator()
- layout.operator("mask.shape_key_rekey", text="Re-key Shape Points")
+ layout.operator("mask.shape_key_rekey", text="Re-Key Shape Points")
layout.operator("mask.feather_weight_clear")
layout.operator("mask.shape_key_feather_reset", text="Reset Feather Animation")
diff --git a/release/scripts/startup/bl_ui/properties_material_gpencil.py b/release/scripts/startup/bl_ui/properties_material_gpencil.py
index 4ed7b1ac7b9..da54ff1a137 100644
--- a/release/scripts/startup/bl_ui/properties_material_gpencil.py
+++ b/release/scripts/startup/bl_ui/properties_material_gpencil.py
@@ -39,7 +39,7 @@ class GPENCIL_MT_material_context_menu(Menu):
layout.separator()
layout.operator("gpencil.material_lock_all", icon='LOCKED', text="Lock All")
- layout.operator("gpencil.material_unlock_all", icon='UNLOCKED', text="UnLock All")
+ layout.operator("gpencil.material_unlock_all", icon='UNLOCKED', text="Unlock All")
layout.operator("gpencil.material_lock_unused", text="Lock Unselected")
layout.operator("gpencil.lock_layer", text="Lock Unused")
diff --git a/release/scripts/startup/bl_ui/properties_object.py b/release/scripts/startup/bl_ui/properties_object.py
index b142f6085fa..4530b4bbe48 100644
--- a/release/scripts/startup/bl_ui/properties_object.py
+++ b/release/scripts/startup/bl_ui/properties_object.py
@@ -364,7 +364,7 @@ class OBJECT_PT_visibility(ObjectButtonsPanel, Panel):
layout.prop(ob, "hide_select", text="Selectable", toggle=False, invert_checkbox=True)
- col = layout.column(heading="Show in")
+ col = layout.column(heading="Show In")
col.prop(ob, "hide_viewport", text="Viewports", toggle=False, invert_checkbox=True)
col.prop(ob, "hide_render", text="Renders", toggle=False, invert_checkbox=True)
diff --git a/release/scripts/startup/bl_ui/properties_paint_common.py b/release/scripts/startup/bl_ui/properties_paint_common.py
index 2b26ad92a02..01454f8ee05 100644
--- a/release/scripts/startup/bl_ui/properties_paint_common.py
+++ b/release/scripts/startup/bl_ui/properties_paint_common.py
@@ -330,7 +330,7 @@ class StrokePanel(BrushPanel):
col.separator()
if brush.use_anchor:
- col.prop(brush, "use_edge_to_edge", text="Edge To Edge")
+ col.prop(brush, "use_edge_to_edge", text="Edge to Edge")
if brush.use_airbrush:
col.prop(brush, "rate", text="Rate", slider=True)
@@ -698,6 +698,7 @@ def brush_settings(layout, context, brush, popover=False):
elif sculpt_tool == 'GRAB':
layout.prop(brush, "use_grab_active_vertex")
+ layout.prop(brush, "use_grab_silhouette")
elif sculpt_tool == 'PAINT':
row = layout.row(align=True)
diff --git a/release/scripts/startup/bl_ui/properties_physics_common.py b/release/scripts/startup/bl_ui/properties_physics_common.py
index abc75ceed2c..b8c0035ee6b 100644
--- a/release/scripts/startup/bl_ui/properties_physics_common.py
+++ b/release/scripts/startup/bl_ui/properties_physics_common.py
@@ -228,7 +228,7 @@ def point_cache_ui(self, cache, enabled, cachetype):
sub = col.row()
sub.enabled = enabled
- sub.operator("ptcache.bake", text="Calculate To Frame").bake = False
+ sub.operator("ptcache.bake", text="Calculate to Frame").bake = False
sub = col.column()
sub.enabled = enabled
@@ -237,7 +237,7 @@ def point_cache_ui(self, cache, enabled, cachetype):
col = flow.column()
col.operator("ptcache.bake_all", text="Bake All Dynamics").bake = True
col.operator("ptcache.free_bake_all", text="Delete All Bakes")
- col.operator("ptcache.bake_all", text="Update All To Frame").bake = False
+ col.operator("ptcache.bake_all", text="Update All to Frame").bake = False
def effector_weights_ui(self, weights, weight_type):
diff --git a/release/scripts/startup/bl_ui/properties_physics_field.py b/release/scripts/startup/bl_ui/properties_physics_field.py
index d1ff1dc9f5e..c8c49ee02b0 100644
--- a/release/scripts/startup/bl_ui/properties_physics_field.py
+++ b/release/scripts/startup/bl_ui/properties_physics_field.py
@@ -102,7 +102,7 @@ class PHYSICS_PT_field_settings(PhysicButtonsPanel, Panel):
col.separator()
col = flow.column()
- col.prop(field, "guide_clump_amount", text="Clumping amount")
+ col.prop(field, "guide_clump_amount", text="Clumping Amount")
col.prop(field, "guide_clump_shape")
col.prop(field, "use_max_distance")
@@ -378,7 +378,7 @@ class PHYSICS_PT_collision_particle(PhysicButtonsPanel, Panel):
class PHYSICS_PT_collision_softbody(PhysicButtonsPanel, Panel):
- bl_label = "Softbody And Cloth"
+ bl_label = "Softbody & Cloth"
bl_parent_id = "PHYSICS_PT_collision"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
diff --git a/release/scripts/startup/bl_ui/properties_physics_fluid.py b/release/scripts/startup/bl_ui/properties_physics_fluid.py
index 779bdb5cd11..15c5e70d8b2 100644
--- a/release/scripts/startup/bl_ui/properties_physics_fluid.py
+++ b/release/scripts/startup/bl_ui/properties_physics_fluid.py
@@ -196,7 +196,7 @@ class PHYSICS_PT_settings(PhysicButtonsPanel, Panel):
col = flow.column()
if PhysicButtonsPanel.poll_gas_domain(context):
col.prop(domain, "clipping", text="Empty Space")
- col.prop(domain, "delete_in_obstacle", text="Delete In Obstacle")
+ col.prop(domain, "delete_in_obstacle", text="Delete in Obstacle")
if domain.cache_type == 'MODULAR':
col.separator()
diff --git a/release/scripts/startup/bl_ui/space_clip.py b/release/scripts/startup/bl_ui/space_clip.py
index a23dfae55b7..4b24f36eace 100644
--- a/release/scripts/startup/bl_ui/space_clip.py
+++ b/release/scripts/startup/bl_ui/space_clip.py
@@ -560,7 +560,7 @@ class CLIP_PT_tools_solve(CLIP_PT_tracking_panel, Panel):
class CLIP_PT_tools_cleanup(CLIP_PT_tracking_panel, Panel):
bl_space_type = 'CLIP_EDITOR'
bl_region_type = 'TOOLS'
- bl_label = "Clean up"
+ bl_label = "Clean Up"
bl_options = {'DEFAULT_CLOSED'}
bl_category = "Solve"
@@ -1000,9 +1000,9 @@ class CLIP_PT_stabilization(CLIP_PT_reconstruction_panel, Panel):
row.prop(stab, "show_tracks_expanded", text="", emboss=False)
if not stab.show_tracks_expanded:
- row.label(text="Tracks For Stabilization")
+ row.label(text="Tracks for Stabilization")
else:
- row.label(text="Tracks For Location")
+ row.label(text="Tracks for Location")
row = box.row()
row.template_list("UI_UL_list", "stabilization_tracks", stab, "tracks",
stab, "active_track_index", rows=2)
@@ -1018,7 +1018,7 @@ class CLIP_PT_stabilization(CLIP_PT_reconstruction_panel, Panel):
# Usually we don't hide things from interface, but here every pixel of
# vertical space is precious.
if stab.use_stabilize_rotation:
- box.label(text="Tracks For Rotation / Scale")
+ box.label(text="Tracks for Rotation/Scale")
row = box.row()
row.template_list("UI_UL_list", "stabilization_rotation_tracks",
stab, "rotation_tracks",
diff --git a/release/scripts/startup/bl_ui/space_dopesheet.py b/release/scripts/startup/bl_ui/space_dopesheet.py
index a866921f326..5e53eec4ae6 100644
--- a/release/scripts/startup/bl_ui/space_dopesheet.py
+++ b/release/scripts/startup/bl_ui/space_dopesheet.py
@@ -336,7 +336,7 @@ class DOPESHEET_MT_view(Menu):
layout.separator()
- layout.prop(st.dopesheet, "use_multi_word_filter", text="Multi-word Match Search")
+ layout.prop(st.dopesheet, "use_multi_word_filter", text="Multi-Word Match Search")
layout.separator()
diff --git a/release/scripts/startup/bl_ui/space_sequencer.py b/release/scripts/startup/bl_ui/space_sequencer.py
index 72395e1de5e..7d881948466 100644
--- a/release/scripts/startup/bl_ui/space_sequencer.py
+++ b/release/scripts/startup/bl_ui/space_sequencer.py
@@ -1071,7 +1071,7 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel, Panel):
flow.prop(strip, "use_only_boost")
elif strip_type == 'SPEED':
- layout.prop(strip, "use_default_fade", text="Stretch to input strip length")
+ layout.prop(strip, "use_default_fade", text="Stretch to Input Strip Length")
if not strip.use_default_fade:
layout.prop(strip, "use_as_speed")
if strip.use_as_speed:
@@ -1113,7 +1113,7 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel, Panel):
# The multicam strip needs at least 2 strips to be useful
if strip_channel > 2:
BT_ROW = 4
- col.label(text=" Cut to")
+ col.label(text="Cut To")
row = col.row()
for i in range(1, strip_channel):
@@ -1153,7 +1153,7 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel, Panel):
col.prop(strip, "use_frame_interpolate")
elif strip_type in {'CROSS', 'GAMMA_CROSS', 'WIPE', 'ALPHA_OVER', 'ALPHA_UNDER', 'OVER_DROP'}:
- col.prop(strip, "use_default_fade", text="Default fade")
+ col.prop(strip, "use_default_fade", text="Default Fade")
if not strip.use_default_fade:
col.prop(strip, "effect_fader", text="Effect Fader")
elif strip_type == 'GAUSSIAN_BLUR':
diff --git a/release/scripts/startup/bl_ui/space_text.py b/release/scripts/startup/bl_ui/space_text.py
index 8a45069470b..f1326823fe8 100644
--- a/release/scripts/startup/bl_ui/space_text.py
+++ b/release/scripts/startup/bl_ui/space_text.py
@@ -177,7 +177,7 @@ class TEXT_PT_find(Panel):
row = col.row(align=True)
row.operator("text.replace")
- row.operator("text.replace", text="Replace all").all = True
+ row.operator("text.replace", text="Replace All").all = True
layout.separator()
diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
index ebe00668474..a923bb305d9 100644
--- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
@@ -1259,6 +1259,7 @@ class _defs_sculpt:
def draw_settings(_context, layout, tool):
props = tool.operator_properties("paint.mask_line_gesture")
layout.prop(props, "use_front_faces_only", expand=False)
+ layout.prop(props, "use_limit_to_segment", expand=False)
return dict(
idname="builtin.line_mask",
@@ -1331,12 +1332,17 @@ class _defs_sculpt:
@ToolDef.from_fn
def project_line():
+ def draw_settings(_context, layout, tool):
+ props = tool.operator_properties("sculpt.project_line_gesture")
+ layout.prop(props, "use_limit_to_segment", expand=False)
+
return dict(
idname="builtin.line_project",
label="Line Project",
icon="ops.sculpt.line_project",
widget=None,
keymap=(),
+ draw_settings=draw_settings,
)
@ToolDef.from_fn
@@ -1814,6 +1820,11 @@ class _defs_gpencil_paint:
@ToolDef.from_fn
def cutter():
+ def draw_settings(context, layout, tool):
+ props = tool.operator_properties("gpencil.stroke_cutter")
+ row = layout.row()
+ row.use_property_split = False
+ row.prop(props, "flat_caps")
return dict(
idname="builtin.cutter",
label="Cutter",
@@ -1821,6 +1832,7 @@ class _defs_gpencil_paint:
cursor='KNIFE',
widget=None,
keymap=(),
+ draw_settings=draw_settings,
)
@ToolDef.from_fn
diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py
index b4b8a631b93..10b52e1fe3a 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -279,7 +279,7 @@ class USERPREF_PT_interface_temporary_windows(InterfacePanel, CenterAlignMixIn,
view = prefs.view
col = layout.column()
- col.prop(view, "render_display_type", text="Render in")
+ col.prop(view, "render_display_type", text="Render In")
col.prop(view, "filebrowser_display_type", text="File Browser")
@@ -373,8 +373,8 @@ class USERPREF_PT_edit_objects_new(EditingPanel, CenterAlignMixIn, Panel):
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
- flow.prop(edit, "material_link", text="Link Materials to")
- flow.prop(edit, "object_align", text="Align to")
+ flow.prop(edit, "material_link", text="Link Materials To")
+ flow.prop(edit, "object_align", text="Align To")
flow.prop(edit, "use_enter_edit_mode", text="Enter Edit Mode")
flow.prop(edit, "collection_instance_empty_size", text="Instance Empty Size")
@@ -479,7 +479,7 @@ class USERPREF_PT_edit_misc(EditingPanel, CenterAlignMixIn, Panel):
col = layout.column()
col.prop(edit, "sculpt_paint_overlay_color", text="Sculpt Overlay Color")
- col.prop(edit, "node_margin", text="Node Auto-offset Margin")
+ col.prop(edit, "node_margin", text="Node Auto-Offset Margin")
# -----------------------------------------------------------------------------
@@ -1348,7 +1348,7 @@ class USERPREF_PT_saveload_blend(SaveLoadPanel, CenterAlignMixIn, Panel):
col.prop(view, "use_save_prompt")
col.prop(paths, "use_save_preview_images")
- col = layout.column(heading="Default to")
+ col = layout.column(heading="Default To")
col.prop(paths, "use_relative_paths")
col.prop(paths, "use_file_compression")
col.prop(paths, "use_load_ui")
@@ -1377,7 +1377,7 @@ class USERPREF_PT_saveload_blend_autosave(SaveLoadPanel, CenterAlignMixIn, Panel
col = layout.column()
col.active = paths.use_auto_save_temporary_files
- col.prop(paths, "auto_save_time", text="Timer (mins)")
+ col.prop(paths, "auto_save_time", text="Timer (Minutes)")
class USERPREF_PT_saveload_file_browser(SaveLoadPanel, CenterAlignMixIn, Panel):
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index 07ccdfa8416..cb2ead39e2a 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -2257,7 +2257,7 @@ class VIEW3D_MT_object(Menu):
ob = context.active_object
if ob and ob.type == 'GPENCIL' and context.gpencil_data:
- layout.operator_menu_enum("gpencil.convert", "type", text="Convert to")
+ layout.operator_menu_enum("gpencil.convert", "type", text="Convert To")
else:
layout.operator_menu_enum("object.convert", "target")
@@ -2292,7 +2292,7 @@ class VIEW3D_MT_object_animation(Menu):
layout.separator()
layout.operator("nla.bake", text="Bake Action...")
- layout.operator("gpencil.mesh_bake", text="Bake Mesh to Grease Pencil...")
+ layout.operator("gpencil.bake_mesh_animation", text="Bake Mesh to Grease Pencil...")
class VIEW3D_MT_object_rigid_body(Menu):
@@ -3035,14 +3035,14 @@ class VIEW3D_MT_mask(Menu):
layout.separator()
- props = layout.operator("sculpt.mask_expand", text="Expand Mask By Topology")
+ props = layout.operator("sculpt.mask_expand", text="Expand Mask by Topology")
props.use_normals = False
props.keep_previous_mask = False
props.invert = True
props.smooth_iterations = 2
props.create_face_set = False
- props = layout.operator("sculpt.mask_expand", text="Expand Mask By Curvature")
+ props = layout.operator("sculpt.mask_expand", text="Expand Mask by Curvature")
props.use_normals = True
props.keep_previous_mask = True
props.invert = False
@@ -3428,7 +3428,7 @@ class VIEW3D_MT_pose_constraints(Menu):
def draw(self, _context):
layout = self.layout
- layout.operator("pose.constraint_add_with_targets", text="Add (With Targets)...")
+ layout.operator("pose.constraint_add_with_targets", text="Add (with Targets)...")
layout.operator("pose.constraints_copy")
layout.operator("pose.constraints_clear")
@@ -3440,9 +3440,9 @@ class VIEW3D_MT_pose_names(Menu):
layout = self.layout
layout.operator_context = 'EXEC_REGION_WIN'
- layout.operator("pose.autoside_names", text="AutoName Left/Right").axis = 'XAXIS'
- layout.operator("pose.autoside_names", text="AutoName Front/Back").axis = 'YAXIS'
- layout.operator("pose.autoside_names", text="AutoName Top/Bottom").axis = 'ZAXIS'
+ layout.operator("pose.autoside_names", text="Auto-Name Left/Right").axis = 'XAXIS'
+ layout.operator("pose.autoside_names", text="Auto-Name Front/Back").axis = 'YAXIS'
+ layout.operator("pose.autoside_names", text="Auto-Name Top/Bottom").axis = 'ZAXIS'
layout.operator("pose.flip_names")
@@ -4769,9 +4769,9 @@ class VIEW3D_MT_edit_armature_names(Menu):
layout = self.layout
layout.operator_context = 'EXEC_REGION_WIN'
- layout.operator("armature.autoside_names", text="AutoName Left/Right").type = 'XAXIS'
- layout.operator("armature.autoside_names", text="AutoName Front/Back").type = 'YAXIS'
- layout.operator("armature.autoside_names", text="AutoName Top/Bottom").type = 'ZAXIS'
+ layout.operator("armature.autoside_names", text="Auto-Name Left/Right").type = 'XAXIS'
+ layout.operator("armature.autoside_names", text="Auto-Name Front/Back").type = 'YAXIS'
+ layout.operator("armature.autoside_names", text="Auto-Name Top/Bottom").type = 'ZAXIS'
layout.operator("armature.flip_names", text="Flip Names")
@@ -5074,7 +5074,7 @@ class VIEW3D_MT_edit_gpencil_transform(Menu):
class VIEW3D_MT_edit_gpencil_showhide(Menu):
- bl_label = "Show/hide"
+ bl_label = "Show/Hide"
def draw(self, _context):
layout = self.layout
@@ -5862,7 +5862,7 @@ class VIEW3D_PT_shading_options(Panel):
row = col.row()
row.active = not xray_active
- row.prop(shading, "use_dof", text="Depth Of Field")
+ row.prop(shading, "use_dof", text="Depth of Field")
if shading.type in {'WIREFRAME', 'SOLID'}:
row = layout.split()
@@ -6553,7 +6553,7 @@ class VIEW3D_PT_snapping(Panel):
layout = self.layout
col = layout.column()
- col.label(text="Snap to")
+ col.label(text="Snap To")
col.prop(tool_settings, "snap_elements", expand=True)
col.separator()
@@ -6561,7 +6561,7 @@ class VIEW3D_PT_snapping(Panel):
col.prop(tool_settings, "use_snap_grid_absolute")
if snap_elements != {'INCREMENT'}:
- col.label(text="Snap with")
+ col.label(text="Snap With")
row = col.row(align=True)
row.prop(tool_settings, "snap_target", expand=True)
diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index e9118a8be91..e808c8779c6 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -681,7 +681,7 @@ class VIEW3D_PT_tools_brush_falloff(Panel, View3DPaintPanel, FalloffPanel):
class VIEW3D_PT_tools_brush_falloff_frontface(View3DPaintPanel, Panel):
bl_context = ".imagepaint" # dot on purpose (access from topbar)
- bl_label = "Front-face Falloff"
+ bl_label = "Front-Face Falloff"
bl_parent_id = "VIEW3D_PT_tools_brush_falloff"
bl_options = {'DEFAULT_CLOSED'}
diff --git a/source/blender/blenfont/BLF_api.h b/source/blender/blenfont/BLF_api.h
index bf84f5c57b3..03877957f42 100644
--- a/source/blender/blenfont/BLF_api.h
+++ b/source/blender/blenfont/BLF_api.h
@@ -40,9 +40,6 @@ struct rcti;
int BLF_init(void);
void BLF_exit(void);
-void BLF_default_dpi(int dpi);
-void BLF_default_set(int fontid);
-int BLF_default(void); /* get default font ID so we can pass it to other functions */
void BLF_cache_clear(void);
@@ -98,13 +95,6 @@ void BLF_batch_draw_begin(void);
void BLF_batch_draw_flush(void);
void BLF_batch_draw_end(void);
-/* Draw the string using the default font, size and dpi. */
-void BLF_draw_default(float x, float y, float z, const char *str, size_t len) ATTR_NONNULL();
-void BLF_draw_default_ascii(float x, float y, float z, const char *str, size_t len) ATTR_NONNULL();
-
-/* Set size and DPI, and return default font ID. */
-int BLF_set_default(void);
-
/* Draw the string using the current font. */
void BLF_draw_ex(int fontid, const char *str, size_t len, struct ResultBLF *r_info)
ATTR_NONNULL(2);
@@ -257,6 +247,16 @@ void BLF_thumb_preview(const char *filename,
int h,
int channels) ATTR_NONNULL();
+/* blf_default.c */
+void BLF_default_dpi(int dpi);
+void BLF_default_set(int fontid);
+int BLF_default(void); /* get default font ID so we can pass it to other functions */
+/* Draw the string using the default font, size and dpi. */
+void BLF_draw_default(float x, float y, float z, const char *str, size_t len) ATTR_NONNULL();
+void BLF_draw_default_ascii(float x, float y, float z, const char *str, size_t len) ATTR_NONNULL();
+/* Set size and DPI, and return default font ID. */
+int BLF_set_default(void);
+
/* blf_font_default.c */
int BLF_load_default(const bool unique);
int BLF_load_mono_default(const bool unique);
diff --git a/source/blender/blenfont/CMakeLists.txt b/source/blender/blenfont/CMakeLists.txt
index 3fd0dd95ef8..59a9072de57 100644
--- a/source/blender/blenfont/CMakeLists.txt
+++ b/source/blender/blenfont/CMakeLists.txt
@@ -38,6 +38,7 @@ set(INC_SYS
set(SRC
intern/blf.c
+ intern/blf_default.c
intern/blf_dir.c
intern/blf_font.c
intern/blf_font_default.c
diff --git a/source/blender/blenfont/intern/blf.c b/source/blender/blenfont/intern/blf.c
index c8940add738..48f283e67b9 100644
--- a/source/blender/blenfont/intern/blf.c
+++ b/source/blender/blenfont/intern/blf.c
@@ -37,10 +37,6 @@
#include "MEM_guardedalloc.h"
-#include "DNA_listBase.h"
-#include "DNA_userdef_types.h"
-#include "DNA_vec_types.h"
-
#include "BLI_math.h"
#include "BLI_threads.h"
@@ -48,9 +44,6 @@
#include "IMB_colormanagement.h"
-#include "UI_interface.h"
-
-#include "GPU_immediate.h"
#include "GPU_matrix.h"
#include "GPU_shader.h"
@@ -64,9 +57,6 @@
*/
#define BLF_MAX_FONT 16
-/* call BLF_default_set first! */
-#define ASSERT_DEFAULT_SET BLI_assert(global_font_default != -1)
-
#define BLF_RESULT_CHECK_INIT(r_info) \
if (r_info) { \
memset(r_info, 0, sizeof(*(r_info))); \
@@ -76,10 +66,6 @@
/* Font array. */
static FontBLF *global_font[BLF_MAX_FONT] = {NULL};
-/* Default size and dpi, for BLF_draw_default. */
-static int global_font_default = -1;
-static int global_font_dpi = 72;
-
/* XXX, should these be made into global_font_'s too? */
int blf_mono_font = -1;
int blf_mono_font_render = -1;
@@ -98,16 +84,11 @@ int BLF_init(void)
global_font[i] = NULL;
}
- global_font_dpi = 72;
+ BLF_default_dpi(72);
return blf_font_init();
}
-void BLF_default_dpi(int dpi)
-{
- global_font_dpi = dpi;
-}
-
void BLF_exit(void)
{
for (int i = 0; i < BLF_MAX_FONT; i++) {
@@ -132,6 +113,11 @@ void BLF_cache_clear(void)
}
}
+bool blf_font_id_is_valid(int fontid)
+{
+ return blf_get(fontid) != NULL;
+}
+
static int blf_search(const char *name)
{
for (int i = 0; i < BLF_MAX_FONT; i++) {
@@ -155,20 +141,6 @@ static int blf_search_available(void)
return -1;
}
-void BLF_default_set(int fontid)
-{
- FontBLF *font = blf_get(fontid);
- if (font || fontid == -1) {
- global_font_default = fontid;
- }
-}
-
-int BLF_default(void)
-{
- ASSERT_DEFAULT_SET;
- return global_font_default;
-}
-
bool BLF_has_glyph(int fontid, unsigned int unicode)
{
FontBLF *font = blf_get(fontid);
@@ -515,37 +487,6 @@ void BLF_batch_draw_end(void)
g_batch.enabled = false;
}
-void BLF_draw_default(float x, float y, float z, const char *str, size_t len)
-{
- ASSERT_DEFAULT_SET;
-
- const uiStyle *style = UI_style_get();
- BLF_size(global_font_default, style->widgetlabel.points, global_font_dpi);
- BLF_position(global_font_default, x, y, z);
- BLF_draw(global_font_default, str, len);
-}
-
-/* same as above but call 'BLF_draw_ascii' */
-void BLF_draw_default_ascii(float x, float y, float z, const char *str, size_t len)
-{
- ASSERT_DEFAULT_SET;
-
- const uiStyle *style = UI_style_get();
- BLF_size(global_font_default, style->widgetlabel.points, global_font_dpi);
- BLF_position(global_font_default, x, y, z);
- BLF_draw_ascii(global_font_default, str, len); /* XXX, use real length */
-}
-
-int BLF_set_default(void)
-{
- ASSERT_DEFAULT_SET;
-
- const uiStyle *style = UI_style_get();
- BLF_size(global_font_default, style->widgetlabel.points, global_font_dpi);
-
- return global_font_default;
-}
-
static void blf_draw_gl__start(FontBLF *font)
{
/*
diff --git a/source/blender/blenfont/intern/blf_default.c b/source/blender/blenfont/intern/blf_default.c
new file mode 100644
index 00000000000..7bbc865128d
--- /dev/null
+++ b/source/blender/blenfont/intern/blf_default.c
@@ -0,0 +1,90 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2009 Blender Foundation.
+ * All rights reserved.
+ */
+
+/** \file
+ * \ingroup blf
+ *
+ * Default API, that uses Blender's user preferences for the default size.
+ */
+
+#include "DNA_userdef_types.h"
+
+#include "BLI_assert.h"
+
+#include "BLF_api.h"
+
+#include "UI_interface.h"
+
+#include "blf_internal.h"
+
+/* call BLF_default_set first! */
+#define ASSERT_DEFAULT_SET BLI_assert(global_font_default != -1)
+
+/* Default size and dpi, for BLF_draw_default. */
+static int global_font_default = -1;
+static int global_font_dpi = 72;
+
+void BLF_default_dpi(int dpi)
+{
+ global_font_dpi = dpi;
+}
+
+void BLF_default_set(int fontid)
+{
+ if ((fontid == -1) || blf_font_id_is_valid(fontid)) {
+ global_font_default = fontid;
+ }
+}
+
+int BLF_default(void)
+{
+ ASSERT_DEFAULT_SET;
+ return global_font_default;
+}
+
+int BLF_set_default(void)
+{
+ ASSERT_DEFAULT_SET;
+
+ const uiStyle *style = UI_style_get();
+ BLF_size(global_font_default, style->widgetlabel.points, global_font_dpi);
+
+ return global_font_default;
+}
+
+void BLF_draw_default(float x, float y, float z, const char *str, size_t len)
+{
+ ASSERT_DEFAULT_SET;
+
+ const uiStyle *style = UI_style_get();
+ BLF_size(global_font_default, style->widgetlabel.points, global_font_dpi);
+ BLF_position(global_font_default, x, y, z);
+ BLF_draw(global_font_default, str, len);
+}
+
+/* same as above but call 'BLF_draw_ascii' */
+void BLF_draw_default_ascii(float x, float y, float z, const char *str, size_t len)
+{
+ ASSERT_DEFAULT_SET;
+
+ const uiStyle *style = UI_style_get();
+ BLF_size(global_font_default, style->widgetlabel.points, global_font_dpi);
+ BLF_position(global_font_default, x, y, z);
+ BLF_draw_ascii(global_font_default, str, len); /* XXX, use real length */
+}
diff --git a/source/blender/blenfont/intern/blf_internal.h b/source/blender/blenfont/intern/blf_internal.h
index b616f47a897..ada772c53d2 100644
--- a/source/blender/blenfont/intern/blf_internal.h
+++ b/source/blender/blenfont/intern/blf_internal.h
@@ -43,6 +43,8 @@ char *blf_dir_metrics_search(const char *filename);
int blf_font_init(void);
void blf_font_exit(void);
+bool blf_font_id_is_valid(int fontid);
+
void blf_draw_buffer__start(struct FontBLF *font);
void blf_draw_buffer__end(void);
diff --git a/source/blender/blenkernel/BKE_armature.h b/source/blender/blenkernel/BKE_armature.h
index 4e8775aefb3..db44a771095 100644
--- a/source/blender/blenkernel/BKE_armature.h
+++ b/source/blender/blenkernel/BKE_armature.h
@@ -180,6 +180,10 @@ void BKE_pose_rebuild(struct Main *bmain,
struct Object *ob,
struct bArmature *arm,
const bool do_id_user);
+void BKE_pose_ensure(struct Main *bmain,
+ struct Object *ob,
+ struct bArmature *arm,
+ const bool do_id_user);
void BKE_pose_where_is(struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob);
void BKE_pose_where_is_bone(struct Depsgraph *depsgraph,
struct Scene *scene,
diff --git a/source/blender/blenkernel/BKE_blender_version.h b/source/blender/blenkernel/BKE_blender_version.h
index 741abb50453..987b64c217e 100644
--- a/source/blender/blenkernel/BKE_blender_version.h
+++ b/source/blender/blenkernel/BKE_blender_version.h
@@ -31,15 +31,15 @@ extern "C" {
*/
/* Blender major and minor version. */
-#define BLENDER_VERSION 291
+#define BLENDER_VERSION 292
/* Blender patch version for bugfix releases. */
#define BLENDER_VERSION_PATCH 0
/** Blender release cycle stage: alpha/beta/rc/release. */
-#define BLENDER_VERSION_CYCLE beta
+#define BLENDER_VERSION_CYCLE alpha
/* Blender file format version. */
#define BLENDER_FILE_VERSION BLENDER_VERSION
-#define BLENDER_FILE_SUBVERSION 9
+#define BLENDER_FILE_SUBVERSION 0
/* Minimum Blender version that supports reading file written with the current
* version. Older Blender versions will test this and show a warning if the file
diff --git a/source/blender/blenkernel/BKE_multires.h b/source/blender/blenkernel/BKE_multires.h
index fbdfc5b76a7..763011c8d92 100644
--- a/source/blender/blenkernel/BKE_multires.h
+++ b/source/blender/blenkernel/BKE_multires.h
@@ -36,7 +36,6 @@ struct DerivedMesh;
struct MDisps;
struct Mesh;
struct ModifierData;
-struct Multires;
struct MultiresModifierData;
struct Object;
struct Scene;
@@ -114,22 +113,12 @@ int multiresModifier_rebuild_subdiv(struct Depsgraph *depsgraph,
struct MultiresModifierData *mmd,
int rebuild_limit,
bool switch_view_to_lower_level);
-void multiresModifier_subdivide_legacy(struct MultiresModifierData *mmd,
- struct Scene *scene,
- struct Object *ob,
- int updateblock,
- int simple);
void multiresModifier_sync_levels_ex(struct Object *ob_dst,
struct MultiresModifierData *mmd_src,
struct MultiresModifierData *mmd_dst);
void multires_stitch_grids(struct Object *);
-/* Related to the old multires */
-void multires_free(struct Multires *mr);
-void multires_load_old(struct Object *ob, struct Mesh *me);
-void multires_load_old_250(struct Mesh *);
-
void multiresModifier_scale_disp(struct Depsgraph *depsgraph,
struct Scene *scene,
struct Object *ob);
diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c
index 7b8ed47c513..4aa328fcb22 100644
--- a/source/blender/blenkernel/intern/armature.c
+++ b/source/blender/blenkernel/intern/armature.c
@@ -2573,6 +2573,19 @@ void BKE_pose_rebuild(Main *bmain, Object *ob, bArmature *arm, const bool do_id_
}
}
+/**
+ * Ensures object's pose is rebuilt if needed.
+ *
+ * \param bmain: May be NULL, only used to tag depsgraph as being dirty...
+ */
+void BKE_pose_ensure(Main *bmain, Object *ob, bArmature *arm, const bool do_id_user)
+{
+ BLI_assert(!ELEM(NULL, arm, ob));
+ if ((ob->pose == NULL) || (ob->pose->flag & POSE_RECALC)) {
+ BKE_pose_rebuild(bmain, ob, arm, do_id_user);
+ }
+}
+
/** \} */
/* -------------------------------------------------------------------- */
@@ -2711,11 +2724,9 @@ void BKE_pose_where_is(struct Depsgraph *depsgraph, Scene *scene, Object *ob)
if (ELEM(NULL, arm, scene)) {
return;
}
- if ((ob->pose == NULL) || (ob->pose->flag & POSE_RECALC)) {
- /* WARNING! passing NULL bmain here means we won't tag depsgraph's as dirty -
- * hopefully this is OK. */
- BKE_pose_rebuild(NULL, ob, arm, true);
- }
+ /* WARNING! passing NULL bmain here means we won't tag depsgraph's as dirty -
+ * hopefully this is OK. */
+ BKE_pose_ensure(NULL, ob, arm, true);
ctime = BKE_scene_frame_get(scene); /* not accurate... */
diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c
index 1eb374d1a08..fa45a4ba836 100644
--- a/source/blender/blenkernel/intern/curve.c
+++ b/source/blender/blenkernel/intern/curve.c
@@ -438,7 +438,6 @@ ListBase *BKE_curve_editNurbs_get(Curve *cu)
short BKE_curve_type_get(const Curve *cu)
{
- Nurb *nu;
int type = cu->type;
if (cu->vfont) {
@@ -448,7 +447,7 @@ short BKE_curve_type_get(const Curve *cu)
if (!cu->type) {
type = OB_CURVE;
- for (nu = cu->nurb.first; nu; nu = nu->next) {
+ LISTBASE_FOREACH (Nurb *, nu, &cu->nurb) {
if (nu->pntsv > 1) {
type = OB_SURF;
}
@@ -461,15 +460,14 @@ short BKE_curve_type_get(const Curve *cu)
void BKE_curve_curve_dimension_update(Curve *cu)
{
ListBase *nurbs = BKE_curve_nurbs_get(cu);
- Nurb *nu = nurbs->first;
if (cu->flag & CU_3D) {
- for (; nu; nu = nu->next) {
+ LISTBASE_FOREACH (Nurb *, nu, nurbs) {
nu->flag &= ~CU_2D;
}
}
else {
- for (; nu; nu = nu->next) {
+ LISTBASE_FOREACH (Nurb *, nu, nurbs) {
nu->flag |= CU_2D;
BKE_nurb_test_2d(nu);
@@ -569,10 +567,9 @@ void BKE_curve_texspace_get(Curve *cu, float r_loc[3], float r_size[3])
bool BKE_nurbList_index_get_co(ListBase *nurb, const int index, float r_co[3])
{
- Nurb *nu;
int tot = 0;
- for (nu = nurb->first; nu; nu = nu->next) {
+ LISTBASE_FOREACH (Nurb *, nu, nurb) {
int tot_nu;
if (nu->type == CU_BEZIER) {
tot_nu = nu->pntsu;
@@ -596,39 +593,33 @@ bool BKE_nurbList_index_get_co(ListBase *nurb, const int index, float r_co[3])
int BKE_nurbList_verts_count(ListBase *nurb)
{
- Nurb *nu;
int tot = 0;
- nu = nurb->first;
- while (nu) {
+ LISTBASE_FOREACH (Nurb *, nu, nurb) {
if (nu->bezt) {
tot += 3 * nu->pntsu;
}
else if (nu->bp) {
tot += nu->pntsu * nu->pntsv;
}
-
- nu = nu->next;
}
+
return tot;
}
int BKE_nurbList_verts_count_without_handles(ListBase *nurb)
{
- Nurb *nu;
int tot = 0;
- nu = nurb->first;
- while (nu) {
+ LISTBASE_FOREACH (Nurb *, nu, nurb) {
if (nu->bezt) {
tot += nu->pntsu;
}
else if (nu->bp) {
tot += nu->pntsu * nu->pntsv;
}
-
- nu = nu->next;
}
+
return tot;
}
@@ -636,7 +627,6 @@ int BKE_nurbList_verts_count_without_handles(ListBase *nurb)
void BKE_nurb_free(Nurb *nu)
{
-
if (nu == NULL) {
return;
}
@@ -664,17 +654,12 @@ void BKE_nurb_free(Nurb *nu)
void BKE_nurbList_free(ListBase *lb)
{
- Nurb *nu, *next;
-
if (lb == NULL) {
return;
}
- nu = lb->first;
- while (nu) {
- next = nu->next;
+ LISTBASE_FOREACH_MUTABLE (Nurb *, nu, lb) {
BKE_nurb_free(nu);
- nu = next;
}
BLI_listbase_clear(lb);
}
@@ -747,16 +732,11 @@ Nurb *BKE_nurb_copy(Nurb *src, int pntsu, int pntsv)
void BKE_nurbList_duplicate(ListBase *lb1, const ListBase *lb2)
{
- Nurb *nu, *nun;
-
BKE_nurbList_free(lb1);
- nu = lb2->first;
- while (nu) {
- nun = BKE_nurb_duplicate(nu);
- BLI_addtail(lb1, nun);
-
- nu = nu->next;
+ LISTBASE_FOREACH (const Nurb *, nu, lb2) {
+ Nurb *nurb_new = BKE_nurb_duplicate(nu);
+ BLI_addtail(lb1, nurb_new);
}
}
@@ -2625,9 +2605,7 @@ static void bevlist_firstlast_direction_calc_from_bpoint(Nurb *nu, BevList *bl)
void BKE_curve_bevelList_free(ListBase *bev)
{
- BevList *bl, *blnext;
- for (bl = bev->first; bl != NULL; bl = blnext) {
- blnext = bl->next;
+ LISTBASE_FOREACH_MUTABLE (BevList *, bl, bev) {
if (bl->seglen != NULL) {
MEM_freeN(bl->seglen);
}
@@ -2654,10 +2632,9 @@ void BKE_curve_bevelList_make(Object *ob, ListBase *nurbs, bool for_render)
/* this function needs an object, because of tflag and upflag */
Curve *cu = ob->data;
- Nurb *nu;
BezTriple *bezt, *prevbezt;
BPoint *bp;
- BevList *bl, *blnew, *blnext;
+ BevList *blnew;
BevPoint *bevp2, *bevp1 = NULL, *bevp0;
const float treshold = 0.00001f;
float min, inp;
@@ -2685,16 +2662,26 @@ void BKE_curve_bevelList_make(Object *ob, ListBase *nurbs, bool for_render)
/* STEP 1: MAKE POLYS */
BKE_curve_bevelList_free(&ob->runtime.curve_cache->bev);
- nu = nurbs->first;
if (cu->editnurb && ob->type != OB_FONT) {
is_editmode = 1;
}
- for (; nu; nu = nu->next) {
+ LISTBASE_FOREACH (Nurb *, nu, nurbs) {
if (nu->hide && is_editmode) {
continue;
}
+ /* check we are a single point? also check we are not a surface and that the orderu is sane,
+ * enforced in the UI but can go wrong possibly */
+ if (!BKE_nurb_check_valid_u(nu)) {
+ BevList *bl = MEM_callocN(sizeof(BevList), "makeBevelList1");
+ bl->bevpoints = MEM_calloc_arrayN(1, sizeof(BevPoint), "makeBevelPoints1");
+ BLI_addtail(bev, bl);
+ bl->nr = 0;
+ bl->charidx = nu->charidx;
+ continue;
+ }
+
/* check if we will calculate tilt data */
do_tilt = CU_DO_TILT(cu, nu);
@@ -2703,89 +2690,231 @@ void BKE_curve_bevelList_make(Object *ob, ListBase *nurbs, bool for_render)
do_weight = true;
- /* check we are a single point? also check we are not a surface and that the orderu is sane,
- * enforced in the UI but can go wrong possibly */
- if (!BKE_nurb_check_valid_u(nu)) {
- bl = MEM_callocN(sizeof(BevList), "makeBevelList1");
- bl->bevpoints = MEM_calloc_arrayN(1, sizeof(BevPoint), "makeBevelPoints1");
+ BevPoint *bevp;
+
+ if (for_render && cu->resolu_ren != 0) {
+ resolu = cu->resolu_ren;
+ }
+ else {
+ resolu = nu->resolu;
+ }
+
+ segcount = SEGMENTSU(nu);
+
+ if (nu->type == CU_POLY) {
+ len = nu->pntsu;
+ BevList *bl = MEM_callocN(sizeof(BevList), "makeBevelList2");
+ bl->bevpoints = MEM_calloc_arrayN(len, sizeof(BevPoint), "makeBevelPoints2");
+ if (need_seglen && (nu->flagu & CU_NURB_CYCLIC) == 0) {
+ bl->seglen = MEM_malloc_arrayN(segcount, sizeof(float), "makeBevelList2_seglen");
+ bl->segbevcount = MEM_malloc_arrayN(segcount, sizeof(int), "makeBevelList2_segbevcount");
+ }
BLI_addtail(bev, bl);
- bl->nr = 0;
+
+ bl->poly = (nu->flagu & CU_NURB_CYCLIC) ? 0 : -1;
+ bl->nr = len;
+ bl->dupe_nr = 0;
bl->charidx = nu->charidx;
+ bevp = bl->bevpoints;
+ bevp->offset = 0;
+ bp = nu->bp;
+ seglen = bl->seglen;
+ segbevcount = bl->segbevcount;
+
+ while (len--) {
+ copy_v3_v3(bevp->vec, bp->vec);
+ bevp->tilt = bp->tilt;
+ bevp->radius = bp->radius;
+ bevp->weight = bp->weight;
+ bevp->split_tag = true;
+ bp++;
+ if (seglen != NULL && len != 0) {
+ *seglen = len_v3v3(bevp->vec, bp->vec);
+ bevp++;
+ bevp->offset = *seglen;
+ if (*seglen > treshold) {
+ *segbevcount = 1;
+ }
+ else {
+ *segbevcount = 0;
+ }
+ seglen++;
+ segbevcount++;
+ }
+ else {
+ bevp++;
+ }
+ }
+
+ if ((nu->flagu & CU_NURB_CYCLIC) == 0) {
+ bevlist_firstlast_direction_calc_from_bpoint(nu, bl);
+ }
}
- else {
- BevPoint *bevp;
+ else if (nu->type == CU_BEZIER) {
+ /* in case last point is not cyclic */
+ len = segcount * resolu + 1;
+
+ BevList *bl = MEM_callocN(sizeof(BevList), "makeBevelBPoints");
+ bl->bevpoints = MEM_calloc_arrayN(len, sizeof(BevPoint), "makeBevelBPointsPoints");
+ if (need_seglen && (nu->flagu & CU_NURB_CYCLIC) == 0) {
+ bl->seglen = MEM_malloc_arrayN(segcount, sizeof(float), "makeBevelBPoints_seglen");
+ bl->segbevcount = MEM_malloc_arrayN(segcount, sizeof(int), "makeBevelBPoints_segbevcount");
+ }
+ BLI_addtail(bev, bl);
- if (for_render && cu->resolu_ren != 0) {
- resolu = cu->resolu_ren;
+ bl->poly = (nu->flagu & CU_NURB_CYCLIC) ? 0 : -1;
+ bl->charidx = nu->charidx;
+
+ bevp = bl->bevpoints;
+ seglen = bl->seglen;
+ segbevcount = bl->segbevcount;
+
+ bevp->offset = 0;
+ if (seglen != NULL) {
+ *seglen = 0;
+ *segbevcount = 0;
+ }
+
+ a = nu->pntsu - 1;
+ bezt = nu->bezt;
+ if (nu->flagu & CU_NURB_CYCLIC) {
+ a++;
+ prevbezt = nu->bezt + (nu->pntsu - 1);
}
else {
- resolu = nu->resolu;
+ prevbezt = bezt;
+ bezt++;
}
- segcount = SEGMENTSU(nu);
+ sub_v3_v3v3(bevp->dir, prevbezt->vec[2], prevbezt->vec[1]);
+ normalize_v3(bevp->dir);
- if (nu->type == CU_POLY) {
- len = nu->pntsu;
- bl = MEM_callocN(sizeof(BevList), "makeBevelList2");
- bl->bevpoints = MEM_calloc_arrayN(len, sizeof(BevPoint), "makeBevelPoints2");
- if (need_seglen && (nu->flagu & CU_NURB_CYCLIC) == 0) {
- bl->seglen = MEM_malloc_arrayN(segcount, sizeof(float), "makeBevelList2_seglen");
- bl->segbevcount = MEM_malloc_arrayN(segcount, sizeof(int), "makeBevelList2_segbevcount");
- }
- BLI_addtail(bev, bl);
+ BLI_assert(segcount >= a);
- bl->poly = (nu->flagu & CU_NURB_CYCLIC) ? 0 : -1;
- bl->nr = len;
- bl->dupe_nr = 0;
- bl->charidx = nu->charidx;
- bevp = bl->bevpoints;
- bevp->offset = 0;
- bp = nu->bp;
- seglen = bl->seglen;
- segbevcount = bl->segbevcount;
+ while (a--) {
+ if (prevbezt->h2 == HD_VECT && bezt->h1 == HD_VECT) {
- while (len--) {
- copy_v3_v3(bevp->vec, bp->vec);
- bevp->tilt = bp->tilt;
- bevp->radius = bp->radius;
- bevp->weight = bp->weight;
+ copy_v3_v3(bevp->vec, prevbezt->vec[1]);
+ bevp->tilt = prevbezt->tilt;
+ bevp->radius = prevbezt->radius;
+ bevp->weight = prevbezt->weight;
bevp->split_tag = true;
- bp++;
- if (seglen != NULL && len != 0) {
- *seglen = len_v3v3(bevp->vec, bp->vec);
- bevp++;
+ bevp->dupe_tag = false;
+ bevp++;
+ bl->nr++;
+ bl->dupe_nr = 1;
+ if (seglen != NULL) {
+ *seglen = len_v3v3(prevbezt->vec[1], bezt->vec[1]);
bevp->offset = *seglen;
- if (*seglen > treshold) {
+ seglen++;
+ /* match segbevcount to the cleaned up bevel lists (see STEP 2) */
+ if (bevp->offset > treshold) {
*segbevcount = 1;
}
- else {
- *segbevcount = 0;
+ segbevcount++;
+ }
+ }
+ else {
+ /* always do all three, to prevent data hanging around */
+ int j;
+
+ /* BevPoint must stay aligned to 4 so sizeof(BevPoint)/sizeof(float) works */
+ for (j = 0; j < 3; j++) {
+ BKE_curve_forward_diff_bezier(prevbezt->vec[1][j],
+ prevbezt->vec[2][j],
+ bezt->vec[0][j],
+ bezt->vec[1][j],
+ &(bevp->vec[j]),
+ resolu,
+ sizeof(BevPoint));
+ }
+
+ /* if both arrays are NULL do nothiong */
+ tilt_bezpart(prevbezt,
+ bezt,
+ nu,
+ do_tilt ? &bevp->tilt : NULL,
+ do_radius ? &bevp->radius : NULL,
+ do_weight ? &bevp->weight : NULL,
+ resolu,
+ sizeof(BevPoint));
+
+ if (cu->twist_mode == CU_TWIST_TANGENT) {
+ forward_diff_bezier_cotangent(prevbezt->vec[1],
+ prevbezt->vec[2],
+ bezt->vec[0],
+ bezt->vec[1],
+ bevp->tan,
+ resolu,
+ sizeof(BevPoint));
+ }
+
+ /* indicate with handlecodes double points */
+ if (prevbezt->h1 == prevbezt->h2) {
+ if (prevbezt->h1 == 0 || prevbezt->h1 == HD_VECT) {
+ bevp->split_tag = true;
+ }
+ }
+ else {
+ if (prevbezt->h1 == 0 || prevbezt->h1 == HD_VECT) {
+ bevp->split_tag = true;
+ }
+ else if (prevbezt->h2 == 0 || prevbezt->h2 == HD_VECT) {
+ bevp->split_tag = true;
+ }
+ }
+
+ /* seglen */
+ if (seglen != NULL) {
+ *seglen = 0;
+ *segbevcount = 0;
+ for (j = 0; j < resolu; j++) {
+ bevp0 = bevp;
+ bevp++;
+ bevp->offset = len_v3v3(bevp0->vec, bevp->vec);
+ /* match seglen and segbevcount to the cleaned up bevel lists (see STEP 2) */
+ if (bevp->offset > treshold) {
+ *seglen += bevp->offset;
+ *segbevcount += 1;
+ }
}
seglen++;
segbevcount++;
}
else {
- bevp++;
+ bevp += resolu;
}
+ bl->nr += resolu;
}
+ prevbezt = bezt;
+ bezt++;
+ }
- if ((nu->flagu & CU_NURB_CYCLIC) == 0) {
- bevlist_firstlast_direction_calc_from_bpoint(nu, bl);
- }
+ if ((nu->flagu & CU_NURB_CYCLIC) == 0) { /* not cyclic: endpoint */
+ copy_v3_v3(bevp->vec, prevbezt->vec[1]);
+ bevp->tilt = prevbezt->tilt;
+ bevp->radius = prevbezt->radius;
+ bevp->weight = prevbezt->weight;
+
+ sub_v3_v3v3(bevp->dir, prevbezt->vec[1], prevbezt->vec[0]);
+ normalize_v3(bevp->dir);
+
+ bl->nr++;
}
- else if (nu->type == CU_BEZIER) {
- /* in case last point is not cyclic */
- len = segcount * resolu + 1;
+ }
+ else if (nu->type == CU_NURBS) {
+ if (nu->pntsv == 1) {
+ len = (resolu * segcount);
- bl = MEM_callocN(sizeof(BevList), "makeBevelBPoints");
- bl->bevpoints = MEM_calloc_arrayN(len, sizeof(BevPoint), "makeBevelBPointsPoints");
+ BevList *bl = MEM_callocN(sizeof(BevList), "makeBevelList3");
+ bl->bevpoints = MEM_calloc_arrayN(len, sizeof(BevPoint), "makeBevelPoints3");
if (need_seglen && (nu->flagu & CU_NURB_CYCLIC) == 0) {
- bl->seglen = MEM_malloc_arrayN(segcount, sizeof(float), "makeBevelBPoints_seglen");
- bl->segbevcount = MEM_malloc_arrayN(
- segcount, sizeof(int), "makeBevelBPoints_segbevcount");
+ bl->seglen = MEM_malloc_arrayN(segcount, sizeof(float), "makeBevelList3_seglen");
+ bl->segbevcount = MEM_malloc_arrayN(segcount, sizeof(int), "makeBevelList3_segbevcount");
}
BLI_addtail(bev, bl);
-
+ bl->nr = len;
+ bl->dupe_nr = 0;
bl->poly = (nu->flagu & CU_NURB_CYCLIC) ? 0 : -1;
bl->charidx = nu->charidx;
@@ -2793,294 +2922,136 @@ void BKE_curve_bevelList_make(Object *ob, ListBase *nurbs, bool for_render)
seglen = bl->seglen;
segbevcount = bl->segbevcount;
- bevp->offset = 0;
- if (seglen != NULL) {
- *seglen = 0;
- *segbevcount = 0;
- }
+ BKE_nurb_makeCurve(nu,
+ &bevp->vec[0],
+ do_tilt ? &bevp->tilt : NULL,
+ do_radius ? &bevp->radius : NULL,
+ do_weight ? &bevp->weight : NULL,
+ resolu,
+ sizeof(BevPoint));
- a = nu->pntsu - 1;
- bezt = nu->bezt;
- if (nu->flagu & CU_NURB_CYCLIC) {
- a++;
- prevbezt = nu->bezt + (nu->pntsu - 1);
- }
- else {
- prevbezt = bezt;
- bezt++;
- }
-
- sub_v3_v3v3(bevp->dir, prevbezt->vec[2], prevbezt->vec[1]);
- normalize_v3(bevp->dir);
-
- BLI_assert(segcount >= a);
-
- while (a--) {
- if (prevbezt->h2 == HD_VECT && bezt->h1 == HD_VECT) {
-
- copy_v3_v3(bevp->vec, prevbezt->vec[1]);
- bevp->tilt = prevbezt->tilt;
- bevp->radius = prevbezt->radius;
- bevp->weight = prevbezt->weight;
- bevp->split_tag = true;
- bevp->dupe_tag = false;
- bevp++;
- bl->nr++;
- bl->dupe_nr = 1;
- if (seglen != NULL) {
- *seglen = len_v3v3(prevbezt->vec[1], bezt->vec[1]);
- bevp->offset = *seglen;
- seglen++;
- /* match segbevcount to the cleaned up bevel lists (see STEP 2) */
- if (bevp->offset > treshold) {
- *segbevcount = 1;
- }
- segbevcount++;
- }
- }
- else {
- /* always do all three, to prevent data hanging around */
+ /* match seglen and segbevcount to the cleaned up bevel lists (see STEP 2) */
+ if (seglen != NULL) {
+ nr = segcount;
+ bevp0 = bevp;
+ bevp++;
+ while (nr) {
int j;
-
- /* BevPoint must stay aligned to 4 so sizeof(BevPoint)/sizeof(float) works */
- for (j = 0; j < 3; j++) {
- BKE_curve_forward_diff_bezier(prevbezt->vec[1][j],
- prevbezt->vec[2][j],
- bezt->vec[0][j],
- bezt->vec[1][j],
- &(bevp->vec[j]),
- resolu,
- sizeof(BevPoint));
- }
-
- /* if both arrays are NULL do nothiong */
- tilt_bezpart(prevbezt,
- bezt,
- nu,
- do_tilt ? &bevp->tilt : NULL,
- do_radius ? &bevp->radius : NULL,
- do_weight ? &bevp->weight : NULL,
- resolu,
- sizeof(BevPoint));
-
- if (cu->twist_mode == CU_TWIST_TANGENT) {
- forward_diff_bezier_cotangent(prevbezt->vec[1],
- prevbezt->vec[2],
- bezt->vec[0],
- bezt->vec[1],
- bevp->tan,
- resolu,
- sizeof(BevPoint));
- }
-
- /* indicate with handlecodes double points */
- if (prevbezt->h1 == prevbezt->h2) {
- if (prevbezt->h1 == 0 || prevbezt->h1 == HD_VECT) {
- bevp->split_tag = true;
- }
- }
- else {
- if (prevbezt->h1 == 0 || prevbezt->h1 == HD_VECT) {
- bevp->split_tag = true;
- }
- else if (prevbezt->h2 == 0 || prevbezt->h2 == HD_VECT) {
- bevp->split_tag = true;
- }
- }
-
- /* seglen */
- if (seglen != NULL) {
- *seglen = 0;
- *segbevcount = 0;
- for (j = 0; j < resolu; j++) {
- bevp0 = bevp;
- bevp++;
- bevp->offset = len_v3v3(bevp0->vec, bevp->vec);
- /* match seglen and segbevcount to the cleaned up bevel lists (see STEP 2) */
- if (bevp->offset > treshold) {
- *seglen += bevp->offset;
- *segbevcount += 1;
- }
+ *seglen = 0;
+ *segbevcount = 0;
+ /* We keep last bevel segment zero-length. */
+ for (j = 0; j < ((nr == 1) ? (resolu - 1) : resolu); j++) {
+ bevp->offset = len_v3v3(bevp0->vec, bevp->vec);
+ if (bevp->offset > treshold) {
+ *seglen += bevp->offset;
+ *segbevcount += 1;
}
- seglen++;
- segbevcount++;
+ bevp0 = bevp;
+ bevp++;
}
- else {
- bevp += resolu;
- }
- bl->nr += resolu;
+ seglen++;
+ segbevcount++;
+ nr--;
}
- prevbezt = bezt;
- bezt++;
- }
-
- if ((nu->flagu & CU_NURB_CYCLIC) == 0) { /* not cyclic: endpoint */
- copy_v3_v3(bevp->vec, prevbezt->vec[1]);
- bevp->tilt = prevbezt->tilt;
- bevp->radius = prevbezt->radius;
- bevp->weight = prevbezt->weight;
-
- sub_v3_v3v3(bevp->dir, prevbezt->vec[1], prevbezt->vec[0]);
- normalize_v3(bevp->dir);
-
- bl->nr++;
}
- }
- else if (nu->type == CU_NURBS) {
- if (nu->pntsv == 1) {
- len = (resolu * segcount);
-
- bl = MEM_callocN(sizeof(BevList), "makeBevelList3");
- bl->bevpoints = MEM_calloc_arrayN(len, sizeof(BevPoint), "makeBevelPoints3");
- if (need_seglen && (nu->flagu & CU_NURB_CYCLIC) == 0) {
- bl->seglen = MEM_malloc_arrayN(segcount, sizeof(float), "makeBevelList3_seglen");
- bl->segbevcount = MEM_malloc_arrayN(
- segcount, sizeof(int), "makeBevelList3_segbevcount");
- }
- BLI_addtail(bev, bl);
- bl->nr = len;
- bl->dupe_nr = 0;
- bl->poly = (nu->flagu & CU_NURB_CYCLIC) ? 0 : -1;
- bl->charidx = nu->charidx;
-
- bevp = bl->bevpoints;
- seglen = bl->seglen;
- segbevcount = bl->segbevcount;
-
- BKE_nurb_makeCurve(nu,
- &bevp->vec[0],
- do_tilt ? &bevp->tilt : NULL,
- do_radius ? &bevp->radius : NULL,
- do_weight ? &bevp->weight : NULL,
- resolu,
- sizeof(BevPoint));
-
- /* match seglen and segbevcount to the cleaned up bevel lists (see STEP 2) */
- if (seglen != NULL) {
- nr = segcount;
- bevp0 = bevp;
- bevp++;
- while (nr) {
- int j;
- *seglen = 0;
- *segbevcount = 0;
- /* We keep last bevel segment zero-length. */
- for (j = 0; j < ((nr == 1) ? (resolu - 1) : resolu); j++) {
- bevp->offset = len_v3v3(bevp0->vec, bevp->vec);
- if (bevp->offset > treshold) {
- *seglen += bevp->offset;
- *segbevcount += 1;
- }
- bevp0 = bevp;
- bevp++;
- }
- seglen++;
- segbevcount++;
- nr--;
- }
- }
- if ((nu->flagu & CU_NURB_CYCLIC) == 0) {
- bevlist_firstlast_direction_calc_from_bpoint(nu, bl);
- }
+ if ((nu->flagu & CU_NURB_CYCLIC) == 0) {
+ bevlist_firstlast_direction_calc_from_bpoint(nu, bl);
}
}
}
}
/* STEP 2: DOUBLE POINTS AND AUTOMATIC RESOLUTION, REDUCE DATABLOCKS */
- bl = bev->first;
- while (bl) {
- if (bl->nr) { /* null bevel items come from single points */
- bool is_cyclic = bl->poly != -1;
- nr = bl->nr;
- if (is_cyclic) {
- bevp1 = bl->bevpoints;
- bevp0 = bevp1 + (nr - 1);
+ LISTBASE_FOREACH (BevList *, bl, bev) {
+ if (bl->nr == 0) { /* null bevel items come from single points */
+ continue;
+ }
+
+ bool is_cyclic = bl->poly != -1;
+ nr = bl->nr;
+ if (is_cyclic) {
+ bevp1 = bl->bevpoints;
+ bevp0 = bevp1 + (nr - 1);
+ }
+ else {
+ bevp0 = bl->bevpoints;
+ bevp0->offset = 0;
+ bevp1 = bevp0 + 1;
+ }
+ nr--;
+ while (nr--) {
+ if (seglen != NULL) {
+ if (fabsf(bevp1->offset) < treshold) {
+ bevp0->dupe_tag = true;
+ bl->dupe_nr++;
+ }
}
else {
- bevp0 = bl->bevpoints;
- bevp0->offset = 0;
- bevp1 = bevp0 + 1;
- }
- nr--;
- while (nr--) {
- if (seglen != NULL) {
- if (fabsf(bevp1->offset) < treshold) {
- bevp0->dupe_tag = true;
- bl->dupe_nr++;
- }
- }
- else {
- if (fabsf(bevp0->vec[0] - bevp1->vec[0]) < 0.00001f) {
- if (fabsf(bevp0->vec[1] - bevp1->vec[1]) < 0.00001f) {
- if (fabsf(bevp0->vec[2] - bevp1->vec[2]) < 0.00001f) {
- bevp0->dupe_tag = true;
- bl->dupe_nr++;
- }
+ if (fabsf(bevp0->vec[0] - bevp1->vec[0]) < 0.00001f) {
+ if (fabsf(bevp0->vec[1] - bevp1->vec[1]) < 0.00001f) {
+ if (fabsf(bevp0->vec[2] - bevp1->vec[2]) < 0.00001f) {
+ bevp0->dupe_tag = true;
+ bl->dupe_nr++;
}
}
}
- bevp0 = bevp1;
- bevp1++;
}
+ bevp0 = bevp1;
+ bevp1++;
}
- bl = bl->next;
}
- bl = bev->first;
- while (bl) {
- blnext = bl->next;
- if (bl->nr && bl->dupe_nr) {
- nr = bl->nr - bl->dupe_nr + 1; /* +1 because vectorbezier sets flag too */
- blnew = MEM_mallocN(sizeof(BevList), "makeBevelList4");
- memcpy(blnew, bl, sizeof(BevList));
- blnew->bevpoints = MEM_calloc_arrayN(nr, sizeof(BevPoint), "makeBevelPoints4");
- if (!blnew->bevpoints) {
- MEM_freeN(blnew);
- break;
- }
- blnew->segbevcount = bl->segbevcount;
- blnew->seglen = bl->seglen;
- blnew->nr = 0;
- BLI_remlink(bev, bl);
- BLI_insertlinkbefore(bev, blnext, blnew); /* to make sure bevlijst is tuned with nurblist */
- bevp0 = bl->bevpoints;
- bevp1 = blnew->bevpoints;
- nr = bl->nr;
- while (nr--) {
- if (bevp0->dupe_tag == 0) {
- memcpy(bevp1, bevp0, sizeof(BevPoint));
- bevp1++;
- blnew->nr++;
- }
- bevp0++;
- }
- if (bl->bevpoints != NULL) {
- MEM_freeN(bl->bevpoints);
+
+ LISTBASE_FOREACH_MUTABLE (BevList *, bl, bev) {
+ if (bl->nr == 0 || bl->dupe_nr == 0) {
+ continue;
+ }
+
+ nr = bl->nr - bl->dupe_nr + 1; /* +1 because vectorbezier sets flag too */
+ blnew = MEM_mallocN(sizeof(BevList), "makeBevelList4");
+ memcpy(blnew, bl, sizeof(BevList));
+ blnew->bevpoints = MEM_calloc_arrayN(nr, sizeof(BevPoint), "makeBevelPoints4");
+ if (!blnew->bevpoints) {
+ MEM_freeN(blnew);
+ break;
+ }
+ blnew->segbevcount = bl->segbevcount;
+ blnew->seglen = bl->seglen;
+ blnew->nr = 0;
+ BLI_remlink(bev, bl);
+ BLI_insertlinkbefore(bev, bl->next, blnew); /* to make sure bevlist is tuned with nurblist */
+ bevp0 = bl->bevpoints;
+ bevp1 = blnew->bevpoints;
+ nr = bl->nr;
+ while (nr--) {
+ if (bevp0->dupe_tag == 0) {
+ memcpy(bevp1, bevp0, sizeof(BevPoint));
+ bevp1++;
+ blnew->nr++;
}
- MEM_freeN(bl);
- blnew->dupe_nr = 0;
+ bevp0++;
}
- bl = blnext;
+ if (bl->bevpoints != NULL) {
+ MEM_freeN(bl->bevpoints);
+ }
+ MEM_freeN(bl);
+ blnew->dupe_nr = 0;
}
/* STEP 3: POLYS COUNT AND AUTOHOLE */
- bl = bev->first;
poly = 0;
- while (bl) {
+ LISTBASE_FOREACH (BevList *, bl, bev) {
if (bl->nr && bl->poly >= 0) {
poly++;
bl->poly = poly;
bl->hole = 0;
}
- bl = bl->next;
}
/* find extreme left points, also test (turning) direction */
if (poly > 0) {
sd = sortdata = MEM_malloc_arrayN(poly, sizeof(struct BevelSort), "makeBevelList5");
- bl = bev->first;
- while (bl) {
+ LISTBASE_FOREACH (BevList *, bl, bev) {
if (bl->poly > 0) {
BevPoint *bevp;
@@ -3125,14 +3096,12 @@ void BKE_curve_bevelList_make(Object *ob, ListBase *nurbs, bool for_render)
sd++;
}
-
- bl = bl->next;
}
qsort(sortdata, poly, sizeof(struct BevelSort), vergxcobev);
sd = sortdata + 1;
for (a = 1; a < poly; a++, sd++) {
- bl = sd->bl; /* is bl a hole? */
+ BevList *bl = sd->bl; /* is bl a hole? */
sd1 = sortdata + (a - 1);
for (b = a - 1; b >= 0; b--, sd1--) { /* all polys to the left */
if (sd1->bl->charidx == bl->charidx) { /* for text, only check matching char */
@@ -3149,7 +3118,7 @@ void BKE_curve_bevelList_make(Object *ob, ListBase *nurbs, bool for_render)
sd = sortdata;
for (a = 0; a < poly; a++, sd++) {
if (sd->bl->hole == sd->dir) {
- bl = sd->bl;
+ BevList *bl = sd->bl;
bevp1 = bl->bevpoints;
bevp2 = bevp1 + (bl->nr - 1);
nr = bl->nr / 2;
@@ -3167,7 +3136,7 @@ void BKE_curve_bevelList_make(Object *ob, ListBase *nurbs, bool for_render)
/* STEP 4: 2D-COSINES or 3D ORIENTATION */
if ((cu->flag & CU_3D) == 0) {
/* 2D Curves */
- for (bl = bev->first; bl; bl = bl->next) {
+ LISTBASE_FOREACH (BevList *, bl, bev) {
if (bl->nr < 2) {
BevPoint *bevp = bl->bevpoints;
unit_qt(bevp->quat);
@@ -3182,7 +3151,7 @@ void BKE_curve_bevelList_make(Object *ob, ListBase *nurbs, bool for_render)
}
else {
/* 3D Curves */
- for (bl = bev->first; bl; bl = bl->next) {
+ LISTBASE_FOREACH (BevList *, bl, bev) {
if (bl->nr < 2) {
BevPoint *bevp = bl->bevpoints;
unit_qt(bevp->quat);
@@ -3676,7 +3645,7 @@ static bool tridiagonal_solve_with_limits(float *a,
* is affected by all other points of the curve segment, in practice the influence
* decreases exponentially with distance.
*
- * Note: this algorithm assumes that the handle horizontal size if always 1/3 of the
+ * Note: this algorithm assumes that the handle horizontal size is always 1/3 of the
* of the interval to the next point. This rule ensures linear interpolation of time.
*
* ^ height (co 1)
@@ -4316,12 +4285,8 @@ void BKE_nurb_handles_autocalc(Nurb *nu, uint8_t flag)
void BKE_nurbList_handles_autocalc(ListBase *editnurb, uint8_t flag)
{
- Nurb *nu;
-
- nu = editnurb->first;
- while (nu) {
+ LISTBASE_FOREACH (Nurb *, nu, editnurb) {
BKE_nurb_handles_autocalc(nu, flag);
- nu = nu->next;
}
}
@@ -4333,13 +4298,11 @@ void BKE_nurbList_handles_set(ListBase *editnurb, const char code)
/* code==4: sets icu flag to become IPO_AUTO_HORIZ, horizontal extremes on auto-handles */
/* code==5: Set align, like 3 but no toggle */
/* code==6: Clear align, like 3 but no toggle */
- Nurb *nu;
BezTriple *bezt;
int a;
if (ELEM(code, HD_AUTO, HD_VECT)) {
- nu = editnurb->first;
- while (nu) {
+ LISTBASE_FOREACH (Nurb *, nu, editnurb) {
if (nu->type == CU_BEZIER) {
bezt = nu->bezt;
a = nu->pntsu;
@@ -4366,7 +4329,6 @@ void BKE_nurbList_handles_set(ListBase *editnurb, const char code)
/* like BKE_nurb_handles_calc but moves selected */
nurb_handles_calc__align_selected(nu);
}
- nu = nu->next;
}
}
else {
@@ -4381,7 +4343,7 @@ void BKE_nurbList_handles_set(ListBase *editnurb, const char code)
}
else {
/* Toggle */
- for (nu = editnurb->first; nu; nu = nu->next) {
+ LISTBASE_FOREACH (Nurb *, nu, editnurb) {
if (nu->type == CU_BEZIER) {
bezt = nu->bezt;
a = nu->pntsu;
@@ -4397,7 +4359,7 @@ void BKE_nurbList_handles_set(ListBase *editnurb, const char code)
}
h_new = (h_new == HD_FREE) ? HD_ALIGN : HD_FREE;
}
- for (nu = editnurb->first; nu; nu = nu->next) {
+ LISTBASE_FOREACH (Nurb *, nu, editnurb) {
if (nu->type == CU_BEZIER) {
bezt = nu->bezt;
a = nu->pntsu;
@@ -4423,66 +4385,66 @@ void BKE_nurbList_handles_recalculate(ListBase *editnurb,
const bool calc_length,
const uint8_t flag)
{
- Nurb *nu;
BezTriple *bezt;
int a;
- for (nu = editnurb->first; nu; nu = nu->next) {
- if (nu->type == CU_BEZIER) {
- bool changed = false;
+ LISTBASE_FOREACH (Nurb *, nu, editnurb) {
+ if (nu->type != CU_BEZIER) {
+ continue;
+ }
- for (a = nu->pntsu, bezt = nu->bezt; a--; bezt++) {
+ bool changed = false;
- const bool h1_select = (bezt->f1 & flag) == flag;
- const bool h2_select = (bezt->f3 & flag) == flag;
+ for (a = nu->pntsu, bezt = nu->bezt; a--; bezt++) {
- if (h1_select || h2_select) {
+ const bool h1_select = (bezt->f1 & flag) == flag;
+ const bool h2_select = (bezt->f3 & flag) == flag;
- float co1_back[3], co2_back[3];
+ if (h1_select || h2_select) {
- copy_v3_v3(co1_back, bezt->vec[0]);
- copy_v3_v3(co2_back, bezt->vec[2]);
+ float co1_back[3], co2_back[3];
- BKE_nurb_handle_calc_simple_auto(nu, bezt);
+ copy_v3_v3(co1_back, bezt->vec[0]);
+ copy_v3_v3(co2_back, bezt->vec[2]);
- if (h1_select) {
- if (!calc_length) {
- dist_ensure_v3_v3fl(bezt->vec[0], bezt->vec[1], len_v3v3(co1_back, bezt->vec[1]));
- }
- }
- else {
- copy_v3_v3(bezt->vec[0], co1_back);
- }
+ BKE_nurb_handle_calc_simple_auto(nu, bezt);
- if (h2_select) {
- if (!calc_length) {
- dist_ensure_v3_v3fl(bezt->vec[2], bezt->vec[1], len_v3v3(co2_back, bezt->vec[1]));
- }
- }
- else {
- copy_v3_v3(bezt->vec[2], co2_back);
+ if (h1_select) {
+ if (!calc_length) {
+ dist_ensure_v3_v3fl(bezt->vec[0], bezt->vec[1], len_v3v3(co1_back, bezt->vec[1]));
}
+ }
+ else {
+ copy_v3_v3(bezt->vec[0], co1_back);
+ }
- changed = true;
+ if (h2_select) {
+ if (!calc_length) {
+ dist_ensure_v3_v3fl(bezt->vec[2], bezt->vec[1], len_v3v3(co2_back, bezt->vec[1]));
+ }
+ }
+ else {
+ copy_v3_v3(bezt->vec[2], co2_back);
}
- }
- if (changed) {
- /* Recalculate the whole curve */
- BKE_nurb_handles_calc(nu);
+ changed = true;
}
}
+
+ if (changed) {
+ /* Recalculate the whole curve */
+ BKE_nurb_handles_calc(nu);
+ }
}
}
void BKE_nurbList_flag_set(ListBase *editnurb, uint8_t flag, bool set)
{
- Nurb *nu;
BezTriple *bezt;
BPoint *bp;
int a;
- for (nu = editnurb->first; nu; nu = nu->next) {
+ LISTBASE_FOREACH (Nurb *, nu, editnurb) {
if (nu->type == CU_BEZIER) {
a = nu->pntsu;
bezt = nu->bezt;
@@ -4518,7 +4480,7 @@ bool BKE_nurbList_flag_set_from_flag(ListBase *editnurb, uint8_t from_flag, uint
{
bool changed = false;
- for (Nurb *nu = editnurb->first; nu; nu = nu->next) {
+ LISTBASE_FOREACH (Nurb *, nu, editnurb) {
if (nu->type == CU_BEZIER) {
for (int i = 0; i < nu->pntsu; i++) {
BezTriple *bezt = &nu->bezt[i];
@@ -5232,12 +5194,11 @@ bool BKE_curve_minmax(Curve *cu, bool use_radius, float min[3], float max[3])
bool BKE_curve_center_median(Curve *cu, float cent[3])
{
ListBase *nurb_lb = BKE_curve_nurbs_get(cu);
- Nurb *nu;
int total = 0;
zero_v3(cent);
- for (nu = nurb_lb->first; nu; nu = nu->next) {
+ LISTBASE_FOREACH (Nurb *, nu, nurb_lb) {
int i;
if (nu->type == CU_BEZIER) {
@@ -5285,12 +5246,11 @@ void BKE_curve_transform_ex(Curve *cu,
const bool do_props,
const float unit_scale)
{
- Nurb *nu;
BPoint *bp;
BezTriple *bezt;
int i;
- for (nu = cu->nurb.first; nu; nu = nu->next) {
+ LISTBASE_FOREACH (Nurb *, nu, &cu->nurb) {
if (nu->type == CU_BEZIER) {
i = nu->pntsu;
for (bezt = nu->bezt; i--; bezt++) {
@@ -5315,12 +5275,11 @@ void BKE_curve_transform_ex(Curve *cu,
}
if (do_keys && cu->key) {
- KeyBlock *kb;
- for (kb = cu->key->block.first; kb; kb = kb->next) {
+ LISTBASE_FOREACH (KeyBlock *, kb, &cu->key->block) {
float *fp = kb->data;
int n = kb->totelem;
- for (nu = cu->nurb.first; nu; nu = nu->next) {
+ LISTBASE_FOREACH (Nurb *, nu, &cu->nurb) {
if (nu->type == CU_BEZIER) {
for (i = nu->pntsu; i && (n -= KEYELEM_ELEM_LEN_BEZTRIPLE) >= 0; i--) {
mul_m4_v3(mat, &fp[0]);
@@ -5476,9 +5435,8 @@ bool BKE_curve_material_index_validate(Curve *cu)
}
}
else {
- Nurb *nu;
const int max_idx = max_ii(0, cu->totcol - 1);
- for (nu = cu->nurb.first; nu; nu = nu->next) {
+ LISTBASE_FOREACH (Nurb *, nu, &cu->nurb) {
if (nu->mat_nr > max_idx) {
nu->mat_nr = 0;
is_valid = false;
@@ -5544,12 +5502,12 @@ void BKE_curve_material_remap(Curve *cu, const unsigned int *remap, unsigned int
void BKE_curve_smooth_flag_set(Curve *cu, const bool use_smooth)
{
if (use_smooth) {
- for (Nurb *nu = cu->nurb.first; nu; nu = nu->next) {
+ LISTBASE_FOREACH (Nurb *, nu, &cu->nurb) {
nu->flag |= CU_SMOOTH;
}
}
else {
- for (Nurb *nu = cu->nurb.first; nu; nu = nu->next) {
+ LISTBASE_FOREACH (Nurb *, nu, &cu->nurb) {
nu->flag &= ~CU_SMOOTH;
}
}
diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c
index bcb467e1230..f5257eb12ab 100644
--- a/source/blender/blenkernel/intern/displist.c
+++ b/source/blender/blenkernel/intern/displist.c
@@ -92,17 +92,13 @@ void BKE_displist_free(ListBase *lb)
DispList *BKE_displist_find_or_create(ListBase *lb, int type)
{
- DispList *dl;
-
- dl = lb->first;
- while (dl) {
+ LISTBASE_FOREACH (DispList *, dl, lb) {
if (dl->type == type) {
return dl;
}
- dl = dl->next;
}
- dl = MEM_callocN(sizeof(DispList), "find_disp");
+ DispList *dl = MEM_callocN(sizeof(DispList), "find_disp");
dl->type = type;
BLI_addtail(lb, dl);
@@ -111,14 +107,10 @@ DispList *BKE_displist_find_or_create(ListBase *lb, int type)
DispList *BKE_displist_find(ListBase *lb, int type)
{
- DispList *dl;
-
- dl = lb->first;
- while (dl) {
+ LISTBASE_FOREACH (DispList *, dl, lb) {
if (dl->type == type) {
return dl;
}
- dl = dl->next;
}
return NULL;
@@ -126,9 +118,7 @@ DispList *BKE_displist_find(ListBase *lb, int type)
bool BKE_displist_has_faces(ListBase *lb)
{
- DispList *dl;
-
- for (dl = lb->first; dl; dl = dl->next) {
+ LISTBASE_FOREACH (DispList *, dl, lb) {
if (ELEM(dl->type, DL_INDEX3, DL_INDEX4, DL_SURF)) {
return true;
}
@@ -139,13 +129,10 @@ bool BKE_displist_has_faces(ListBase *lb)
void BKE_displist_copy(ListBase *lbn, ListBase *lb)
{
- DispList *dln, *dl;
-
BKE_displist_free(lbn);
- dl = lb->first;
- while (dl) {
- dln = MEM_dupallocN(dl);
+ LISTBASE_FOREACH (const DispList *, dl, lb) {
+ DispList *dln = MEM_dupallocN(dl);
BLI_addtail(lbn, dln);
dln->verts = MEM_dupallocN(dl->verts);
dln->nors = MEM_dupallocN(dl->nors);
@@ -154,22 +141,17 @@ void BKE_displist_copy(ListBase *lbn, ListBase *lb)
if (dl->bevel_split) {
dln->bevel_split = MEM_dupallocN(dl->bevel_split);
}
-
- dl = dl->next;
}
}
void BKE_displist_normals_add(ListBase *lb)
{
- DispList *dl = NULL;
float *vdata, *ndata, nor[3];
float *v1, *v2, *v3, *v4;
float *n1, *n2, *n3, *n4;
int a, b, p1, p2, p3, p4;
- dl = lb->first;
-
- while (dl) {
+ LISTBASE_FOREACH (DispList *, dl, lb) {
if (dl->type == DL_INDEX3) {
if (dl->nors == NULL) {
dl->nors = MEM_callocN(sizeof(float[3]), "dlnors");
@@ -230,15 +212,12 @@ void BKE_displist_normals_add(ListBase *lb)
}
}
}
- dl = dl->next;
}
}
void BKE_displist_count(ListBase *lb, int *totvert, int *totface, int *tottri)
{
- DispList *dl;
-
- for (dl = lb->first; dl; dl = dl->next) {
+ LISTBASE_FOREACH (DispList *, dl, lb) {
int vert_tot = 0;
int face_tot = 0;
int tri_tot = 0;
@@ -318,7 +297,6 @@ static void curve_to_displist(Curve *cu,
ListBase *dispbase,
const bool for_render)
{
- Nurb *nu;
DispList *dl;
BezTriple *bezt, *prevbezt;
BPoint *bp;
@@ -326,154 +304,154 @@ static void curve_to_displist(Curve *cu,
int a, len, resolu;
const bool editmode = (!for_render && (cu->editnurb || cu->editfont));
- nu = nubase->first;
- while (nu) {
- if (nu->hide == 0 || editmode == false) {
- if (for_render && cu->resolu_ren != 0) {
- resolu = cu->resolu_ren;
- }
- else {
- resolu = nu->resolu;
- }
-
- if (!BKE_nurb_check_valid_u(nu)) {
- /* pass */
- }
- else if (nu->type == CU_BEZIER) {
- /* count */
- len = 0;
- a = nu->pntsu - 1;
- if (nu->flagu & CU_NURB_CYCLIC) {
- a++;
- }
-
- prevbezt = nu->bezt;
- bezt = prevbezt + 1;
- while (a--) {
- if (a == 0 && (nu->flagu & CU_NURB_CYCLIC)) {
- bezt = nu->bezt;
- }
+ LISTBASE_FOREACH (Nurb *, nu, nubase) {
+ if (nu->hide != 0 && editmode) {
+ continue;
+ }
- if (prevbezt->h2 == HD_VECT && bezt->h1 == HD_VECT) {
- len++;
- }
- else {
- len += resolu;
- }
+ if (for_render && cu->resolu_ren != 0) {
+ resolu = cu->resolu_ren;
+ }
+ else {
+ resolu = nu->resolu;
+ }
- if (a == 0 && (nu->flagu & CU_NURB_CYCLIC) == 0) {
- len++;
- }
+ if (!BKE_nurb_check_valid_u(nu)) {
+ /* pass */
+ }
+ else if (nu->type == CU_BEZIER) {
+ /* count */
+ len = 0;
+ a = nu->pntsu - 1;
+ if (nu->flagu & CU_NURB_CYCLIC) {
+ a++;
+ }
- prevbezt = bezt;
- bezt++;
+ prevbezt = nu->bezt;
+ bezt = prevbezt + 1;
+ while (a--) {
+ if (a == 0 && (nu->flagu & CU_NURB_CYCLIC)) {
+ bezt = nu->bezt;
}
- dl = MEM_callocN(sizeof(DispList), "makeDispListbez");
- /* len+1 because of 'forward_diff_bezier' function */
- dl->verts = MEM_mallocN((len + 1) * sizeof(float[3]), "dlverts");
- BLI_addtail(dispbase, dl);
- dl->parts = 1;
- dl->nr = len;
- dl->col = nu->mat_nr;
- dl->charidx = nu->charidx;
-
- data = dl->verts;
-
- /* check that (len != 2) so we don't immediately loop back on ourselves */
- if (nu->flagu & CU_NURB_CYCLIC && (dl->nr != 2)) {
- dl->type = DL_POLY;
- a = nu->pntsu;
+ if (prevbezt->h2 == HD_VECT && bezt->h1 == HD_VECT) {
+ len++;
}
else {
- dl->type = DL_SEGM;
- a = nu->pntsu - 1;
+ len += resolu;
}
- prevbezt = nu->bezt;
- bezt = prevbezt + 1;
+ if (a == 0 && (nu->flagu & CU_NURB_CYCLIC) == 0) {
+ len++;
+ }
- while (a--) {
- if (a == 0 && dl->type == DL_POLY) {
- bezt = nu->bezt;
- }
+ prevbezt = bezt;
+ bezt++;
+ }
- if (prevbezt->h2 == HD_VECT && bezt->h1 == HD_VECT) {
- copy_v3_v3(data, prevbezt->vec[1]);
- data += 3;
- }
- else {
- int j;
- for (j = 0; j < 3; j++) {
- BKE_curve_forward_diff_bezier(prevbezt->vec[1][j],
- prevbezt->vec[2][j],
- bezt->vec[0][j],
- bezt->vec[1][j],
- data + j,
- resolu,
- sizeof(float[3]));
- }
+ dl = MEM_callocN(sizeof(DispList), "makeDispListbez");
+ /* len+1 because of 'forward_diff_bezier' function */
+ dl->verts = MEM_mallocN((len + 1) * sizeof(float[3]), "dlverts");
+ BLI_addtail(dispbase, dl);
+ dl->parts = 1;
+ dl->nr = len;
+ dl->col = nu->mat_nr;
+ dl->charidx = nu->charidx;
+
+ data = dl->verts;
+
+ /* check that (len != 2) so we don't immediately loop back on ourselves */
+ if (nu->flagu & CU_NURB_CYCLIC && (dl->nr != 2)) {
+ dl->type = DL_POLY;
+ a = nu->pntsu;
+ }
+ else {
+ dl->type = DL_SEGM;
+ a = nu->pntsu - 1;
+ }
- data += 3 * resolu;
- }
+ prevbezt = nu->bezt;
+ bezt = prevbezt + 1;
+
+ while (a--) {
+ if (a == 0 && dl->type == DL_POLY) {
+ bezt = nu->bezt;
+ }
- if (a == 0 && dl->type == DL_SEGM) {
- copy_v3_v3(data, bezt->vec[1]);
+ if (prevbezt->h2 == HD_VECT && bezt->h1 == HD_VECT) {
+ copy_v3_v3(data, prevbezt->vec[1]);
+ data += 3;
+ }
+ else {
+ int j;
+ for (j = 0; j < 3; j++) {
+ BKE_curve_forward_diff_bezier(prevbezt->vec[1][j],
+ prevbezt->vec[2][j],
+ bezt->vec[0][j],
+ bezt->vec[1][j],
+ data + j,
+ resolu,
+ sizeof(float[3]));
}
- prevbezt = bezt;
- bezt++;
+ data += 3 * resolu;
}
+
+ if (a == 0 && dl->type == DL_SEGM) {
+ copy_v3_v3(data, bezt->vec[1]);
+ }
+
+ prevbezt = bezt;
+ bezt++;
}
- else if (nu->type == CU_NURBS) {
- len = (resolu * SEGMENTSU(nu));
+ }
+ else if (nu->type == CU_NURBS) {
+ len = (resolu * SEGMENTSU(nu));
- dl = MEM_callocN(sizeof(DispList), "makeDispListsurf");
- dl->verts = MEM_mallocN(len * sizeof(float[3]), "dlverts");
- BLI_addtail(dispbase, dl);
- dl->parts = 1;
+ dl = MEM_callocN(sizeof(DispList), "makeDispListsurf");
+ dl->verts = MEM_mallocN(len * sizeof(float[3]), "dlverts");
+ BLI_addtail(dispbase, dl);
+ dl->parts = 1;
- dl->nr = len;
- dl->col = nu->mat_nr;
- dl->charidx = nu->charidx;
+ dl->nr = len;
+ dl->col = nu->mat_nr;
+ dl->charidx = nu->charidx;
- data = dl->verts;
- if (nu->flagu & CU_NURB_CYCLIC) {
- dl->type = DL_POLY;
- }
- else {
- dl->type = DL_SEGM;
- }
- BKE_nurb_makeCurve(nu, data, NULL, NULL, NULL, resolu, sizeof(float[3]));
+ data = dl->verts;
+ if (nu->flagu & CU_NURB_CYCLIC) {
+ dl->type = DL_POLY;
+ }
+ else {
+ dl->type = DL_SEGM;
+ }
+ BKE_nurb_makeCurve(nu, data, NULL, NULL, NULL, resolu, sizeof(float[3]));
+ }
+ else if (nu->type == CU_POLY) {
+ len = nu->pntsu;
+ dl = MEM_callocN(sizeof(DispList), "makeDispListpoly");
+ dl->verts = MEM_mallocN(len * sizeof(float[3]), "dlverts");
+ BLI_addtail(dispbase, dl);
+ dl->parts = 1;
+ dl->nr = len;
+ dl->col = nu->mat_nr;
+ dl->charidx = nu->charidx;
+
+ data = dl->verts;
+ if ((nu->flagu & CU_NURB_CYCLIC) && (dl->nr != 2)) {
+ dl->type = DL_POLY;
+ }
+ else {
+ dl->type = DL_SEGM;
}
- else if (nu->type == CU_POLY) {
- len = nu->pntsu;
- dl = MEM_callocN(sizeof(DispList), "makeDispListpoly");
- dl->verts = MEM_mallocN(len * sizeof(float[3]), "dlverts");
- BLI_addtail(dispbase, dl);
- dl->parts = 1;
- dl->nr = len;
- dl->col = nu->mat_nr;
- dl->charidx = nu->charidx;
-
- data = dl->verts;
- if ((nu->flagu & CU_NURB_CYCLIC) && (dl->nr != 2)) {
- dl->type = DL_POLY;
- }
- else {
- dl->type = DL_SEGM;
- }
- a = len;
- bp = nu->bp;
- while (a--) {
- copy_v3_v3(data, bp->vec);
- bp++;
- data += 3;
- }
+ a = len;
+ bp = nu->bp;
+ while (a--) {
+ copy_v3_v3(data, bp->vec);
+ bp++;
+ data += 3;
}
}
- nu = nu->next;
}
}
@@ -491,7 +469,7 @@ void BKE_displist_fill(ListBase *dispbase,
ScanFillVert *sf_vert, *sf_vert_new, *sf_vert_last;
ScanFillFace *sf_tri;
MemArena *sf_arena;
- DispList *dlnew = NULL, *dl;
+ DispList *dlnew = NULL;
float *f1;
int colnr = 0, charidx = 0, cont = 1, tot, a, *index, nextcol = 0;
int totvert;
@@ -515,8 +493,7 @@ void BKE_displist_fill(ListBase *dispbase,
BLI_scanfill_begin_arena(&sf_ctx, sf_arena);
- dl = dispbase->first;
- while (dl) {
+ LISTBASE_FOREACH (DispList *, dl, dispbase) {
if (dl->type == DL_POLY) {
if (charidx < dl->charidx) {
cont = 1;
@@ -558,7 +535,6 @@ void BKE_displist_fill(ListBase *dispbase,
}
dl_flag_accum |= dl->flag;
}
- dl = dl->next;
}
/* XXX (obedit && obedit->actcol) ? (obedit->actcol - 1) : 0)) { */
@@ -627,19 +603,17 @@ static void bevels_to_filledpoly(Curve *cu, ListBase *dispbase)
{
const float z_up[3] = {0.0f, 0.0f, -1.0f};
ListBase front, back;
- DispList *dl, *dlnew;
float *fp, *fp1;
int a, dpoly;
BLI_listbase_clear(&front);
BLI_listbase_clear(&back);
- dl = dispbase->first;
- while (dl) {
+ LISTBASE_FOREACH (DispList *, dl, dispbase) {
if (dl->type == DL_SURF) {
if ((dl->flag & DL_CYCL_V) && (dl->flag & DL_CYCL_U) == 0) {
if ((cu->flag & CU_BACK) && (dl->flag & DL_BACK_CURVE)) {
- dlnew = MEM_callocN(sizeof(DispList), "filldisp");
+ DispList *dlnew = MEM_callocN(sizeof(DispList), "filldisp");
BLI_addtail(&front, dlnew);
dlnew->verts = fp1 = MEM_mallocN(sizeof(float[3]) * dl->parts, "filldisp1");
dlnew->nr = dl->parts;
@@ -660,7 +634,7 @@ static void bevels_to_filledpoly(Curve *cu, ListBase *dispbase)
}
}
if ((cu->flag & CU_FRONT) && (dl->flag & DL_FRONT_CURVE)) {
- dlnew = MEM_callocN(sizeof(DispList), "filldisp");
+ DispList *dlnew = MEM_callocN(sizeof(DispList), "filldisp");
BLI_addtail(&back, dlnew);
dlnew->verts = fp1 = MEM_mallocN(sizeof(float[3]) * dl->parts, "filldisp1");
dlnew->nr = dl->parts;
@@ -682,7 +656,6 @@ static void bevels_to_filledpoly(Curve *cu, ListBase *dispbase)
}
}
}
- dl = dl->next;
}
BKE_displist_fill(&front, dispbase, z_up, true);
@@ -939,18 +912,17 @@ static bool curve_calc_modifiers_pre(
static float (*displist_vert_coords_alloc(ListBase *dispbase, int *r_vert_len))[3]
{
- DispList *dl;
float(*allverts)[3], *fp;
*r_vert_len = 0;
- for (dl = dispbase->first; dl; dl = dl->next) {
+ LISTBASE_FOREACH (DispList *, dl, dispbase) {
*r_vert_len += (dl->type == DL_INDEX3) ? dl->nr : dl->parts * dl->nr;
}
allverts = MEM_mallocN(sizeof(float[3]) * (*r_vert_len), "displist_vert_coords_alloc allverts");
fp = (float *)allverts;
- for (dl = dispbase->first; dl; dl = dl->next) {
+ LISTBASE_FOREACH (DispList *, dl, dispbase) {
int offs = 3 * ((dl->type == DL_INDEX3) ? dl->nr : dl->parts * dl->nr);
memcpy(fp, dl->verts, sizeof(float) * offs);
fp += offs;
@@ -961,11 +933,10 @@ static float (*displist_vert_coords_alloc(ListBase *dispbase, int *r_vert_len))[
static void displist_vert_coords_apply(ListBase *dispbase, float (*allverts)[3])
{
- DispList *dl;
const float *fp;
fp = (float *)allverts;
- for (dl = dispbase->first; dl; dl = dl->next) {
+ LISTBASE_FOREACH (DispList *, dl, dispbase) {
int offs = 3 * ((dl->type == DL_INDEX3) ? dl->nr : dl->parts * dl->nr);
memcpy(dl->verts, fp, sizeof(float) * offs);
fp += offs;
@@ -1218,7 +1189,6 @@ void BKE_displist_make_surf(Depsgraph *depsgraph,
const bool for_orco)
{
ListBase nubase = {NULL, NULL};
- Nurb *nu;
Curve *cu = ob->data;
DispList *dl;
float *data;
@@ -1236,76 +1206,78 @@ void BKE_displist_make_surf(Depsgraph *depsgraph,
force_mesh_conversion = curve_calc_modifiers_pre(depsgraph, scene, ob, &nubase, for_render);
}
- for (nu = nubase.first; nu; nu = nu->next) {
- if ((for_render || nu->hide == 0) && BKE_nurb_check_valid_uv(nu)) {
- int resolu = nu->resolu, resolv = nu->resolv;
+ LISTBASE_FOREACH (Nurb *, nu, &nubase) {
+ if (!(for_render || nu->hide == 0) || !BKE_nurb_check_valid_uv(nu)) {
+ continue;
+ }
+
+ int resolu = nu->resolu, resolv = nu->resolv;
- if (for_render) {
- if (cu->resolu_ren) {
- resolu = cu->resolu_ren;
- }
- if (cu->resolv_ren) {
- resolv = cu->resolv_ren;
- }
+ if (for_render) {
+ if (cu->resolu_ren) {
+ resolu = cu->resolu_ren;
+ }
+ if (cu->resolv_ren) {
+ resolv = cu->resolv_ren;
}
+ }
- if (nu->pntsv == 1) {
- len = SEGMENTSU(nu) * resolu;
+ if (nu->pntsv == 1) {
+ len = SEGMENTSU(nu) * resolu;
- dl = MEM_callocN(sizeof(DispList), "makeDispListsurf");
- dl->verts = MEM_mallocN(len * sizeof(float[3]), "dlverts");
+ dl = MEM_callocN(sizeof(DispList), "makeDispListsurf");
+ dl->verts = MEM_mallocN(len * sizeof(float[3]), "dlverts");
- BLI_addtail(dispbase, dl);
- dl->parts = 1;
- dl->nr = len;
- dl->col = nu->mat_nr;
- dl->charidx = nu->charidx;
+ BLI_addtail(dispbase, dl);
+ dl->parts = 1;
+ dl->nr = len;
+ dl->col = nu->mat_nr;
+ dl->charidx = nu->charidx;
- /* dl->rt will be used as flag for render face and */
- /* CU_2D conflicts with R_NOPUNOFLIP */
- dl->rt = nu->flag & ~CU_2D;
+ /* dl->rt will be used as flag for render face and */
+ /* CU_2D conflicts with R_NOPUNOFLIP */
+ dl->rt = nu->flag & ~CU_2D;
- data = dl->verts;
- if (nu->flagu & CU_NURB_CYCLIC) {
- dl->type = DL_POLY;
- }
- else {
- dl->type = DL_SEGM;
- }
-
- BKE_nurb_makeCurve(nu, data, NULL, NULL, NULL, resolu, sizeof(float[3]));
+ data = dl->verts;
+ if (nu->flagu & CU_NURB_CYCLIC) {
+ dl->type = DL_POLY;
}
else {
- len = (nu->pntsu * resolu) * (nu->pntsv * resolv);
+ dl->type = DL_SEGM;
+ }
- dl = MEM_callocN(sizeof(DispList), "makeDispListsurf");
- dl->verts = MEM_mallocN(len * sizeof(float[3]), "dlverts");
- BLI_addtail(dispbase, dl);
+ BKE_nurb_makeCurve(nu, data, NULL, NULL, NULL, resolu, sizeof(float[3]));
+ }
+ else {
+ len = (nu->pntsu * resolu) * (nu->pntsv * resolv);
- dl->col = nu->mat_nr;
- dl->charidx = nu->charidx;
+ dl = MEM_callocN(sizeof(DispList), "makeDispListsurf");
+ dl->verts = MEM_mallocN(len * sizeof(float[3]), "dlverts");
+ BLI_addtail(dispbase, dl);
- /* dl->rt will be used as flag for render face and */
- /* CU_2D conflicts with R_NOPUNOFLIP */
- dl->rt = nu->flag & ~CU_2D;
+ dl->col = nu->mat_nr;
+ dl->charidx = nu->charidx;
- data = dl->verts;
- dl->type = DL_SURF;
+ /* dl->rt will be used as flag for render face and */
+ /* CU_2D conflicts with R_NOPUNOFLIP */
+ dl->rt = nu->flag & ~CU_2D;
- dl->parts = (nu->pntsu * resolu); /* in reverse, because makeNurbfaces works that way */
- dl->nr = (nu->pntsv * resolv);
- if (nu->flagv & CU_NURB_CYCLIC) {
- dl->flag |= DL_CYCL_U; /* reverse too! */
- }
- if (nu->flagu & CU_NURB_CYCLIC) {
- dl->flag |= DL_CYCL_V;
- }
+ data = dl->verts;
+ dl->type = DL_SURF;
- BKE_nurb_makeFaces(nu, data, 0, resolu, resolv);
-
- /* gl array drawing: using indices */
- displist_surf_indices(dl);
+ dl->parts = (nu->pntsu * resolu); /* in reverse, because makeNurbfaces works that way */
+ dl->nr = (nu->pntsv * resolv);
+ if (nu->flagv & CU_NURB_CYCLIC) {
+ dl->flag |= DL_CYCL_U; /* reverse too! */
+ }
+ if (nu->flagu & CU_NURB_CYCLIC) {
+ dl->flag |= DL_CYCL_V;
}
+
+ BKE_nurb_makeFaces(nu, data, 0, resolu, resolv);
+
+ /* gl array drawing: using indices */
+ displist_surf_indices(dl);
}
}
@@ -1851,12 +1823,11 @@ void BKE_displist_make_curveTypes_forRender(Depsgraph *depsgraph,
void BKE_displist_minmax(ListBase *dispbase, float min[3], float max[3])
{
- DispList *dl;
const float *vert;
int a, tot = 0;
int doit = 0;
- for (dl = dispbase->first; dl; dl = dl->next) {
+ LISTBASE_FOREACH (DispList *, dl, dispbase) {
tot = (dl->type == DL_INDEX3) ? dl->nr : dl->nr * dl->parts;
vert = dl->verts;
for (a = 0; a < tot; a++, vert += 3) {
diff --git a/source/blender/blenkernel/intern/fluid.c b/source/blender/blenkernel/intern/fluid.c
index 9ad352c8455..fa1b1997625 100644
--- a/source/blender/blenkernel/intern/fluid.c
+++ b/source/blender/blenkernel/intern/fluid.c
@@ -343,32 +343,37 @@ void BKE_fluid_cache_free(FluidDomainSettings *fds, Object *ob, int cache_map)
flags &= ~(FLUID_DOMAIN_BAKING_DATA | FLUID_DOMAIN_BAKED_DATA | FLUID_DOMAIN_OUTDATED_DATA);
BLI_path_join(temp_dir, sizeof(temp_dir), fds->cache_directory, FLUID_DOMAIN_DIR_CONFIG, NULL);
BLI_path_abs(temp_dir, relbase);
- BLI_delete(temp_dir, true, true); /* BLI_exists(filepath) is implicit */
-
+ if (BLI_exists(temp_dir)) {
+ BLI_delete(temp_dir, true, true);
+ }
BLI_path_join(temp_dir, sizeof(temp_dir), fds->cache_directory, FLUID_DOMAIN_DIR_DATA, NULL);
BLI_path_abs(temp_dir, relbase);
- BLI_delete(temp_dir, true, true); /* BLI_exists(filepath) is implicit */
-
+ if (BLI_exists(temp_dir)) {
+ BLI_delete(temp_dir, true, true);
+ }
BLI_path_join(temp_dir, sizeof(temp_dir), fds->cache_directory, FLUID_DOMAIN_DIR_SCRIPT, NULL);
BLI_path_abs(temp_dir, relbase);
- BLI_delete(temp_dir, true, true); /* BLI_exists(filepath) is implicit */
-
+ if (BLI_exists(temp_dir)) {
+ BLI_delete(temp_dir, true, true);
+ }
fds->cache_frame_pause_data = 0;
}
if (cache_map & FLUID_DOMAIN_OUTDATED_NOISE) {
flags &= ~(FLUID_DOMAIN_BAKING_NOISE | FLUID_DOMAIN_BAKED_NOISE | FLUID_DOMAIN_OUTDATED_NOISE);
BLI_path_join(temp_dir, sizeof(temp_dir), fds->cache_directory, FLUID_DOMAIN_DIR_NOISE, NULL);
BLI_path_abs(temp_dir, relbase);
- BLI_delete(temp_dir, true, true); /* BLI_exists(filepath) is implicit */
-
+ if (BLI_exists(temp_dir)) {
+ BLI_delete(temp_dir, true, true);
+ }
fds->cache_frame_pause_noise = 0;
}
if (cache_map & FLUID_DOMAIN_OUTDATED_MESH) {
flags &= ~(FLUID_DOMAIN_BAKING_MESH | FLUID_DOMAIN_BAKED_MESH | FLUID_DOMAIN_OUTDATED_MESH);
BLI_path_join(temp_dir, sizeof(temp_dir), fds->cache_directory, FLUID_DOMAIN_DIR_MESH, NULL);
BLI_path_abs(temp_dir, relbase);
- BLI_delete(temp_dir, true, true); /* BLI_exists(filepath) is implicit */
-
+ if (BLI_exists(temp_dir)) {
+ BLI_delete(temp_dir, true, true);
+ }
fds->cache_frame_pause_mesh = 0;
}
if (cache_map & FLUID_DOMAIN_OUTDATED_PARTICLES) {
@@ -377,17 +382,18 @@ void BKE_fluid_cache_free(FluidDomainSettings *fds, Object *ob, int cache_map)
BLI_path_join(
temp_dir, sizeof(temp_dir), fds->cache_directory, FLUID_DOMAIN_DIR_PARTICLES, NULL);
BLI_path_abs(temp_dir, relbase);
- BLI_delete(temp_dir, true, true); /* BLI_exists(filepath) is implicit */
-
+ if (BLI_exists(temp_dir)) {
+ BLI_delete(temp_dir, true, true);
+ }
fds->cache_frame_pause_particles = 0;
}
-
if (cache_map & FLUID_DOMAIN_OUTDATED_GUIDE) {
flags &= ~(FLUID_DOMAIN_BAKING_GUIDE | FLUID_DOMAIN_BAKED_GUIDE | FLUID_DOMAIN_OUTDATED_GUIDE);
BLI_path_join(temp_dir, sizeof(temp_dir), fds->cache_directory, FLUID_DOMAIN_DIR_GUIDE, NULL);
BLI_path_abs(temp_dir, relbase);
- BLI_delete(temp_dir, true, true); /* BLI_exists(filepath) is implicit */
-
+ if (BLI_exists(temp_dir)) {
+ BLI_delete(temp_dir, true, true);
+ }
fds->cache_frame_pause_guide = 0;
}
fds->cache_flag = flags;
diff --git a/source/blender/blenkernel/intern/lib_override.c b/source/blender/blenkernel/intern/lib_override.c
index e008058ae39..3bac0cf6289 100644
--- a/source/blender/blenkernel/intern/lib_override.c
+++ b/source/blender/blenkernel/intern/lib_override.c
@@ -1422,6 +1422,15 @@ void BKE_lib_override_library_main_operations_create(Main *bmain, const bool for
FOREACH_MAIN_ID_BEGIN (bmain, id) {
if (ID_IS_OVERRIDE_LIBRARY_REAL(id) &&
(force_auto || (id->tag & LIB_TAG_OVERRIDE_LIBRARY_AUTOREFRESH))) {
+ /* Usual issue with pose, it's quiet rare but sometimes they may not be up to date when this
+ * function is called. */
+ if (GS(id->name) == ID_OB) {
+ Object *ob = (Object *)id;
+ if (ob->type == OB_ARMATURE) {
+ BLI_assert(ob->data != NULL);
+ BKE_pose_ensure(bmain, ob, ob->data, true);
+ }
+ }
/* Only check overrides if we do have the real reference data available, and not some empty
* 'placeholder' for missing data (broken links). */
if ((id->override_library->reference->tag & LIB_TAG_MISSING) == 0) {
diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c
index 6ea83cf4330..97520654e7b 100644
--- a/source/blender/blenkernel/intern/mesh.c
+++ b/source/blender/blenkernel/intern/mesh.c
@@ -275,50 +275,6 @@ static void mesh_blend_read_data(BlendDataReader *reader, ID *id)
mesh->totselect = 0;
}
- /* Multires data */
- BLO_read_data_address(reader, &mesh->mr);
- if (mesh->mr) {
- BLO_read_list(reader, &mesh->mr->levels);
- MultiresLevel *lvl = mesh->mr->levels.first;
-
- CustomData_blend_read(reader, &mesh->mr->vdata, lvl->totvert);
- BKE_defvert_blend_read(
- reader, lvl->totvert, CustomData_get(&mesh->mr->vdata, 0, CD_MDEFORMVERT));
- CustomData_blend_read(reader, &mesh->mr->fdata, lvl->totface);
-
- BLO_read_data_address(reader, &mesh->mr->edge_flags);
- BLO_read_data_address(reader, &mesh->mr->edge_creases);
-
- BLO_read_data_address(reader, &mesh->mr->verts);
-
- /* If mesh has the same number of vertices as the
- * highest multires level, load the current mesh verts
- * into multires and discard the old data. Needed
- * because some saved files either do not have a verts
- * array, or the verts array contains out-of-date
- * data. */
- if (mesh->totvert == ((MultiresLevel *)mesh->mr->levels.last)->totvert) {
- if (mesh->mr->verts) {
- MEM_freeN(mesh->mr->verts);
- }
- mesh->mr->verts = MEM_dupallocN(mesh->mvert);
- }
-
- for (; lvl; lvl = lvl->next) {
- BLO_read_data_address(reader, &lvl->verts);
- BLO_read_data_address(reader, &lvl->faces);
- BLO_read_data_address(reader, &lvl->edges);
- BLO_read_data_address(reader, &lvl->colfaces);
- }
- }
-
- /* if multires is present but has no valid vertex data,
- * there's no way to recover it; silently remove multires */
- if (mesh->mr && !mesh->mr->verts) {
- multires_free(mesh->mr);
- mesh->mr = NULL;
- }
-
if ((BLO_read_requires_endian_switch(reader)) && mesh->tface) {
TFace *tf = mesh->tface;
for (int i = 0; i < mesh->totface; i++, tf++) {
diff --git a/source/blender/blenkernel/intern/multires.c b/source/blender/blenkernel/intern/multires.c
index 6e1168d8a16..d7ea662a5d6 100644
--- a/source/blender/blenkernel/intern/multires.c
+++ b/source/blender/blenkernel/intern/multires.c
@@ -63,7 +63,6 @@
#include <string.h>
/* MULTIRES MODIFIER */
-static const int multires_max_levels = 13;
static const int multires_grid_tot[] = {
0, 4, 9, 25, 81, 289, 1089, 4225, 16641, 66049, 263169, 1050625, 4198401, 16785409};
static const int multires_side_tot[] = {
@@ -76,7 +75,6 @@ typedef enum {
ADD_DISPLACEMENTS,
} DispOp;
-static void multires_mvert_to_ss(DerivedMesh *dm, MVert *mvert);
static void multiresModifier_disp_run(
DerivedMesh *dm, Mesh *me, DerivedMesh *dm2, DispOp op, CCGElem **oldGridData, int totlvl);
@@ -241,40 +239,6 @@ static void multires_mdisps_subdivide_hidden(MDisps *md, int new_level)
md->hidden = subd;
}
-static MDisps *multires_mdisps_init_hidden(Mesh *me, int level)
-{
- MDisps *mdisps = CustomData_add_layer(&me->ldata, CD_MDISPS, CD_CALLOC, NULL, me->totloop);
- int gridsize = BKE_ccg_gridsize(level);
- int gridarea = square_i(gridsize);
- int i, j;
-
- for (i = 0; i < me->totpoly; i++) {
- bool hide = false;
-
- for (j = 0; j < me->mpoly[i].totloop; j++) {
- if (me->mvert[me->mloop[me->mpoly[i].loopstart + j].v].flag & ME_HIDE) {
- hide = true;
- break;
- }
- }
-
- if (!hide) {
- continue;
- }
-
- for (j = 0; j < me->mpoly[i].totloop; j++) {
- MDisps *md = &mdisps[me->mpoly[i].loopstart + j];
-
- BLI_assert(!md->hidden);
-
- md->hidden = BLI_BITMAP_NEW(gridarea, "MDisps.hidden initialize");
- BLI_bitmap_set_all(md->hidden, true, gridarea);
- }
- }
-
- return mdisps;
-}
-
Mesh *BKE_multires_create_mesh(struct Depsgraph *depsgraph,
Object *object,
MultiresModifierData *mmd)
@@ -429,12 +393,6 @@ void multires_set_tot_level(Object *ob, MultiresModifierData *mmd, int lvl)
mmd->renderlvl = CLAMPIS(MAX2(mmd->renderlvl, lvl), 0, mmd->totlvl);
}
-static void multires_dm_mark_as_modified(DerivedMesh *dm, MultiresModifiedFlags flags)
-{
- CCGDerivedMesh *ccgdm = (CCGDerivedMesh *)dm;
- ccgdm->multires.modified_flags |= flags;
-}
-
static void multires_ccg_mark_as_modified(SubdivCCG *subdiv_ccg, MultiresModifiedFlags flags)
{
if (flags & MULTIRES_COORDS_MODIFIED) {
@@ -850,110 +808,6 @@ static DerivedMesh *subsurf_dm_create_local(Scene *scene,
return subsurf_make_derived_from_derived(dm, &smd, scene, NULL, flags);
}
-static void multires_subdivide_legacy(
- MultiresModifierData *mmd, Scene *scene, Object *ob, int totlvl, int updateblock, int simple)
-{
- Mesh *me = ob->data;
- MDisps *mdisps;
- const int lvl = mmd->totlvl;
-
- if ((totlvl > multires_max_levels) || (me->totpoly == 0)) {
- return;
- }
-
- BLI_assert(totlvl > lvl);
-
- multires_force_sculpt_rebuild(ob);
-
- mdisps = CustomData_get_layer(&me->ldata, CD_MDISPS);
- if (!mdisps) {
- mdisps = multires_mdisps_init_hidden(me, totlvl);
- }
-
- if (mdisps->disps && !updateblock && lvl != 0) {
- /* upsample */
- DerivedMesh *lowdm, *cddm, *highdm;
- CCGElem **highGridData, **lowGridData, **subGridData;
- CCGKey highGridKey, lowGridKey;
- CCGSubSurf *ss;
- int i, numGrids, highGridSize;
- const bool has_mask = CustomData_has_layer(&me->ldata, CD_GRID_PAINT_MASK);
-
- /* create subsurf DM from original mesh at high level */
- cddm = CDDM_from_mesh(me);
- DM_set_only_copy(cddm, &CD_MASK_BAREMESH);
- highdm = subsurf_dm_create_local(NULL,
- ob,
- cddm,
- totlvl,
- simple,
- 0,
- mmd->uv_smooth == SUBSURF_UV_SMOOTH_NONE,
- has_mask,
- false,
- SUBSURF_IGNORE_SIMPLIFY);
- ss = ((CCGDerivedMesh *)highdm)->ss;
-
- /* create multires DM from original mesh at low level */
- lowdm = multires_dm_create_local(
- scene, ob, cddm, lvl, lvl, simple, has_mask, MULTIRES_IGNORE_SIMPLIFY);
- BLI_assert(lowdm != cddm);
- cddm->release(cddm);
-
- /* copy subsurf grids and replace them with low displaced grids */
- numGrids = highdm->getNumGrids(highdm);
- highGridSize = highdm->getGridSize(highdm);
- highGridData = highdm->getGridData(highdm);
- highdm->getGridKey(highdm, &highGridKey);
- lowGridData = lowdm->getGridData(lowdm);
- lowdm->getGridKey(lowdm, &lowGridKey);
-
- subGridData = MEM_calloc_arrayN(numGrids, sizeof(float *), "subGridData*");
-
- for (i = 0; i < numGrids; i++) {
- /* backup subsurf grids */
- subGridData[i] = MEM_calloc_arrayN(
- highGridKey.elem_size, highGridSize * highGridSize, "subGridData");
- memcpy(subGridData[i], highGridData[i], highGridKey.elem_size * highGridSize * highGridSize);
-
- /* overwrite with current displaced grids */
- multires_copy_dm_grid(highGridData[i], lowGridData[i], &highGridKey, &lowGridKey);
- }
-
- /* low lower level dm no longer needed at this point */
- lowdm->release(lowdm);
-
- /* subsurf higher levels again with displaced data */
- ccgSubSurf_updateFromFaces(ss, lvl, NULL, 0);
- ccgSubSurf_updateLevels(ss, lvl, NULL, 0);
-
- /* reallocate displacements */
- multires_reallocate_mdisps(me->totloop, mdisps, totlvl);
-
- /* compute displacements */
- multiresModifier_disp_run(highdm, me, NULL, CALC_DISPLACEMENTS, subGridData, totlvl);
-
- /* free */
- highdm->release(highdm);
- for (i = 0; i < numGrids; i++) {
- MEM_freeN(subGridData[i]);
- }
- MEM_freeN(subGridData);
- }
- else {
- /* only reallocate, nothing to upsample */
- multires_reallocate_mdisps(me->totloop, mdisps, totlvl);
- }
-
- multires_set_tot_level(ob, mmd, totlvl);
-}
-
-void multiresModifier_subdivide_legacy(
- MultiresModifierData *mmd, Scene *scene, Object *ob, int updateblock, int simple)
-{
- multires_subdivide_legacy(mmd, scene, ob, mmd->totlvl + 1, updateblock, simple);
-}
-
static void grid_tangent(const CCGKey *key, int x, int y, int axis, CCGElem *grid, float t[3])
{
if (axis == 0) {
@@ -1449,9 +1303,6 @@ DerivedMesh *multires_make_derived_from_derived(
return result;
}
-/**** Old Multires code ****
- ***************************/
-
/* Adapted from sculptmode.c */
void old_mdisps_bilinear(float out[3], float (*disps)[3], const int st, float u, float v)
{
@@ -1506,723 +1357,6 @@ void old_mdisps_bilinear(float out[3], float (*disps)[3], const int st, float u,
add_v3_v3v3(out, d2[0], d2[1]);
}
-static void old_mdisps_rotate(
- int S, int UNUSED(newside), int oldside, int x, int y, float *u, float *v)
-{
- float offset = oldside * 0.5f - 0.5f;
-
- if (S == 1) {
- *u = offset + x;
- *v = offset - y;
- }
- if (S == 2) {
- *u = offset + y;
- *v = offset + x;
- }
- if (S == 3) {
- *u = offset - x;
- *v = offset + y;
- }
- if (S == 0) {
- *u = offset - y;
- *v = offset - x;
- }
-}
-
-static void old_mdisps_convert(MFace *mface, MDisps *mdisp)
-{
- int newlvl = log(sqrt(mdisp->totdisp) - 1) / M_LN2;
- int oldlvl = newlvl + 1;
- int oldside = multires_side_tot[oldlvl];
- int newside = multires_side_tot[newlvl];
- int nvert = (mface->v4) ? 4 : 3;
- int newtotdisp = multires_grid_tot[newlvl] * nvert;
- int x, y, S;
- float(*disps)[3], (*out)[3], u = 0.0f, v = 0.0f; /* Quite gcc barking. */
-
- disps = MEM_calloc_arrayN(newtotdisp, sizeof(float[3]), "multires disps");
-
- out = disps;
- for (S = 0; S < nvert; S++) {
- for (y = 0; y < newside; y++) {
- for (x = 0; x < newside; x++, out++) {
- old_mdisps_rotate(S, newside, oldside, x, y, &u, &v);
- old_mdisps_bilinear(*out, mdisp->disps, oldside, u, v);
-
- if (S == 1) {
- (*out)[1] = -(*out)[1];
- }
- else if (S == 2) {
- SWAP(float, (*out)[0], (*out)[1]);
- }
- else if (S == 3) {
- (*out)[0] = -(*out)[0];
- }
- else if (S == 0) {
- SWAP(float, (*out)[0], (*out)[1]);
- (*out)[0] = -(*out)[0];
- (*out)[1] = -(*out)[1];
- }
- }
- }
- }
-
- MEM_freeN(mdisp->disps);
-
- mdisp->totdisp = newtotdisp;
- mdisp->level = newlvl;
- mdisp->disps = disps;
-}
-
-void multires_load_old_250(Mesh *me)
-{
- MDisps *mdisps, *mdisps2;
- MFace *mf;
- int i, j, k;
-
- mdisps = CustomData_get_layer(&me->fdata, CD_MDISPS);
-
- if (mdisps) {
- for (i = 0; i < me->totface; i++) {
- if (mdisps[i].totdisp) {
- old_mdisps_convert(&me->mface[i], &mdisps[i]);
- }
- }
-
- CustomData_add_layer(&me->ldata, CD_MDISPS, CD_CALLOC, NULL, me->totloop);
- mdisps2 = CustomData_get_layer(&me->ldata, CD_MDISPS);
-
- k = 0;
- mf = me->mface;
- for (i = 0; i < me->totface; i++, mf++) {
- int nvert = mf->v4 ? 4 : 3;
- int totdisp = mdisps[i].totdisp / nvert;
-
- for (j = 0; j < nvert; j++, k++) {
- mdisps2[k].disps = MEM_calloc_arrayN(
- totdisp, sizeof(float[3]), "multires disp in conversion");
- mdisps2[k].totdisp = totdisp;
- mdisps2[k].level = mdisps[i].level;
- memcpy(mdisps2[k].disps, mdisps[i].disps + totdisp * j, totdisp);
- }
- }
- }
-}
-
-/* Does not actually free lvl itself */
-static void multires_free_level(MultiresLevel *lvl)
-{
- if (lvl) {
- if (lvl->faces) {
- MEM_freeN(lvl->faces);
- }
- if (lvl->edges) {
- MEM_freeN(lvl->edges);
- }
- if (lvl->colfaces) {
- MEM_freeN(lvl->colfaces);
- }
- }
-}
-
-void multires_free(Multires *mr)
-{
- if (mr) {
- MultiresLevel *lvl = mr->levels.first;
-
- /* Free the first-level data */
- if (lvl) {
- CustomData_free(&mr->vdata, lvl->totvert);
- CustomData_free(&mr->fdata, lvl->totface);
- if (mr->edge_flags) {
- MEM_freeN(mr->edge_flags);
- }
- if (mr->edge_creases) {
- MEM_freeN(mr->edge_creases);
- }
- }
-
- while (lvl) {
- multires_free_level(lvl);
- lvl = lvl->next;
- }
-
- /* mr->verts may be NULL when loading old files,
- * see direct_link_mesh() in readfile.c, and T43560. */
- MEM_SAFE_FREE(mr->verts);
-
- BLI_freelistN(&mr->levels);
-
- MEM_freeN(mr);
- }
-}
-
-typedef struct IndexNode {
- struct IndexNode *next, *prev;
- int index;
-} IndexNode;
-
-static void create_old_vert_face_map(ListBase **map,
- IndexNode **mem,
- const MultiresFace *mface,
- const int totvert,
- const int totface)
-{
- int i, j;
- IndexNode *node = NULL;
-
- (*map) = MEM_calloc_arrayN(totvert, sizeof(ListBase), "vert face map");
- (*mem) = MEM_calloc_arrayN(totface, sizeof(IndexNode[4]), "vert face map mem");
- node = *mem;
-
- /* Find the users */
- for (i = 0; i < totface; i++) {
- for (j = 0; j < (mface[i].v[3] ? 4 : 3); j++, node++) {
- node->index = i;
- BLI_addtail(&(*map)[mface[i].v[j]], node);
- }
- }
-}
-
-static void create_old_vert_edge_map(ListBase **map,
- IndexNode **mem,
- const MultiresEdge *medge,
- const int totvert,
- const int totedge)
-{
- int i, j;
- IndexNode *node = NULL;
-
- (*map) = MEM_calloc_arrayN(totvert, sizeof(ListBase), "vert edge map");
- (*mem) = MEM_calloc_arrayN(totedge, sizeof(IndexNode[2]), "vert edge map mem");
- node = *mem;
-
- /* Find the users */
- for (i = 0; i < totedge; i++) {
- for (j = 0; j < 2; j++, node++) {
- node->index = i;
- BLI_addtail(&(*map)[medge[i].v[j]], node);
- }
- }
-}
-
-static MultiresFace *find_old_face(
- ListBase *map, MultiresFace *faces, int v1, int v2, int v3, int v4)
-{
- IndexNode *n1;
- int v[4], i, j;
-
- v[0] = v1;
- v[1] = v2;
- v[2] = v3;
- v[3] = v4;
-
- for (n1 = map[v1].first; n1; n1 = n1->next) {
- int fnd[4] = {0, 0, 0, 0};
-
- for (i = 0; i < 4; i++) {
- for (j = 0; j < 4; j++) {
- if (v[i] == faces[n1->index].v[j]) {
- fnd[i] = 1;
- }
- }
- }
-
- if (fnd[0] && fnd[1] && fnd[2] && fnd[3]) {
- return &faces[n1->index];
- }
- }
-
- return NULL;
-}
-
-static MultiresEdge *find_old_edge(ListBase *map, MultiresEdge *edges, int v1, int v2)
-{
- IndexNode *n1, *n2;
-
- for (n1 = map[v1].first; n1; n1 = n1->next) {
- for (n2 = map[v2].first; n2; n2 = n2->next) {
- if (n1->index == n2->index) {
- return &edges[n1->index];
- }
- }
- }
-
- return NULL;
-}
-
-static void multires_load_old_edges(
- ListBase **emap, MultiresLevel *lvl, int *vvmap, int dst, int v1, int v2, int mov)
-{
- int emid = find_old_edge(emap[2], lvl->edges, v1, v2)->mid;
- vvmap[dst + mov] = emid;
-
- if (lvl->next->next) {
- multires_load_old_edges(emap + 1, lvl->next, vvmap, dst + mov, v1, emid, mov / 2);
- multires_load_old_edges(emap + 1, lvl->next, vvmap, dst + mov, v2, emid, -mov / 2);
- }
-}
-
-static void multires_load_old_faces(ListBase **fmap,
- ListBase **emap,
- MultiresLevel *lvl,
- int *vvmap,
- int dst,
- int v1,
- int v2,
- int v3,
- int v4,
- int st2,
- int st3)
-{
- int fmid;
- int emid13, emid14, emid23, emid24;
-
- if (lvl && lvl->next) {
- fmid = find_old_face(fmap[1], lvl->faces, v1, v2, v3, v4)->mid;
- vvmap[dst] = fmid;
-
- emid13 = find_old_edge(emap[1], lvl->edges, v1, v3)->mid;
- emid14 = find_old_edge(emap[1], lvl->edges, v1, v4)->mid;
- emid23 = find_old_edge(emap[1], lvl->edges, v2, v3)->mid;
- emid24 = find_old_edge(emap[1], lvl->edges, v2, v4)->mid;
-
- multires_load_old_faces(fmap + 1,
- emap + 1,
- lvl->next,
- vvmap,
- dst + st2 * st3 + st3,
- fmid,
- v2,
- emid23,
- emid24,
- st2,
- st3 / 2);
-
- multires_load_old_faces(fmap + 1,
- emap + 1,
- lvl->next,
- vvmap,
- dst - st2 * st3 + st3,
- emid14,
- emid24,
- fmid,
- v4,
- st2,
- st3 / 2);
-
- multires_load_old_faces(fmap + 1,
- emap + 1,
- lvl->next,
- vvmap,
- dst + st2 * st3 - st3,
- emid13,
- emid23,
- v3,
- fmid,
- st2,
- st3 / 2);
-
- multires_load_old_faces(fmap + 1,
- emap + 1,
- lvl->next,
- vvmap,
- dst - st2 * st3 - st3,
- v1,
- fmid,
- emid13,
- emid14,
- st2,
- st3 / 2);
-
- if (lvl->next->next) {
- multires_load_old_edges(emap, lvl->next, vvmap, dst, emid24, fmid, st3);
- multires_load_old_edges(emap, lvl->next, vvmap, dst, emid13, fmid, -st3);
- multires_load_old_edges(emap, lvl->next, vvmap, dst, emid14, fmid, -st2 * st3);
- multires_load_old_edges(emap, lvl->next, vvmap, dst, emid23, fmid, st2 * st3);
- }
- }
-}
-
-static void multires_mvert_to_ss(DerivedMesh *dm, MVert *mvert)
-{
- CCGDerivedMesh *ccgdm = (CCGDerivedMesh *)dm;
- CCGSubSurf *ss = ccgdm->ss;
- CCGElem *vd;
- CCGKey key;
- int index;
- int totvert, totedge, totface;
- int gridSize = ccgSubSurf_getGridSize(ss);
- int edgeSize = ccgSubSurf_getEdgeSize(ss);
- int i = 0;
-
- dm->getGridKey(dm, &key);
-
- totface = ccgSubSurf_getNumFaces(ss);
- for (index = 0; index < totface; index++) {
- CCGFace *f = ccgdm->faceMap[index].face;
- int x, y, S, numVerts = ccgSubSurf_getFaceNumVerts(f);
-
- vd = ccgSubSurf_getFaceCenterData(f);
- copy_v3_v3(CCG_elem_co(&key, vd), mvert[i].co);
- i++;
-
- for (S = 0; S < numVerts; S++) {
- for (x = 1; x < gridSize - 1; x++, i++) {
- vd = ccgSubSurf_getFaceGridEdgeData(ss, f, S, x);
- copy_v3_v3(CCG_elem_co(&key, vd), mvert[i].co);
- }
- }
-
- for (S = 0; S < numVerts; S++) {
- for (y = 1; y < gridSize - 1; y++) {
- for (x = 1; x < gridSize - 1; x++, i++) {
- vd = ccgSubSurf_getFaceGridData(ss, f, S, x, y);
- copy_v3_v3(CCG_elem_co(&key, vd), mvert[i].co);
- }
- }
- }
- }
-
- totedge = ccgSubSurf_getNumEdges(ss);
- for (index = 0; index < totedge; index++) {
- CCGEdge *e = ccgdm->edgeMap[index].edge;
- int x;
-
- for (x = 1; x < edgeSize - 1; x++, i++) {
- vd = ccgSubSurf_getEdgeData(ss, e, x);
- copy_v3_v3(CCG_elem_co(&key, vd), mvert[i].co);
- }
- }
-
- totvert = ccgSubSurf_getNumVerts(ss);
- for (index = 0; index < totvert; index++) {
- CCGVert *v = ccgdm->vertMap[index].vert;
-
- vd = ccgSubSurf_getVertData(ss, v);
- copy_v3_v3(CCG_elem_co(&key, vd), mvert[i].co);
- i++;
- }
-
- ccgSubSurf_updateToFaces(ss, 0, NULL, 0);
-}
-
-/* Loads a multires object stored in the old Multires struct into the new format */
-static void multires_load_old_dm(DerivedMesh *dm, Mesh *me, int totlvl)
-{
- MultiresLevel *lvl, *lvl1;
- Multires *mr = me->mr;
- MVert *vsrc, *vdst;
- unsigned int src, dst;
- int st_last = multires_side_tot[totlvl - 1] - 1;
- int extedgelen = multires_side_tot[totlvl] - 2;
- int *vvmap; // inorder for dst, map to src
- int crossedgelen;
- int s, x, tottri, totquad;
- unsigned int i, j, totvert;
-
- src = 0;
- vsrc = mr->verts;
- vdst = dm->getVertArray(dm);
- totvert = (unsigned int)dm->getNumVerts(dm);
- vvmap = MEM_calloc_arrayN(totvert, sizeof(int), "multires vvmap");
-
- if (!vvmap) {
- return;
- }
-
- lvl1 = mr->levels.first;
- /* Load base verts */
- for (i = 0; i < lvl1->totvert; i++) {
- vvmap[totvert - lvl1->totvert + i] = src;
- src++;
- }
-
- /* Original edges */
- dst = totvert - lvl1->totvert - extedgelen * lvl1->totedge;
- for (i = 0; i < lvl1->totedge; i++) {
- int ldst = dst + extedgelen * i;
- int lsrc = src;
- lvl = lvl1->next;
-
- for (j = 2; j <= mr->level_count; j++) {
- int base = multires_side_tot[totlvl - j + 1] - 2;
- int skip = multires_side_tot[totlvl - j + 2] - 1;
- int st = multires_side_tot[j - 1] - 1;
-
- for (x = 0; x < st; x++) {
- vvmap[ldst + base + x * skip] = lsrc + st * i + x;
- }
-
- lsrc += lvl->totvert - lvl->prev->totvert;
- lvl = lvl->next;
- }
- }
-
- /* Center points */
- dst = 0;
- for (i = 0; i < lvl1->totface; i++) {
- int sides = lvl1->faces[i].v[3] ? 4 : 3;
-
- vvmap[dst] = src + lvl1->totedge + i;
- dst += 1 + sides * (st_last - 1) * st_last;
- }
-
- /* The rest is only for level 3 and up */
- if (lvl1->next && lvl1->next->next) {
- ListBase **fmap, **emap;
- IndexNode **fmem, **emem;
-
- /* Face edge cross */
- tottri = totquad = 0;
- crossedgelen = multires_side_tot[totlvl - 1] - 2;
- dst = 0;
- for (i = 0; i < lvl1->totface; i++) {
- int sides = lvl1->faces[i].v[3] ? 4 : 3;
-
- lvl = lvl1->next->next;
- dst++;
-
- for (j = 3; j <= mr->level_count; j++) {
- int base = multires_side_tot[totlvl - j + 1] - 2;
- int skip = multires_side_tot[totlvl - j + 2] - 1;
- int st = pow(2, j - 2);
- int st2 = pow(2, j - 3);
- int lsrc = lvl->prev->totvert;
-
- /* Skip exterior edge verts */
- lsrc += lvl1->totedge * st;
-
- /* Skip earlier face edge crosses */
- lsrc += st2 * (tottri * 3 + totquad * 4);
-
- for (s = 0; s < sides; s++) {
- for (x = 0; x < st2; x++) {
- vvmap[dst + crossedgelen * (s + 1) - base - x * skip - 1] = lsrc;
- lsrc++;
- }
- }
-
- lvl = lvl->next;
- }
-
- dst += sides * (st_last - 1) * st_last;
-
- if (sides == 4) {
- totquad++;
- }
- else {
- tottri++;
- }
- }
-
- /* calculate vert to edge/face maps for each level (except the last) */
- fmap = MEM_calloc_arrayN((mr->level_count - 1), sizeof(ListBase *), "multires fmap");
- emap = MEM_calloc_arrayN((mr->level_count - 1), sizeof(ListBase *), "multires emap");
- fmem = MEM_calloc_arrayN((mr->level_count - 1), sizeof(IndexNode *), "multires fmem");
- emem = MEM_calloc_arrayN((mr->level_count - 1), sizeof(IndexNode *), "multires emem");
- lvl = lvl1;
- for (i = 0; i < (unsigned int)mr->level_count - 1; i++) {
- create_old_vert_face_map(fmap + i, fmem + i, lvl->faces, lvl->totvert, lvl->totface);
- create_old_vert_edge_map(emap + i, emem + i, lvl->edges, lvl->totvert, lvl->totedge);
- lvl = lvl->next;
- }
-
- /* Interior face verts */
- /* lvl = lvl1->next->next; */ /* UNUSED */
- dst = 0;
- for (j = 0; j < lvl1->totface; j++) {
- int sides = lvl1->faces[j].v[3] ? 4 : 3;
- int ldst = dst + 1 + sides * (st_last - 1);
-
- for (s = 0; s < sides; s++) {
- int st2 = multires_side_tot[totlvl - 1] - 2;
- int st3 = multires_side_tot[totlvl - 2] - 2;
- int st4 = st3 == 0 ? 1 : (st3 + 1) / 2;
- int mid = ldst + st2 * st3 + st3;
- int cv = lvl1->faces[j].v[s];
- int nv = lvl1->faces[j].v[s == sides - 1 ? 0 : s + 1];
- int pv = lvl1->faces[j].v[s == 0 ? sides - 1 : s - 1];
-
- multires_load_old_faces(fmap,
- emap,
- lvl1->next,
- vvmap,
- mid,
- vvmap[dst],
- cv,
- find_old_edge(emap[0], lvl1->edges, pv, cv)->mid,
- find_old_edge(emap[0], lvl1->edges, cv, nv)->mid,
- st2,
- st4);
-
- ldst += (st_last - 1) * (st_last - 1);
- }
-
- dst = ldst;
- }
-
- /*lvl = lvl->next;*/ /*UNUSED*/
-
- for (i = 0; i < (unsigned int)(mr->level_count - 1); i++) {
- MEM_freeN(fmap[i]);
- MEM_freeN(fmem[i]);
- MEM_freeN(emap[i]);
- MEM_freeN(emem[i]);
- }
-
- MEM_freeN(fmap);
- MEM_freeN(emap);
- MEM_freeN(fmem);
- MEM_freeN(emem);
- }
-
- /* Transfer verts */
- for (i = 0; i < totvert; i++) {
- copy_v3_v3(vdst[i].co, vsrc[vvmap[i]].co);
- }
-
- MEM_freeN(vvmap);
-
- multires_mvert_to_ss(dm, vdst);
-}
-
-/* Copy the first-level vcol data to the mesh, if it exists */
-/* Warning: higher-level vcol data will be lost */
-static void multires_load_old_vcols(Mesh *me)
-{
- MultiresLevel *lvl;
- MultiresColFace *colface;
- MCol *mcol;
- int i, j;
-
- if (!(lvl = me->mr->levels.first)) {
- return;
- }
-
- if (!(colface = lvl->colfaces)) {
- return;
- }
-
- /* older multires format never supported multiple vcol layers,
- * so we can assume the active vcol layer is the correct one */
- if (!(mcol = CustomData_get_layer(&me->fdata, CD_MCOL))) {
- return;
- }
-
- for (i = 0; i < me->totface; i++) {
- for (j = 0; j < 4; j++) {
- mcol[i * 4 + j].a = colface[i].col[j].a;
- mcol[i * 4 + j].r = colface[i].col[j].r;
- mcol[i * 4 + j].g = colface[i].col[j].g;
- mcol[i * 4 + j].b = colface[i].col[j].b;
- }
- }
-}
-
-/* Copy the first-level face-flag data to the mesh */
-static void multires_load_old_face_flags(Mesh *me)
-{
- MultiresLevel *lvl;
- MultiresFace *faces;
- int i;
-
- if (!(lvl = me->mr->levels.first)) {
- return;
- }
-
- if (!(faces = lvl->faces)) {
- return;
- }
-
- for (i = 0; i < me->totface; i++) {
- me->mface[i].flag = faces[i].flag;
- }
-}
-
-void multires_load_old(Object *ob, Mesh *me)
-{
- MultiresLevel *lvl;
- ModifierData *md;
- MultiresModifierData *mmd;
- DerivedMesh *dm, *orig;
- CustomDataLayer *l;
- int i;
-
- /* Load original level into the mesh */
- lvl = me->mr->levels.first;
- CustomData_free_layers(&me->vdata, CD_MVERT, lvl->totvert);
- CustomData_free_layers(&me->edata, CD_MEDGE, lvl->totedge);
- CustomData_free_layers(&me->fdata, CD_MFACE, lvl->totface);
- me->totvert = lvl->totvert;
- me->totedge = lvl->totedge;
- me->totface = lvl->totface;
- me->mvert = CustomData_add_layer(&me->vdata, CD_MVERT, CD_CALLOC, NULL, me->totvert);
- me->medge = CustomData_add_layer(&me->edata, CD_MEDGE, CD_CALLOC, NULL, me->totedge);
- me->mface = CustomData_add_layer(&me->fdata, CD_MFACE, CD_CALLOC, NULL, me->totface);
- memcpy(me->mvert, me->mr->verts, sizeof(MVert) * me->totvert);
- for (i = 0; i < me->totedge; i++) {
- me->medge[i].v1 = lvl->edges[i].v[0];
- me->medge[i].v2 = lvl->edges[i].v[1];
- }
- for (i = 0; i < me->totface; i++) {
- me->mface[i].v1 = lvl->faces[i].v[0];
- me->mface[i].v2 = lvl->faces[i].v[1];
- me->mface[i].v3 = lvl->faces[i].v[2];
- me->mface[i].v4 = lvl->faces[i].v[3];
- me->mface[i].mat_nr = lvl->faces[i].mat_nr;
- }
-
- /* Copy the first-level data to the mesh */
- /* XXX We must do this before converting tessfaces to polys/lopps! */
- for (i = 0, l = me->mr->vdata.layers; i < me->mr->vdata.totlayer; i++, l++) {
- CustomData_add_layer(&me->vdata, l->type, CD_REFERENCE, l->data, me->totvert);
- }
- for (i = 0, l = me->mr->fdata.layers; i < me->mr->fdata.totlayer; i++, l++) {
- CustomData_add_layer(&me->fdata, l->type, CD_REFERENCE, l->data, me->totface);
- }
- CustomData_reset(&me->mr->vdata);
- CustomData_reset(&me->mr->fdata);
-
- multires_load_old_vcols(me);
- multires_load_old_face_flags(me);
-
- /* multiresModifier_subdivide_legacy (actually, multires_subdivide_legacy) expects polys, not
- * tessfaces! */
- BKE_mesh_convert_mfaces_to_mpolys(me);
-
- /* Add a multires modifier to the object */
- md = ob->modifiers.first;
- while (md && BKE_modifier_get_info(md->type)->type == eModifierTypeType_OnlyDeform) {
- md = md->next;
- }
- mmd = (MultiresModifierData *)BKE_modifier_new(eModifierType_Multires);
- BLI_insertlinkbefore(&ob->modifiers, md, mmd);
-
- for (i = 0; i < me->mr->level_count - 1; i++) {
- multiresModifier_subdivide_legacy(mmd, NULL, ob, 1, 0);
- }
-
- mmd->lvl = mmd->totlvl;
- orig = CDDM_from_mesh(me);
- /* XXX We *must* alloc paint mask here, else we have some kind of mismatch in
- * multires_modifier_update_mdisps() (called by dm->release(dm)), which always creates the
- * reference subsurfed dm with this option, before calling multiresModifier_disp_run(),
- * which implicitly expects both subsurfs from its first dm and oldGridData parameters to
- * be of the same "format"! */
- dm = multires_make_derived_from_derived(orig, mmd, NULL, ob, 0);
-
- multires_load_old_dm(dm, me, mmd->totlvl + 1);
-
- multires_dm_mark_as_modified(dm, MULTIRES_COORDS_MODIFIED);
- dm->release(dm);
- orig->release(orig);
-
- /* Remove the old multires */
- multires_free(me->mr);
- me->mr = NULL;
-}
-
/* If 'ob_src' and 'ob_dst' both have multires modifiers, synchronize them
* such that 'ob_dst' has the same total number of levels as 'ob_src'. */
void multiresModifier_sync_levels_ex(Object *ob_dst,
diff --git a/source/blender/blenkernel/intern/multires_reshape.c b/source/blender/blenkernel/intern/multires_reshape.c
index 5bcf8f62f86..04ad78ec0de 100644
--- a/source/blender/blenkernel/intern/multires_reshape.c
+++ b/source/blender/blenkernel/intern/multires_reshape.c
@@ -225,7 +225,7 @@ void multiresModifier_subdivide_to_level(struct Object *object,
multires_flush_sculpt_updates(object);
- if (!multires_reshape_context_create_from_subdivide(&reshape_context, object, mmd, top_level)) {
+ if (!multires_reshape_context_create_from_modifier(&reshape_context, object, mmd, top_level)) {
return;
}
diff --git a/source/blender/blenkernel/intern/multires_reshape.h b/source/blender/blenkernel/intern/multires_reshape.h
index d6c1d79dfd7..9dec1423eba 100644
--- a/source/blender/blenkernel/intern/multires_reshape.h
+++ b/source/blender/blenkernel/intern/multires_reshape.h
@@ -167,10 +167,10 @@ bool multires_reshape_context_create_from_ccg(MultiresReshapeContext *reshape_co
struct Mesh *base_mesh,
int top_level);
-bool multires_reshape_context_create_from_subdivide(MultiresReshapeContext *reshape_context,
- struct Object *object,
- struct MultiresModifierData *mmd,
- int top_level);
+bool multires_reshape_context_create_from_modifier(MultiresReshapeContext *reshape_context,
+ struct Object *object,
+ struct MultiresModifierData *mmd,
+ int top_level);
void multires_reshape_free_original_grids(MultiresReshapeContext *reshape_context);
void multires_reshape_context_free(MultiresReshapeContext *reshape_context);
diff --git a/source/blender/blenkernel/intern/multires_reshape_subdivide.c b/source/blender/blenkernel/intern/multires_reshape_subdivide.c
index 7b7c1efc533..d42a061084f 100644
--- a/source/blender/blenkernel/intern/multires_reshape_subdivide.c
+++ b/source/blender/blenkernel/intern/multires_reshape_subdivide.c
@@ -96,7 +96,7 @@ void multires_subdivide_create_tangent_displacement_linear_grids(Object *object,
/* Convert the new grids to tangent displacement. */
multires_set_tot_level(object, mmd, new_top_level);
- if (!multires_reshape_context_create_from_subdivide(
+ if (!multires_reshape_context_create_from_modifier(
&reshape_context, object, mmd, new_top_level)) {
return;
}
diff --git a/source/blender/blenkernel/intern/multires_reshape_util.c b/source/blender/blenkernel/intern/multires_reshape_util.c
index c8179dd8a2d..f3b19961e29 100644
--- a/source/blender/blenkernel/intern/multires_reshape_util.c
+++ b/source/blender/blenkernel/intern/multires_reshape_util.c
@@ -242,10 +242,10 @@ bool multires_reshape_context_create_from_ccg(MultiresReshapeContext *reshape_co
return context_verify_or_free(reshape_context);
}
-bool multires_reshape_context_create_from_subdivide(MultiresReshapeContext *reshape_context,
- struct Object *object,
- struct MultiresModifierData *mmd,
- int top_level)
+bool multires_reshape_context_create_from_modifier(MultiresReshapeContext *reshape_context,
+ struct Object *object,
+ struct MultiresModifierData *mmd,
+ int top_level)
{
context_zero(reshape_context);
diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c
index 0c9ee61ca19..ae39b200b56 100644
--- a/source/blender/blenkernel/intern/shrinkwrap.c
+++ b/source/blender/blenkernel/intern/shrinkwrap.c
@@ -1548,8 +1548,8 @@ void BKE_shrinkwrap_remesh_target_project(Mesh *src_me, Mesh *target_me, Object
ssmd.shrinkMode = MOD_SHRINKWRAP_ON_SURFACE;
ssmd.shrinkOpts = MOD_SHRINKWRAP_PROJECT_ALLOW_NEG_DIR | MOD_SHRINKWRAP_PROJECT_ALLOW_POS_DIR;
ssmd.keepDist = 0.0f;
-
- /* Tolerance value to prevent artifacts on sharp edges of a mesh.
+
+ /* Tolerance value to prevent artifacts on sharp edges of a mesh.
* This constant and based on experimenting with different values. */
const float projLimitTolerance = 5.0f;
ssmd.projLimit = target_me->remesh_voxel_size * projLimitTolerance;
diff --git a/source/blender/blenlib/intern/delaunay_2d.cc b/source/blender/blenlib/intern/delaunay_2d.cc
index ac3662284d0..60439f27b01 100644
--- a/source/blender/blenlib/intern/delaunay_2d.cc
+++ b/source/blender/blenlib/intern/delaunay_2d.cc
@@ -1308,8 +1308,8 @@ template<typename T> inline int tri_orient(const SymEdge<T> *t)
* For case (a), 'vert' will be the vertex, and lambda will be 0, and 'in' will be the #SymEdge
* from 'vert' that has as face the one that you go through to get to this vertex. If you go
* exactly along an edge then we set 'in' to NULL, since it won't be needed. The first crossing
- * will have 'in' = NULL. We set 'out' to the #SymEdge that has the face we go through to get to the
- * next crossing, or, if the next crossing is a case (a), then it is the edge that goes to that
+ * will have 'in' = NULL. We set 'out' to the #SymEdge that has the face we go through to get to
+ * the next crossing, or, if the next crossing is a case (a), then it is the edge that goes to that
* next vertex. 'out' will be NULL for the last one.
*
* For case (b), vert will be NULL at first, and later filled in with the created split vertex,
diff --git a/source/blender/blenloader/intern/versioning_250.c b/source/blender/blenloader/intern/versioning_250.c
index 5046ee6aab1..f7592308023 100644
--- a/source/blender/blenloader/intern/versioning_250.c
+++ b/source/blender/blenloader/intern/versioning_250.c
@@ -799,20 +799,6 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
// BLI_freelistN(&pidlist);
- if (ob->type == OB_MESH) {
- Mesh *me = blo_do_versions_newlibadr(fd, lib, ob->data);
- void *olddata = ob->data;
- ob->data = me;
-
- /* XXX - library meshes crash on loading most yoFrankie levels,
- * the multires pointer gets invalid - Campbell */
- if (me && me->id.lib == NULL && me->mr && me->mr->level_count > 1) {
- multires_load_old(ob, me);
- }
-
- ob->data = olddata;
- }
-
if (ob->totcol && ob->matbits == NULL) {
int a;
@@ -1152,7 +1138,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
if (bmain->versionfile == 250 && bmain->subversionfile > 1) {
for (me = bmain->meshes.first; me; me = me->id.next) {
- multires_load_old_250(me);
+ CustomData_free_layer_active(&me->fdata, CD_MDISPS, me->totface);
}
for (ob = bmain->objects.first; ob; ob = ob->id.next) {
diff --git a/source/blender/blenloader/intern/versioning_legacy.c b/source/blender/blenloader/intern/versioning_legacy.c
index 4acf98cc58b..9d858da266d 100644
--- a/source/blender/blenloader/intern/versioning_legacy.c
+++ b/source/blender/blenloader/intern/versioning_legacy.c
@@ -1959,7 +1959,6 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
Light *la;
Material *ma;
ParticleSettings *part;
- Mesh *me;
bNodeTree *ntree;
Tex *tex;
ModifierData *md;
@@ -2074,23 +2073,6 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
}
}
- /* Copy over old per-level multires vertex data
- * into a single vertex array in struct Multires */
- for (me = bmain->meshes.first; me; me = me->id.next) {
- if (me->mr && !me->mr->verts) {
- MultiresLevel *lvl = me->mr->levels.last;
- if (lvl) {
- me->mr->verts = lvl->verts;
- lvl->verts = NULL;
- /* Don't need the other vert arrays */
- for (lvl = lvl->prev; lvl; lvl = lvl->prev) {
- MEM_freeN(lvl->verts);
- lvl->verts = NULL;
- }
- }
- }
- }
-
if (bmain->versionfile != 245 || bmain->subversionfile < 1) {
for (la = bmain->lights.first; la; la = la->id.next) {
la->falloff_type = LA_FALLOFF_INVLINEAR;
diff --git a/source/blender/compositor/CMakeLists.txt b/source/blender/compositor/CMakeLists.txt
index d524f4a0e1e..54dd121952b 100644
--- a/source/blender/compositor/CMakeLists.txt
+++ b/source/blender/compositor/CMakeLists.txt
@@ -353,6 +353,8 @@ set(SRC
operations/COM_KeyingDespillOperation.h
operations/COM_KeyingOperation.cpp
operations/COM_KeyingOperation.h
+ operations/COM_KeyingSetAlphaOperation.cpp
+ operations/COM_KeyingSetAlphaOperation.h
operations/COM_ColorSpillOperation.cpp
operations/COM_ColorSpillOperation.h
diff --git a/source/blender/compositor/nodes/COM_KeyingNode.cpp b/source/blender/compositor/nodes/COM_KeyingNode.cpp
index b75d06763b7..a0ccaf0b9da 100644
--- a/source/blender/compositor/nodes/COM_KeyingNode.cpp
+++ b/source/blender/compositor/nodes/COM_KeyingNode.cpp
@@ -32,7 +32,7 @@
#include "COM_DilateErodeOperation.h"
-#include "COM_SetAlphaOperation.h"
+#include "COM_KeyingSetAlphaOperation.h"
#include "COM_GaussianAlphaXBlurOperation.h"
#include "COM_GaussianAlphaYBlurOperation.h"
@@ -322,7 +322,7 @@ void KeyingNode::convertToOperations(NodeConverter &converter,
}
/* set alpha channel to output image */
- SetAlphaOperation *alphaOperation = new SetAlphaOperation();
+ KeyingSetAlphaOperation *alphaOperation = new KeyingSetAlphaOperation();
converter.addOperation(alphaOperation);
converter.mapInputSocket(inputImage, alphaOperation->getInputSocket(0));
diff --git a/source/blender/compositor/operations/COM_KeyingSetAlphaOperation.cpp b/source/blender/compositor/operations/COM_KeyingSetAlphaOperation.cpp
new file mode 100644
index 00000000000..dff88d49e80
--- /dev/null
+++ b/source/blender/compositor/operations/COM_KeyingSetAlphaOperation.cpp
@@ -0,0 +1,55 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Copyright 2020, Blender Foundation.
+ */
+
+#include "COM_KeyingSetAlphaOperation.h"
+
+KeyingSetAlphaOperation::KeyingSetAlphaOperation() : NodeOperation()
+{
+ this->addInputSocket(COM_DT_COLOR);
+ this->addInputSocket(COM_DT_VALUE);
+ this->addOutputSocket(COM_DT_COLOR);
+
+ this->m_inputColor = NULL;
+ this->m_inputAlpha = NULL;
+}
+
+void KeyingSetAlphaOperation::initExecution()
+{
+ this->m_inputColor = getInputSocketReader(0);
+ this->m_inputAlpha = getInputSocketReader(1);
+}
+
+void KeyingSetAlphaOperation::executePixelSampled(float output[4],
+ float x,
+ float y,
+ PixelSampler sampler)
+{
+ float color_input[4];
+ float alpha_input[4];
+
+ this->m_inputColor->readSampled(color_input, x, y, sampler);
+ this->m_inputAlpha->readSampled(alpha_input, x, y, sampler);
+
+ mul_v4_v4fl(output, color_input, alpha_input[0]);
+}
+
+void KeyingSetAlphaOperation::deinitExecution()
+{
+ this->m_inputColor = NULL;
+ this->m_inputAlpha = NULL;
+}
diff --git a/source/blender/compositor/operations/COM_KeyingSetAlphaOperation.h b/source/blender/compositor/operations/COM_KeyingSetAlphaOperation.h
new file mode 100644
index 00000000000..b786240f215
--- /dev/null
+++ b/source/blender/compositor/operations/COM_KeyingSetAlphaOperation.h
@@ -0,0 +1,39 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Copyright 2020, Blender Foundation.
+ */
+
+#pragma once
+
+#include "COM_NodeOperation.h"
+
+/**
+ * Operation which is used by keying node to modify image's alpha channels.
+ * It keeps color properly pre-multiplied.
+ */
+class KeyingSetAlphaOperation : public NodeOperation {
+ private:
+ SocketReader *m_inputColor;
+ SocketReader *m_inputAlpha;
+
+ public:
+ KeyingSetAlphaOperation();
+
+ void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
+
+ void initExecution();
+ void deinitExecution();
+};
diff --git a/source/blender/editors/armature/armature_naming.c b/source/blender/editors/armature/armature_naming.c
index 60a1434ed42..8bcaf72f678 100644
--- a/source/blender/editors/armature/armature_naming.c
+++ b/source/blender/editors/armature/armature_naming.c
@@ -606,7 +606,7 @@ void ARMATURE_OT_autoside_names(wmOperatorType *ot)
};
/* identifiers */
- ot->name = "AutoName by Axis";
+ ot->name = "Auto-Name by Axis";
ot->idname = "ARMATURE_OT_autoside_names";
ot->description =
"Automatically renames the selected bones according to which side of the target axis they "
diff --git a/source/blender/editors/armature/armature_select.c b/source/blender/editors/armature/armature_select.c
index 27718b61d70..66c12a0d0d7 100644
--- a/source/blender/editors/armature/armature_select.c
+++ b/source/blender/editors/armature/armature_select.c
@@ -1550,10 +1550,10 @@ enum {
static const EnumPropertyItem prop_similar_types[] = {
{SIMEDBONE_CHILDREN, "CHILDREN", 0, "Children", ""},
- {SIMEDBONE_CHILDREN_IMMEDIATE, "CHILDREN_IMMEDIATE", 0, "Immediate children", ""},
+ {SIMEDBONE_CHILDREN_IMMEDIATE, "CHILDREN_IMMEDIATE", 0, "Immediate Children", ""},
{SIMEDBONE_SIBLINGS, "SIBLINGS", 0, "Siblings", ""},
{SIMEDBONE_LENGTH, "LENGTH", 0, "Length", ""},
- {SIMEDBONE_DIRECTION, "DIRECTION", 0, "Direction (Y axis)", ""},
+ {SIMEDBONE_DIRECTION, "DIRECTION", 0, "Direction (Y Axis)", ""},
{SIMEDBONE_PREFIX, "PREFIX", 0, "Prefix", ""},
{SIMEDBONE_SUFFIX, "SUFFIX", 0, "Suffix", ""},
{SIMEDBONE_LAYER, "LAYER", 0, "Layer", ""},
diff --git a/source/blender/editors/armature/pose_edit.c b/source/blender/editors/armature/pose_edit.c
index e8c35958115..857176937dc 100644
--- a/source/blender/editors/armature/pose_edit.c
+++ b/source/blender/editors/armature/pose_edit.c
@@ -638,7 +638,7 @@ void POSE_OT_autoside_names(wmOperatorType *ot)
};
/* identifiers */
- ot->name = "AutoName by Axis";
+ ot->name = "Auto-Name by Axis";
ot->idname = "POSE_OT_autoside_names";
ot->description =
"Automatically renames the selected bones according to which side of the target axis they "
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c
index 85d86849140..15f3939b2f6 100644
--- a/source/blender/editors/curve/editcurve.c
+++ b/source/blender/editors/curve/editcurve.c
@@ -307,12 +307,8 @@ static void keyIndex_delNurb(EditNurb *editnurb, Nurb *nu)
static void keyIndex_delNurbList(EditNurb *editnurb, ListBase *nubase)
{
- Nurb *nu = nubase->first;
-
- while (nu) {
+ LISTBASE_FOREACH (Nurb *, nu, nubase) {
keyIndex_delNurb(editnurb, nu);
-
- nu = nu->next;
}
}
@@ -476,19 +472,15 @@ static void keyIndex_switchDirection(EditNurb *editnurb, Nurb *nu)
static void switch_keys_direction(Curve *cu, Nurb *actnu)
{
- KeyBlock *currkey;
EditNurb *editnurb = cu->editnurb;
ListBase *nubase = &editnurb->nurbs;
- Nurb *nu;
float *fp;
int a;
- currkey = cu->key->block.first;
- while (currkey) {
+ LISTBASE_FOREACH (KeyBlock *, currkey, &cu->key->block) {
fp = currkey->data;
- nu = nubase->first;
- while (nu) {
+ LISTBASE_FOREACH (Nurb *, nu, nubase) {
if (nu->bezt) {
BezTriple *bezt = nu->bezt;
a = nu->pntsu;
@@ -522,11 +514,7 @@ static void switch_keys_direction(Curve *cu, Nurb *actnu)
fp += a * KEYELEM_FLOAT_LEN_BPOINT;
}
}
-
- nu = nu->next;
}
-
- currkey = currkey->next;
}
}
@@ -583,13 +571,11 @@ static void bezt_to_key(BezTriple *bezt, float *key)
static void calc_keyHandles(ListBase *nurb, float *key)
{
- Nurb *nu;
int a;
float *fp = key;
BezTriple *bezt;
- nu = nurb->first;
- while (nu) {
+ LISTBASE_FOREACH (Nurb *, nu, nurb) {
if (nu->bezt) {
BezTriple *prevp, *nextp;
BezTriple cur, prev, next;
@@ -649,8 +635,6 @@ static void calc_keyHandles(ListBase *nurb, float *key)
a = nu->pntsu * nu->pntsv;
fp += a * KEYELEM_FLOAT_LEN_BPOINT;
}
-
- nu = nu->next;
}
}
@@ -658,255 +642,247 @@ static void calc_shapeKeys(Object *obedit, ListBase *newnurbs)
{
Curve *cu = (Curve *)obedit->data;
- /* are there keys? */
- if (cu->key) {
- int a, i;
- EditNurb *editnurb = cu->editnurb;
- KeyBlock *currkey;
- KeyBlock *actkey = BLI_findlink(&cu->key->block, editnurb->shapenr - 1);
- BezTriple *bezt, *oldbezt;
- BPoint *bp, *oldbp;
- Nurb *nu, *newnu;
- int totvert = BKE_keyblock_curve_element_count(&editnurb->nurbs);
-
- float(*ofs)[3] = NULL;
- float *oldkey, *newkey, *ofp;
-
- /* editing the base key should update others */
- if (cu->key->type == KEY_RELATIVE) {
- if (BKE_keyblock_is_basis(cu->key, editnurb->shapenr - 1)) { /* active key is a base */
- int totvec = 0;
-
- /* Calculate needed memory to store offset */
- nu = editnurb->nurbs.first;
- while (nu) {
- if (nu->bezt) {
- /* Three vects to store handles and one for tilt. */
- totvec += nu->pntsu * 4;
- }
- else {
- totvec += 2 * nu->pntsu * nu->pntsv;
- }
+ if (cu->key == NULL) {
+ return;
+ }
- nu = nu->next;
+ int a, i;
+ EditNurb *editnurb = cu->editnurb;
+ KeyBlock *actkey = BLI_findlink(&cu->key->block, editnurb->shapenr - 1);
+ BezTriple *bezt, *oldbezt;
+ BPoint *bp, *oldbp;
+ Nurb *newnu;
+ int totvert = BKE_keyblock_curve_element_count(&editnurb->nurbs);
+
+ float(*ofs)[3] = NULL;
+ float *oldkey, *newkey, *ofp;
+
+ /* editing the base key should update others */
+ if (cu->key->type == KEY_RELATIVE) {
+ if (BKE_keyblock_is_basis(cu->key, editnurb->shapenr - 1)) { /* active key is a base */
+ int totvec = 0;
+
+ /* Calculate needed memory to store offset */
+ LISTBASE_FOREACH (Nurb *, nu, &editnurb->nurbs) {
+
+ if (nu->bezt) {
+ /* Three vects to store handles and one for tilt. */
+ totvec += nu->pntsu * 4;
}
+ else {
+ totvec += 2 * nu->pntsu * nu->pntsv;
+ }
+ }
- ofs = MEM_callocN(sizeof(float[3]) * totvec, "currkey->data");
- nu = editnurb->nurbs.first;
- i = 0;
- while (nu) {
- if (nu->bezt) {
- bezt = nu->bezt;
- a = nu->pntsu;
- while (a--) {
- oldbezt = getKeyIndexOrig_bezt(editnurb, bezt);
+ ofs = MEM_callocN(sizeof(float[3]) * totvec, "currkey->data");
+ i = 0;
+ LISTBASE_FOREACH (Nurb *, nu, &editnurb->nurbs) {
+ if (nu->bezt) {
+ bezt = nu->bezt;
+ a = nu->pntsu;
+ while (a--) {
+ oldbezt = getKeyIndexOrig_bezt(editnurb, bezt);
- if (oldbezt) {
- int j;
- for (j = 0; j < 3; j++) {
- sub_v3_v3v3(ofs[i], bezt->vec[j], oldbezt->vec[j]);
- i++;
- }
- ofs[i][0] = bezt->tilt - oldbezt->tilt;
- ofs[i][1] = bezt->radius - oldbezt->radius;
+ if (oldbezt) {
+ int j;
+ for (j = 0; j < 3; j++) {
+ sub_v3_v3v3(ofs[i], bezt->vec[j], oldbezt->vec[j]);
i++;
}
- else {
- i += 4;
- }
- bezt++;
+ ofs[i][0] = bezt->tilt - oldbezt->tilt;
+ ofs[i][1] = bezt->radius - oldbezt->radius;
+ i++;
}
+ else {
+ i += 4;
+ }
+ bezt++;
}
- else {
- bp = nu->bp;
- a = nu->pntsu * nu->pntsv;
- while (a--) {
- oldbp = getKeyIndexOrig_bp(editnurb, bp);
- if (oldbp) {
- sub_v3_v3v3(ofs[i], bp->vec, oldbp->vec);
- ofs[i + 1][0] = bp->tilt - oldbp->tilt;
- ofs[i + 1][1] = bp->radius - oldbp->radius;
- }
- i += 2;
- bp++;
+ }
+ else {
+ bp = nu->bp;
+ a = nu->pntsu * nu->pntsv;
+ while (a--) {
+ oldbp = getKeyIndexOrig_bp(editnurb, bp);
+ if (oldbp) {
+ sub_v3_v3v3(ofs[i], bp->vec, oldbp->vec);
+ ofs[i + 1][0] = bp->tilt - oldbp->tilt;
+ ofs[i + 1][1] = bp->radius - oldbp->radius;
}
+ i += 2;
+ bp++;
}
-
- nu = nu->next;
}
}
}
+ }
- currkey = cu->key->block.first;
- while (currkey) {
- const bool apply_offset = (ofs && (currkey != actkey) &&
- (editnurb->shapenr - 1 == currkey->relative));
-
- float *fp = newkey = MEM_callocN(cu->key->elemsize * totvert, "currkey->data");
- ofp = oldkey = currkey->data;
+ LISTBASE_FOREACH (KeyBlock *, currkey, &cu->key->block) {
+ const bool apply_offset = (ofs && (currkey != actkey) &&
+ (editnurb->shapenr - 1 == currkey->relative));
- nu = editnurb->nurbs.first;
- /* We need to restore to original curve into newnurb, *not* editcurve's nurbs.
- * Otherwise, in case we update obdata *without* leaving editmode (e.g. viewport render),
- * we would invalidate editcurve. */
- newnu = newnurbs->first;
- i = 0;
- while (nu) {
- if (currkey == actkey) {
- const bool restore = actkey != cu->key->refkey;
+ float *fp = newkey = MEM_callocN(cu->key->elemsize * totvert, "currkey->data");
+ ofp = oldkey = currkey->data;
- if (nu->bezt) {
- bezt = nu->bezt;
- a = nu->pntsu;
- BezTriple *newbezt = newnu->bezt;
- while (a--) {
- int j;
- oldbezt = getKeyIndexOrig_bezt(editnurb, bezt);
+ Nurb *nu = editnurb->nurbs.first;
+ /* We need to restore to original curve into newnurb, *not* editcurve's nurbs.
+ * Otherwise, in case we update obdata *without* leaving editmode (e.g. viewport render),
+ * we would invalidate editcurve. */
+ newnu = newnurbs->first;
+ i = 0;
+ while (nu) {
+ if (currkey == actkey) {
+ const bool restore = actkey != cu->key->refkey;
- for (j = 0; j < 3; j++, i++) {
- copy_v3_v3(&fp[j * 3], bezt->vec[j]);
+ if (nu->bezt) {
+ bezt = nu->bezt;
+ a = nu->pntsu;
+ BezTriple *newbezt = newnu->bezt;
+ while (a--) {
+ int j;
+ oldbezt = getKeyIndexOrig_bezt(editnurb, bezt);
- if (restore && oldbezt) {
- copy_v3_v3(newbezt->vec[j], oldbezt->vec[j]);
- }
- }
- fp[9] = bezt->tilt;
- fp[10] = bezt->radius;
+ for (j = 0; j < 3; j++, i++) {
+ copy_v3_v3(&fp[j * 3], bezt->vec[j]);
if (restore && oldbezt) {
- newbezt->tilt = oldbezt->tilt;
- newbezt->radius = oldbezt->radius;
+ copy_v3_v3(newbezt->vec[j], oldbezt->vec[j]);
}
+ }
+ fp[9] = bezt->tilt;
+ fp[10] = bezt->radius;
- fp += KEYELEM_FLOAT_LEN_BEZTRIPLE;
- i++;
- bezt++;
- newbezt++;
+ if (restore && oldbezt) {
+ newbezt->tilt = oldbezt->tilt;
+ newbezt->radius = oldbezt->radius;
}
- }
- else {
- bp = nu->bp;
- a = nu->pntsu * nu->pntsv;
- BPoint *newbp = newnu->bp;
- while (a--) {
- oldbp = getKeyIndexOrig_bp(editnurb, bp);
- copy_v3_v3(fp, bp->vec);
+ fp += KEYELEM_FLOAT_LEN_BEZTRIPLE;
+ i++;
+ bezt++;
+ newbezt++;
+ }
+ }
+ else {
+ bp = nu->bp;
+ a = nu->pntsu * nu->pntsv;
+ BPoint *newbp = newnu->bp;
+ while (a--) {
+ oldbp = getKeyIndexOrig_bp(editnurb, bp);
- fp[3] = bp->tilt;
- fp[4] = bp->radius;
+ copy_v3_v3(fp, bp->vec);
- if (restore && oldbp) {
- copy_v3_v3(newbp->vec, oldbp->vec);
- newbp->tilt = oldbp->tilt;
- newbp->radius = oldbp->radius;
- }
+ fp[3] = bp->tilt;
+ fp[4] = bp->radius;
- fp += KEYELEM_FLOAT_LEN_BPOINT;
- bp++;
- newbp++;
- i += 2;
+ if (restore && oldbp) {
+ copy_v3_v3(newbp->vec, oldbp->vec);
+ newbp->tilt = oldbp->tilt;
+ newbp->radius = oldbp->radius;
}
+
+ fp += KEYELEM_FLOAT_LEN_BPOINT;
+ bp++;
+ newbp++;
+ i += 2;
}
}
- else {
- int index;
- const float *curofp;
-
- if (oldkey) {
- if (nu->bezt) {
- bezt = nu->bezt;
- a = nu->pntsu;
+ }
+ else {
+ int index;
+ const float *curofp;
- while (a--) {
- index = getKeyIndexOrig_keyIndex(editnurb, bezt);
- if (index >= 0) {
- int j;
- curofp = ofp + index;
+ if (oldkey) {
+ if (nu->bezt) {
+ bezt = nu->bezt;
+ a = nu->pntsu;
- for (j = 0; j < 3; j++, i++) {
- copy_v3_v3(&fp[j * 3], &curofp[j * 3]);
+ while (a--) {
+ index = getKeyIndexOrig_keyIndex(editnurb, bezt);
+ if (index >= 0) {
+ int j;
+ curofp = ofp + index;
- if (apply_offset) {
- add_v3_v3(&fp[j * 3], ofs[i]);
- }
- }
- fp[9] = curofp[9];
- fp[10] = curofp[10];
+ for (j = 0; j < 3; j++, i++) {
+ copy_v3_v3(&fp[j * 3], &curofp[j * 3]);
if (apply_offset) {
- /* Apply tilt offsets. */
- add_v3_v3(fp + 9, ofs[i]);
- i++;
+ add_v3_v3(&fp[j * 3], ofs[i]);
}
+ }
+ fp[9] = curofp[9];
+ fp[10] = curofp[10];
- fp += KEYELEM_FLOAT_LEN_BEZTRIPLE;
+ if (apply_offset) {
+ /* Apply tilt offsets. */
+ add_v3_v3(fp + 9, ofs[i]);
+ i++;
}
- else {
- int j;
- for (j = 0; j < 3; j++, i++) {
- copy_v3_v3(&fp[j * 3], bezt->vec[j]);
- }
- fp[9] = bezt->tilt;
- fp[10] = bezt->radius;
- fp += KEYELEM_FLOAT_LEN_BEZTRIPLE;
+ fp += KEYELEM_FLOAT_LEN_BEZTRIPLE;
+ }
+ else {
+ int j;
+ for (j = 0; j < 3; j++, i++) {
+ copy_v3_v3(&fp[j * 3], bezt->vec[j]);
}
- bezt++;
+ fp[9] = bezt->tilt;
+ fp[10] = bezt->radius;
+
+ fp += KEYELEM_FLOAT_LEN_BEZTRIPLE;
}
+ bezt++;
}
- else {
- bp = nu->bp;
- a = nu->pntsu * nu->pntsv;
- while (a--) {
- index = getKeyIndexOrig_keyIndex(editnurb, bp);
+ }
+ else {
+ bp = nu->bp;
+ a = nu->pntsu * nu->pntsv;
+ while (a--) {
+ index = getKeyIndexOrig_keyIndex(editnurb, bp);
- if (index >= 0) {
- curofp = ofp + index;
- copy_v3_v3(fp, curofp);
- fp[3] = curofp[3];
- fp[4] = curofp[4];
+ if (index >= 0) {
+ curofp = ofp + index;
+ copy_v3_v3(fp, curofp);
+ fp[3] = curofp[3];
+ fp[4] = curofp[4];
- if (apply_offset) {
- add_v3_v3(fp, ofs[i]);
- add_v3_v3(&fp[3], ofs[i + 1]);
- }
- }
- else {
- copy_v3_v3(fp, bp->vec);
- fp[3] = bp->tilt;
- fp[4] = bp->radius;
+ if (apply_offset) {
+ add_v3_v3(fp, ofs[i]);
+ add_v3_v3(&fp[3], ofs[i + 1]);
}
-
- fp += KEYELEM_FLOAT_LEN_BPOINT;
- bp++;
- i += 2;
}
+ else {
+ copy_v3_v3(fp, bp->vec);
+ fp[3] = bp->tilt;
+ fp[4] = bp->radius;
+ }
+
+ fp += KEYELEM_FLOAT_LEN_BPOINT;
+ bp++;
+ i += 2;
}
}
}
-
- nu = nu->next;
- newnu = newnu->next;
- }
-
- if (apply_offset) {
- /* handles could become malicious after offsets applying */
- calc_keyHandles(&editnurb->nurbs, newkey);
}
- currkey->totelem = totvert;
- if (currkey->data) {
- MEM_freeN(currkey->data);
- }
- currkey->data = newkey;
+ nu = nu->next;
+ newnu = newnu->next;
+ }
- currkey = currkey->next;
+ if (apply_offset) {
+ /* handles could become malicious after offsets applying */
+ calc_keyHandles(&editnurb->nurbs, newkey);
}
- if (ofs) {
- MEM_freeN(ofs);
+ currkey->totelem = totvert;
+ if (currkey->data) {
+ MEM_freeN(currkey->data);
}
+ currkey->data = newkey;
+ }
+
+ if (ofs) {
+ MEM_freeN(ofs);
}
}
@@ -929,11 +905,10 @@ static void fcurve_path_rename(AnimData *adt,
ListBase *orig_curves,
ListBase *curves)
{
- FCurve *fcu, *nfcu, *nextfcu;
+ FCurve *nfcu;
int len = strlen(orig_rna_path);
- for (fcu = orig_curves->first; fcu; fcu = nextfcu) {
- nextfcu = fcu->next;
+ LISTBASE_FOREACH_MUTABLE (FCurve *, fcu, orig_curves) {
if (STREQLEN(fcu->rna_path, orig_rna_path, len)) {
char *spath, *suffix = fcu->rna_path + len;
nfcu = BKE_fcurve_copy(fcu);
@@ -977,16 +952,15 @@ static void fcurve_remove(AnimData *adt, ListBase *orig_curves, FCurve *fcu)
static void curve_rename_fcurves(Curve *cu, ListBase *orig_curves)
{
- int nu_index = 0, a, pt_index;
+ int a, pt_index;
EditNurb *editnurb = cu->editnurb;
- Nurb *nu;
CVKeyIndex *keyIndex;
char rna_path[64], orig_rna_path[64];
AnimData *adt = BKE_animdata_from_id(&cu->id);
ListBase curves = {NULL, NULL};
- FCurve *fcu, *next;
- for (nu = editnurb->nurbs.first, nu_index = 0; nu != NULL; nu = nu->next, nu_index++) {
+ int nu_index = 0;
+ LISTBASE_FOREACH_INDEX (Nurb *, nu, &editnurb->nurbs, nu_index) {
if (nu->bezt) {
BezTriple *bezt = nu->bezt;
a = nu->pntsu;
@@ -1054,9 +1028,7 @@ static void curve_rename_fcurves(Curve *cu, ListBase *orig_curves)
/* remove paths for removed control points
* need this to make further step with copying non-cv related curves copying
* not touching cv's f-curves */
- for (fcu = orig_curves->first; fcu; fcu = next) {
- next = fcu->next;
-
+ LISTBASE_FOREACH_MUTABLE (FCurve *, fcu, orig_curves) {
if (STREQLEN(fcu->rna_path, "splines", 7)) {
const char *ch = strchr(fcu->rna_path, '.');
@@ -1066,7 +1038,8 @@ static void curve_rename_fcurves(Curve *cu, ListBase *orig_curves)
}
}
- for (nu = editnurb->nurbs.first, nu_index = 0; nu != NULL; nu = nu->next, nu_index++) {
+ nu_index = 0;
+ LISTBASE_FOREACH_INDEX (Nurb *, nu, &editnurb->nurbs, nu_index) {
keyIndex = NULL;
if (nu->pntsu) {
if (nu->bezt) {
@@ -1086,9 +1059,7 @@ static void curve_rename_fcurves(Curve *cu, ListBase *orig_curves)
/* the remainders in orig_curves can be copied back (like follow path) */
/* (if it's not path to spline) */
- for (fcu = orig_curves->first; fcu; fcu = next) {
- next = fcu->next;
-
+ LISTBASE_FOREACH_MUTABLE (FCurve *, fcu, orig_curves) {
if (STREQLEN(fcu->rna_path, "splines", 7)) {
fcurve_remove(adt, orig_curves, fcu);
}
@@ -1141,13 +1112,11 @@ static int *init_index_map(Object *obedit, int *r_old_totvert)
{
Curve *curve = (Curve *)obedit->data;
EditNurb *editnurb = curve->editnurb;
- Nurb *nu;
CVKeyIndex *keyIndex;
int *old_to_new_map;
- int old_totvert;
- int vertex_index;
- for (nu = curve->nurb.first, old_totvert = 0; nu != NULL; nu = nu->next) {
+ int old_totvert = 0;
+ LISTBASE_FOREACH (Nurb *, nu, &curve->nurb) {
if (nu->bezt) {
old_totvert += nu->pntsu * 3;
}
@@ -1161,7 +1130,8 @@ static int *init_index_map(Object *obedit, int *r_old_totvert)
old_to_new_map[i] = -1;
}
- for (nu = editnurb->nurbs.first, vertex_index = 0; nu != NULL; nu = nu->next) {
+ int vertex_index = 0;
+ LISTBASE_FOREACH (Nurb *, nu, &curve->nurb) {
if (nu->bezt) {
BezTriple *bezt = nu->bezt;
int a = nu->pntsu;
@@ -1205,7 +1175,6 @@ static int *init_index_map(Object *obedit, int *r_old_totvert)
static void remap_hooks_and_vertex_parents(Main *bmain, Object *obedit)
{
- Object *object;
Curve *curve = (Curve *)obedit->data;
EditNurb *editnurb = curve->editnurb;
int *old_to_new_map = NULL;
@@ -1219,8 +1188,7 @@ static void remap_hooks_and_vertex_parents(Main *bmain, Object *obedit)
return;
}
- for (object = bmain->objects.first; object; object = object->id.next) {
- ModifierData *md;
+ LISTBASE_FOREACH (Object *, object, &bmain->objects) {
int index;
if ((object->parent) && (object->parent->data == curve) &&
ELEM(object->partype, PARVERT1, PARVERT3)) {
@@ -1248,7 +1216,7 @@ static void remap_hooks_and_vertex_parents(Main *bmain, Object *obedit)
}
}
if (object->data == curve) {
- for (md = object->modifiers.first; md; md = md->next) {
+ LISTBASE_FOREACH (ModifierData *, md, &object->modifiers) {
if (md->type == eModifierType_Hook) {
HookModifierData *hmd = (HookModifierData *)md;
int i, j;
@@ -1290,13 +1258,12 @@ void ED_curve_editnurb_load(Main *bmain, Object *obedit)
if (ELEM(obedit->type, OB_CURVE, OB_SURF)) {
Curve *cu = obedit->data;
- Nurb *nu, *newnu;
ListBase newnurb = {NULL, NULL}, oldnurb = cu->nurb;
remap_hooks_and_vertex_parents(bmain, obedit);
- for (nu = editnurb->first; nu; nu = nu->next) {
- newnu = BKE_nurb_duplicate(nu);
+ LISTBASE_FOREACH (Nurb *, nu, editnurb) {
+ Nurb *newnu = BKE_nurb_duplicate(nu);
BLI_addtail(&newnurb, newnu);
if (nu->type == CU_NURBS) {
@@ -1323,7 +1290,6 @@ void ED_curve_editnurb_make(Object *obedit)
{
Curve *cu = (Curve *)obedit->data;
EditNurb *editnurb = cu->editnurb;
- Nurb *nu, *newnu;
KeyBlock *actkey;
if (ELEM(obedit->type, OB_CURVE, OB_SURF)) {
@@ -1346,12 +1312,10 @@ void ED_curve_editnurb_make(Object *obedit)
cu->editnurb = editnurb;
}
- nu = cu->nurb.first;
- while (nu) {
- newnu = BKE_nurb_duplicate(nu);
+ LISTBASE_FOREACH (Nurb *, nu, &cu->nurb) {
+ Nurb *newnu = BKE_nurb_duplicate(nu);
BKE_nurb_test_2d(newnu); /* after join, or any other creation of curve */
BLI_addtail(&editnurb->nurbs, newnu);
- nu = nu->next;
}
/* animation could be added in editmode even if there was no animdata in
@@ -1722,11 +1686,10 @@ static void rotateflagNurb(ListBase *editnurb,
const float rotmat[3][3])
{
/* all verts with (flag & 'flag') rotate */
- Nurb *nu;
BPoint *bp;
int a;
- for (nu = editnurb->first; nu; nu = nu->next) {
+ LISTBASE_FOREACH (Nurb *, nu, editnurb) {
if (nu->type == CU_NURBS) {
bp = nu->bp;
a = nu->pntsu * nu->pntsv;
@@ -1746,12 +1709,11 @@ static void rotateflagNurb(ListBase *editnurb,
void ed_editnurb_translate_flag(ListBase *editnurb, uint8_t flag, const float vec[3])
{
/* all verts with ('flag' & flag) translate */
- Nurb *nu;
BezTriple *bezt;
BPoint *bp;
int a;
- for (nu = editnurb->first; nu; nu = nu->next) {
+ LISTBASE_FOREACH (Nurb *, nu, editnurb) {
if (nu->type == CU_BEZIER) {
a = nu->pntsu;
bezt = nu->bezt;
@@ -1785,11 +1747,10 @@ void ed_editnurb_translate_flag(ListBase *editnurb, uint8_t flag, const float ve
static void weightflagNurb(ListBase *editnurb, short flag, float w)
{
- Nurb *nu;
BPoint *bp;
int a;
- for (nu = editnurb->first; nu; nu = nu->next) {
+ LISTBASE_FOREACH (Nurb *, nu, editnurb) {
if (nu->type == CU_NURBS) {
a = nu->pntsu * nu->pntsv;
bp = nu->bp;
@@ -1808,16 +1769,12 @@ static void ed_surf_delete_selected(Object *obedit)
{
Curve *cu = obedit->data;
ListBase *editnurb = object_editcurve_get(obedit);
- Nurb *nu, *next;
BPoint *bp, *bpn, *newbp;
int a, b, newu, newv;
BLI_assert(obedit->type == OB_SURF);
- nu = editnurb->first;
- while (nu) {
- next = nu->next;
-
+ LISTBASE_FOREACH_MUTABLE (Nurb *, nu, editnurb) {
/* is entire nurb selected */
bp = nu->bp;
a = nu->pntsu * nu->pntsv;
@@ -1903,7 +1860,6 @@ static void ed_surf_delete_selected(Object *obedit)
}
}
}
- nu = next;
}
}
@@ -1912,15 +1868,12 @@ static void ed_curve_delete_selected(Object *obedit, View3D *v3d)
Curve *cu = obedit->data;
EditNurb *editnurb = cu->editnurb;
ListBase *nubase = &editnurb->nurbs;
- Nurb *nu, *next;
BezTriple *bezt, *bezt1;
BPoint *bp, *bp1;
int a, type, nuindex = 0;
/* first loop, can we remove entire pieces? */
- nu = nubase->first;
- while (nu) {
- next = nu->next;
+ LISTBASE_FOREACH_MUTABLE (Nurb *, nu, nubase) {
if (nu->type == CU_BEZIER) {
bezt = nu->bezt;
a = nu->pntsu;
@@ -1981,13 +1934,10 @@ static void ed_curve_delete_selected(Object *obedit, View3D *v3d)
clamp_nurb_order_u(nu);
}
#endif
- nu = next;
nuindex++;
}
/* 2nd loop, delete small pieces: just for curves */
- nu = nubase->first;
- while (nu) {
- next = nu->next;
+ LISTBASE_FOREACH_MUTABLE (Nurb *, nu, nubase) {
type = 0;
if (nu->type == CU_BEZIER) {
bezt = nu->bezt;
@@ -2047,21 +1997,17 @@ static void ed_curve_delete_selected(Object *obedit, View3D *v3d)
BKE_nurb_order_clamp_u(nu);
BKE_nurb_knot_calc_u(nu);
}
- nu = next;
}
}
/* only for OB_SURF */
bool ed_editnurb_extrude_flag(EditNurb *editnurb, const uint8_t flag)
{
- Nurb *nu;
BPoint *bp, *bpn, *newbp;
int a, u, v, len;
bool ok = false;
- nu = editnurb->nurbs.first;
- while (nu) {
-
+ LISTBASE_FOREACH (Nurb *, nu, &editnurb->nurbs) {
if (nu->pntsv == 1) {
bp = nu->bp;
a = nu->pntsu;
@@ -2166,7 +2112,6 @@ bool ed_editnurb_extrude_flag(EditNurb *editnurb, const uint8_t flag)
}
}
}
- nu = nu->next;
}
return ok;
@@ -2197,14 +2142,15 @@ static void adduplicateflagNurb(
Object *obedit, View3D *v3d, ListBase *newnurb, const uint8_t flag, const bool split)
{
ListBase *editnurb = object_editcurve_get(obedit);
- Nurb *nu, *newnu;
+ Nurb *newnu;
BezTriple *bezt, *bezt1;
BPoint *bp, *bp1, *bp2, *bp3;
Curve *cu = (Curve *)obedit->data;
- int a, b, c, starta, enda, diffa, cyclicu, cyclicv, newu, newv, i;
+ int a, b, c, starta, enda, diffa, cyclicu, cyclicv, newu, newv;
char *usel;
- for (i = 0, nu = editnurb->first; nu; i++, nu = nu->next) {
+ int i = 0;
+ LISTBASE_FOREACH_INDEX (Nurb *, nu, editnurb, i) {
cyclicu = cyclicv = 0;
if (nu->type == CU_BEZIER) {
for (a = 0, bezt = nu->bezt; a < nu->pntsu; a++, bezt++) {
@@ -2569,7 +2515,7 @@ static void adduplicateflagNurb(
}
if (BLI_listbase_is_empty(newnurb) == false) {
- for (nu = newnurb->first; nu; nu = nu->next) {
+ LISTBASE_FOREACH (Nurb *, nu, newnurb) {
if (nu->type == CU_BEZIER) {
if (split) {
/* recalc first and last */
@@ -2619,10 +2565,9 @@ static int switch_direction_exec(bContext *C, wmOperator *UNUSED(op))
}
EditNurb *editnurb = cu->editnurb;
- Nurb *nu;
- int i;
- for (nu = editnurb->nurbs.first, i = 0; nu; nu = nu->next, i++) {
+ int i = 0;
+ LISTBASE_FOREACH_INDEX (Nurb *, nu, &editnurb->nurbs, i) {
if (ED_curve_nurb_select_check(v3d, nu)) {
BKE_nurb_direction_switch(nu);
keyData_switchDirectionNurb(cu, nu);
@@ -2674,13 +2619,12 @@ static int set_goal_weight_exec(bContext *C, wmOperator *op)
for (uint ob_index = 0; ob_index < objects_len; ob_index++) {
Object *obedit = objects[ob_index];
ListBase *editnurb = object_editcurve_get(obedit);
- Nurb *nu;
BezTriple *bezt;
BPoint *bp;
float weight = RNA_float_get(op->ptr, "weight");
int a;
- for (nu = editnurb->first; nu; nu = nu->next) {
+ LISTBASE_FOREACH (Nurb *, nu, editnurb) {
if (nu->bezt) {
for (bezt = nu->bezt, a = 0; a < nu->pntsu; a++, bezt++) {
if (bezt->f2 & SELECT) {
@@ -2741,13 +2685,12 @@ static int set_radius_exec(bContext *C, wmOperator *op)
for (uint ob_index = 0; ob_index < objects_len; ob_index++) {
Object *obedit = objects[ob_index];
ListBase *editnurb = object_editcurve_get(obedit);
- Nurb *nu;
BezTriple *bezt;
BPoint *bp;
float radius = RNA_float_get(op->ptr, "radius");
int a;
- for (nu = editnurb->first; nu; nu = nu->next) {
+ LISTBASE_FOREACH (Nurb *, nu, editnurb) {
if (nu->bezt) {
for (bezt = nu->bezt, a = 0; a < nu->pntsu; a++, bezt++) {
if (bezt->f2 & SELECT) {
@@ -2853,12 +2796,11 @@ static int smooth_exec(bContext *C, wmOperator *UNUSED(op))
for (uint ob_index = 0; ob_index < objects_len; ob_index++) {
Object *obedit = objects[ob_index];
ListBase *editnurb = object_editcurve_get(obedit);
- Nurb *nu;
int a, a_end;
bool changed = false;
- for (nu = editnurb->first; nu; nu = nu->next) {
+ LISTBASE_FOREACH (Nurb *, nu, editnurb) {
if (nu->bezt) {
/* duplicate the curve to use in weight calculation */
const BezTriple *bezt_orig = MEM_dupallocN(nu->bezt);
@@ -2960,7 +2902,6 @@ void CURVE_OT_smooth(wmOperatorType *ot)
static void curve_smooth_value(ListBase *editnurb, const int bezt_offsetof, const int bp_offset)
{
- Nurb *nu;
BezTriple *bezt;
BPoint *bp;
int a;
@@ -2970,7 +2911,7 @@ static void curve_smooth_value(ListBase *editnurb, const int bezt_offsetof, cons
int start_sel, end_sel; /* selection indices, inclusive */
float start_rad, end_rad, fac, range;
- for (nu = editnurb->first; nu; nu = nu->next) {
+ LISTBASE_FOREACH (Nurb *, nu, editnurb) {
if (nu->bezt) {
#define BEZT_VALUE(bezt) (*((float *)((char *)(bezt) + bezt_offsetof)))
@@ -3289,12 +3230,11 @@ static int hide_exec(bContext *C, wmOperator *op)
}
ListBase *editnurb = object_editcurve_get(obedit);
- Nurb *nu;
BPoint *bp;
BezTriple *bezt;
int a, sel;
- for (nu = editnurb->first; nu; nu = nu->next) {
+ LISTBASE_FOREACH (Nurb *, nu, editnurb) {
if (nu->type == CU_BEZIER) {
bezt = nu->bezt;
a = nu->pntsu;
@@ -3385,13 +3325,12 @@ static int reveal_exec(bContext *C, wmOperator *op)
for (uint ob_index = 0; ob_index < objects_len; ob_index++) {
Object *obedit = objects[ob_index];
ListBase *editnurb = object_editcurve_get(obedit);
- Nurb *nu;
BPoint *bp;
BezTriple *bezt;
int a;
bool changed = false;
- for (nu = editnurb->first; nu; nu = nu->next) {
+ LISTBASE_FOREACH (Nurb *, nu, editnurb) {
nu->hide = 0;
if (nu->type == CU_BEZIER) {
bezt = nu->bezt;
@@ -3462,7 +3401,6 @@ static void subdividenurb(Object *obedit, View3D *v3d, int number_cuts)
{
Curve *cu = obedit->data;
EditNurb *editnurb = cu->editnurb;
- Nurb *nu;
BezTriple *bezt, *beztnew, *beztn;
BPoint *bp, *prevbp, *bpnew, *bpn;
float vec[15];
@@ -3471,7 +3409,7 @@ static void subdividenurb(Object *obedit, View3D *v3d, int number_cuts)
// printf("*** subdivideNurb: entering subdivide\n");
- for (nu = editnurb->nurbs.first; nu; nu = nu->next) {
+ LISTBASE_FOREACH (Nurb *, nu, &editnurb->nurbs) {
amount = 0;
if (nu->type == CU_BEZIER) {
BezTriple *nextbezt;
@@ -3925,7 +3863,6 @@ static int set_spline_type_exec(bContext *C, wmOperator *op)
Main *bmain = CTX_data_main(C);
View3D *v3d = CTX_wm_view3d(C);
ListBase *editnurb = object_editcurve_get(obedit);
- Nurb *nu;
bool changed = false;
bool changed_size = false;
const bool use_handles = RNA_boolean_get(op->ptr, "use_handles");
@@ -3936,7 +3873,7 @@ static int set_spline_type_exec(bContext *C, wmOperator *op)
continue;
}
- for (nu = editnurb->first; nu; nu = nu->next) {
+ LISTBASE_FOREACH (Nurb *, nu, editnurb) {
if (ED_curve_nurb_select_check(v3d, nu)) {
const int pntsu_prev = nu->pntsu;
const char *err_msg = NULL;
@@ -4225,12 +4162,11 @@ static void make_selection_list_nurb(View3D *v3d, ListBase *editnurb, ListBase *
{
ListBase nbase = {NULL, NULL};
NurbSort *nus, *nustest, *headdo, *taildo;
- Nurb *nu;
BPoint *bp;
float dist, headdist, taildist;
int a;
- for (nu = editnurb->first; nu; nu = nu->next) {
+ LISTBASE_FOREACH (Nurb *, nu, editnurb) {
if (ED_curve_nurb_select_check(v3d, nu)) {
nus = (NurbSort *)MEM_callocN(sizeof(NurbSort), "sort");
@@ -4996,7 +4932,6 @@ bool ed_editnurb_spin(
{
Curve *cu = (Curve *)obedit->data;
ListBase *editnurb = object_editcurve_get(obedit);
- Nurb *nu;
float cmat[3][3], tmat[3][3], imat[3][3];
float bmat[3][3], rotmat[3][3], scalemat1[3][3], scalemat2[3][3];
float persmat[3][3], persinv[3][3];
@@ -5056,7 +4991,7 @@ bool ed_editnurb_spin(
}
if (ok) {
- for (nu = editnurb->first; nu; nu = nu->next) {
+ LISTBASE_FOREACH (Nurb *, nu, editnurb) {
if (ED_curve_nurb_select_check(v3d, nu)) {
nu->orderv = 4;
nu->flagv |= CU_NURB_CYCLIC;
@@ -5427,8 +5362,6 @@ static int ed_editcurve_addvert(Curve *cu,
View3D *v3d,
const float location_init[3])
{
- Nurb *nu;
-
float center[3];
float temp[3];
uint verts_len;
@@ -5437,7 +5370,7 @@ static int ed_editcurve_addvert(Curve *cu,
zero_v3(center);
verts_len = 0;
- for (nu = editnurb->nurbs.first; nu; nu = nu->next) {
+ LISTBASE_FOREACH (Nurb *, nu, &editnurb->nurbs) {
int i;
if (nu->type == CU_BEZIER) {
BezTriple *bezt;
@@ -5472,7 +5405,7 @@ static int ed_editcurve_addvert(Curve *cu,
ofs[2] = 0.0f;
}
- for (nu = editnurb->nurbs.first; nu; nu = nu->next) {
+ LISTBASE_FOREACH (Nurb *, nu, &editnurb->nurbs) {
if (nu->type == CU_BEZIER) {
BezTriple *bezt;
for (i = 0, bezt = nu->bezt; i < nu->pntsu; i++, bezt++) {
@@ -5511,7 +5444,7 @@ static int ed_editcurve_addvert(Curve *cu,
}
/* nothing selected: create a new curve */
- nu = BKE_curve_nurb_active_get(cu);
+ Nurb *nu = BKE_curve_nurb_active_get(cu);
if (!nu || nu->type == CU_BEZIER) {
Nurb *nurb_new;
@@ -5764,8 +5697,7 @@ static int curve_extrude_exec(bContext *C, wmOperator *UNUSED(op))
/* First test: curve? */
if (obedit->type != OB_CURVE) {
- Nurb *nu;
- for (nu = editnurb->nurbs.first; nu; nu = nu->next) {
+ LISTBASE_FOREACH (Nurb *, nu, &editnurb->nurbs) {
if ((nu->pntsv == 1) && (ED_curve_nurb_select_count(v3d, nu) == 1)) {
as_curve = true;
break;
@@ -5819,13 +5751,12 @@ void CURVE_OT_extrude(wmOperatorType *ot)
static bool curve_toggle_cyclic(View3D *v3d, ListBase *editnurb, int direction)
{
- Nurb *nu;
BezTriple *bezt;
BPoint *bp;
int a;
bool changed = false;
- for (nu = editnurb->first; nu; nu = nu->next) {
+ LISTBASE_FOREACH (Nurb *, nu, editnurb) {
if (nu->pntsu > 1 || nu->pntsv > 1) {
if (nu->type == CU_POLY) {
a = nu->pntsu;
@@ -5932,10 +5863,9 @@ static int toggle_cyclic_invoke(bContext *C, wmOperator *op, const wmEvent *UNUS
ListBase *editnurb = object_editcurve_get(obedit);
uiPopupMenu *pup;
uiLayout *layout;
- Nurb *nu;
if (obedit->type == OB_SURF) {
- for (nu = editnurb->first; nu; nu = nu->next) {
+ LISTBASE_FOREACH (Nurb *, nu, editnurb) {
if (nu->pntsu > 1 || nu->pntsv > 1) {
if (nu->type == CU_NURBS) {
pup = UI_popup_menu_begin(C, IFACE_("Direction"), ICON_NONE);
@@ -6064,12 +5994,12 @@ static bool curve_delete_segments(Object *obedit, View3D *v3d, const bool split)
Curve *cu = obedit->data;
EditNurb *editnurb = cu->editnurb;
ListBase *nubase = &editnurb->nurbs, newnurb = {NULL, NULL};
- Nurb *nu, *nu1;
+ Nurb *nu1;
BezTriple *bezt, *bezt1, *bezt2;
BPoint *bp, *bp1, *bp2;
int a, b, starta, enda, cut, cyclicut;
- for (nu = nubase->first; nu; nu = nu->next) {
+ LISTBASE_FOREACH (Nurb *, nu, nubase) {
nu1 = NULL;
starta = enda = cut = -1;
cyclicut = 0;
@@ -6452,7 +6382,7 @@ static bool curve_delete_segments(Object *obedit, View3D *v3d, const bool split)
}
}
- for (nu = newnurb.first; nu; nu = nu->next) {
+ LISTBASE_FOREACH (Nurb *, nu, &newnurb) {
if (nu->type == CU_BEZIER) {
if (split) {
/* deselect for split operator */
@@ -6620,9 +6550,8 @@ static int curve_dissolve_exec(bContext *C, wmOperator *UNUSED(op))
}
ListBase *editnurb = object_editcurve_get(obedit);
- Nurb *nu;
- for (nu = editnurb->first; nu; nu = nu->next) {
+ LISTBASE_FOREACH (Nurb *, nu, editnurb) {
if ((nu->type == CU_BEZIER) && (nu->pntsu > 2)) {
uint span_step[2] = {nu->pntsu, nu->pntsu};
uint span_len;
@@ -6766,9 +6695,8 @@ static int curve_decimate_exec(bContext *C, wmOperator *op)
{
ListBase *editnurb = object_editcurve_get(obedit);
- Nurb *nu;
- for (nu = editnurb->first; nu; nu = nu->next) {
+ LISTBASE_FOREACH (Nurb *, nu, editnurb) {
if (nu->type == CU_BEZIER) {
if ((nu->pntsu > 2) && nurb_bezt_flag_any(nu, SELECT)) {
const int error_target_len = max_ii(2, nu->pntsu * ratio);
@@ -6917,7 +6845,6 @@ int ED_curve_join_objects_exec(bContext *C, wmOperator *op)
Scene *scene = CTX_data_scene(C);
Object *ob_active = CTX_data_active_object(C);
Curve *cu;
- Nurb *nu, *newnu;
BezTriple *bezt;
BPoint *bp;
ListBase tempbase;
@@ -6955,9 +6882,8 @@ int ED_curve_join_objects_exec(bContext *C, wmOperator *op)
/* watch it: switch order here really goes wrong */
mul_m4_m4m4(cmat, imat, ob_iter->obmat);
- nu = cu->nurb.first;
- while (nu) {
- newnu = BKE_nurb_duplicate(nu);
+ LISTBASE_FOREACH (Nurb *, nu, &cu->nurb) {
+ Nurb *newnu = BKE_nurb_duplicate(nu);
if (ob_active->totcol) { /* TODO, merge material lists */
CLAMP(newnu->mat_nr, 0, ob_active->totcol - 1);
}
@@ -6983,7 +6909,6 @@ int ED_curve_join_objects_exec(bContext *C, wmOperator *op)
bp++;
}
}
- nu = nu->next;
}
}
@@ -7035,12 +6960,11 @@ static int clear_tilt_exec(bContext *C, wmOperator *UNUSED(op))
}
ListBase *editnurb = object_editcurve_get(obedit);
- Nurb *nu;
BezTriple *bezt;
BPoint *bp;
int a;
- for (nu = editnurb->first; nu; nu = nu->next) {
+ LISTBASE_FOREACH (Nurb *, nu, editnurb) {
if (nu->bezt) {
bezt = nu->bezt;
a = nu->pntsu;
diff --git a/source/blender/editors/curve/editcurve_query.c b/source/blender/editors/curve/editcurve_query.c
index 48571ab2a9b..369137cbe25 100644
--- a/source/blender/editors/curve/editcurve_query.c
+++ b/source/blender/editors/curve/editcurve_query.c
@@ -26,6 +26,7 @@
#include "MEM_guardedalloc.h"
+#include "BLI_listbase.h"
#include "BLI_math.h"
#include "BKE_curve.h"
@@ -170,7 +171,6 @@ void ED_curve_nurb_vert_selected_find(
/* in nu and (bezt or bp) selected are written if there's 1 sel. */
/* if more points selected in 1 spline: return only nu, bezt and bp are 0 */
ListBase *editnurb = &cu->editnurb->nurbs;
- Nurb *nu1;
BezTriple *bezt1;
BPoint *bp1;
int a;
@@ -179,7 +179,7 @@ void ED_curve_nurb_vert_selected_find(
*r_bezt = NULL;
*r_bp = NULL;
- for (nu1 = editnurb->first; nu1; nu1 = nu1->next) {
+ LISTBASE_FOREACH (Nurb *, nu1, editnurb) {
if (nu1->type == CU_BEZIER) {
bezt1 = nu1->bezt;
a = nu1->pntsu;
diff --git a/source/blender/editors/curve/editcurve_select.c b/source/blender/editors/curve/editcurve_select.c
index aa4ba332b66..cb0a66bf5a8 100644
--- a/source/blender/editors/curve/editcurve_select.c
+++ b/source/blender/editors/curve/editcurve_select.c
@@ -237,9 +237,7 @@ int ED_curve_select_count(View3D *v3d, struct EditNurb *editnurb)
bool ED_curve_select_check(View3D *v3d, struct EditNurb *editnurb)
{
- Nurb *nu;
-
- for (nu = editnurb->nurbs.first; nu; nu = nu->next) {
+ LISTBASE_FOREACH (Nurb *, nu, &editnurb->nurbs) {
if (ED_curve_nurb_select_check(v3d, nu)) {
return true;
}
@@ -284,13 +282,12 @@ bool ED_curve_deselect_all_multi(struct bContext *C)
bool ED_curve_select_swap(EditNurb *editnurb, bool hide_handles)
{
- Nurb *nu;
BPoint *bp;
BezTriple *bezt;
int a;
bool changed = false;
- for (nu = editnurb->nurbs.first; nu; nu = nu->next) {
+ LISTBASE_FOREACH (Nurb *, nu, &editnurb->nurbs) {
if (nu->type == CU_BEZIER) {
bezt = nu->bezt;
a = nu->pntsu;
@@ -331,7 +328,6 @@ static void select_adjacent_cp(ListBase *editnurb,
const bool cont,
const bool selstatus)
{
- Nurb *nu;
BezTriple *bezt;
BPoint *bp;
int a;
@@ -341,7 +337,7 @@ static void select_adjacent_cp(ListBase *editnurb,
return;
}
- for (nu = editnurb->first; nu; nu = nu->next) {
+ LISTBASE_FOREACH (Nurb *, nu, editnurb) {
lastsel = false;
if (nu->type == CU_BEZIER) {
a = nu->pntsu;
@@ -412,7 +408,6 @@ static void select_adjacent_cp(ListBase *editnurb,
static void selectend_nurb(Object *obedit, eEndPoint_Types selfirst, bool doswap, bool selstatus)
{
ListBase *editnurb = object_editcurve_get(obedit);
- Nurb *nu;
BPoint *bp;
BezTriple *bezt;
Curve *cu;
@@ -425,7 +420,7 @@ static void selectend_nurb(Object *obedit, eEndPoint_Types selfirst, bool doswap
cu = (Curve *)obedit->data;
cu->actvert = CU_ACT_NONE;
- for (nu = editnurb->first; nu; nu = nu->next) {
+ LISTBASE_FOREACH (Nurb *, nu, editnurb) {
if (nu->type == CU_BEZIER) {
a = nu->pntsu;
@@ -632,10 +627,9 @@ static int select_linked_exec(bContext *C, wmOperator *UNUSED(op))
Curve *cu = obedit->data;
EditNurb *editnurb = cu->editnurb;
ListBase *nurbs = &editnurb->nurbs;
- Nurb *nu;
bool changed = false;
- for (nu = nurbs->first; nu; nu = nu->next) {
+ LISTBASE_FOREACH (Nurb *, nu, nurbs) {
if (ED_curve_nurb_select_check(v3d, nu)) {
changed |= ED_curve_nurb_select_all(nu);
}
@@ -887,7 +881,6 @@ void CURVE_OT_select_previous(wmOperatorType *ot)
static void curve_select_more(Object *obedit)
{
ListBase *editnurb = object_editcurve_get(obedit);
- Nurb *nu;
BPoint *bp, *tempbp;
int a;
short sel = 0;
@@ -897,7 +890,7 @@ static void curve_select_more(Object *obedit)
/* The algorithm is designed to work in planar cases so it */
/* may not be optimal always (example: end of NURBS sphere) */
if (obedit->type == OB_SURF) {
- for (nu = editnurb->first; nu; nu = nu->next) {
+ LISTBASE_FOREACH (Nurb *, nu, editnurb) {
BLI_bitmap *selbpoints;
a = nu->pntsu * nu->pntsv;
bp = nu->bp;
@@ -997,7 +990,6 @@ void CURVE_OT_select_more(wmOperatorType *ot)
static void curve_select_less(Object *obedit)
{
ListBase *editnurb = object_editcurve_get(obedit);
- Nurb *nu;
BPoint *bp;
BezTriple *bezt;
int a;
@@ -1005,7 +997,7 @@ static void curve_select_less(Object *obedit)
bool lastsel = false;
if (obedit->type == OB_SURF) {
- for (nu = editnurb->first; nu; nu = nu->next) {
+ LISTBASE_FOREACH (Nurb *, nu, editnurb) {
BLI_bitmap *selbpoints;
a = nu->pntsu * nu->pntsv;
bp = nu->bp;
@@ -1077,7 +1069,7 @@ static void curve_select_less(Object *obedit)
}
}
else {
- for (nu = editnurb->first; nu; nu = nu->next) {
+ LISTBASE_FOREACH (Nurb *, nu, editnurb) {
lastsel = false;
/* check what type of curve/nurb it is */
if (nu->type == CU_BEZIER) {
@@ -1210,14 +1202,13 @@ void CURVE_OT_select_less(wmOperatorType *ot)
static void curve_select_random(ListBase *editnurb, float randfac, int seed, bool select)
{
- Nurb *nu;
BezTriple *bezt;
BPoint *bp;
int a;
RNG *rng = BLI_rng_new_srandom(seed);
- for (nu = editnurb->first; nu; nu = nu->next) {
+ LISTBASE_FOREACH (Nurb *, nu, editnurb) {
if (nu->type == CU_BEZIER) {
bezt = nu->bezt;
a = nu->pntsu;
@@ -1702,8 +1693,7 @@ static int curve_select_similar_exec(bContext *C, wmOperator *op)
Curve *cu = obedit->data;
EditNurb *editnurb = cu->editnurb;
- Nurb *nu;
- for (nu = editnurb->nurbs.first; nu; nu = nu->next) {
+ LISTBASE_FOREACH (Nurb *, nu, &editnurb->nurbs) {
if (!ED_curve_nurb_select_check(v3d, nu)) {
continue;
}
@@ -1736,9 +1726,8 @@ static int curve_select_similar_exec(bContext *C, wmOperator *op)
Curve *cu = obedit->data;
EditNurb *editnurb = cu->editnurb;
bool changed = false;
- Nurb *nu;
- for (nu = editnurb->nurbs.first; nu; nu = nu->next) {
+ LISTBASE_FOREACH (Nurb *, nu, &editnurb->nurbs) {
switch (optype) {
case SIMCURHAND_TYPE: {
if (nu->type & type_ref) {
diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c
index d54bdf552eb..98789706a13 100644
--- a/source/blender/editors/gpencil/gpencil_edit.c
+++ b/source/blender/editors/gpencil/gpencil_edit.c
@@ -3152,8 +3152,8 @@ void GPENCIL_OT_stroke_cyclical_set(wmOperatorType *ot)
PropertyRNA *prop;
static const EnumPropertyItem cyclic_type[] = {
- {GP_STROKE_CYCLIC_CLOSE, "CLOSE", 0, "Close all", ""},
- {GP_STROKE_CYCLIC_OPEN, "OPEN", 0, "Open all", ""},
+ {GP_STROKE_CYCLIC_CLOSE, "CLOSE", 0, "Close All", ""},
+ {GP_STROKE_CYCLIC_OPEN, "OPEN", 0, "Open All", ""},
{GP_STROKE_CYCLIC_TOGGLE, "TOGGLE", 0, "Toggle", ""},
{0, NULL, 0, NULL, NULL},
};
@@ -4678,7 +4678,9 @@ typedef bool (*GPencilTestFn)(bGPDstroke *gps,
const float diff_mat[4][4],
void *user_data);
-static void gpencil_cutter_dissolve(bGPDlayer *hit_layer, bGPDstroke *hit_stroke)
+static void gpencil_cutter_dissolve(bGPDlayer *hit_layer,
+ bGPDstroke *hit_stroke,
+ const bool flat_caps)
{
bGPDspoint *pt = NULL;
bGPDspoint *pt1 = NULL;
@@ -4722,6 +4724,17 @@ static void gpencil_cutter_dissolve(bGPDlayer *hit_layer, bGPDstroke *hit_stroke
pt->flag &= ~GP_SPOINT_TAG;
}
}
+ /* If flat caps mode check extremes. */
+ if (flat_caps) {
+ if (hit_stroke->points[0].flag & GP_SPOINT_TAG) {
+ hit_stroke->caps[0] = GP_STROKE_CAP_FLAT;
+ }
+
+ if (hit_stroke->points[hit_stroke->totpoints - 1].flag & GP_SPOINT_TAG) {
+ hit_stroke->caps[1] = GP_STROKE_CAP_FLAT;
+ }
+ }
+
gpencil_stroke_delete_tagged_points(
hit_layer->actframe, hit_stroke, gpsn, GP_SPOINT_TAG, false, 1);
}
@@ -4736,6 +4749,7 @@ static int gpencil_cutter_lasso_select(bContext *C,
ScrArea *area = CTX_wm_area(C);
ToolSettings *ts = CTX_data_tool_settings(C);
const float scale = ts->gp_sculpt.isect_threshold;
+ const bool flat_caps = RNA_boolean_get(op->ptr, "flat_caps");
bGPDspoint *pt;
GP_SpaceConversion gsc = {NULL};
@@ -4810,7 +4824,7 @@ static int gpencil_cutter_lasso_select(bContext *C,
}
LISTBASE_FOREACH_MUTABLE (bGPDstroke *, gps, &gpf->strokes) {
if (gps->flag & GP_STROKE_SELECT) {
- gpencil_cutter_dissolve(gpl, gps);
+ gpencil_cutter_dissolve(gpl, gps, flat_caps);
}
}
}
@@ -4884,6 +4898,8 @@ void GPENCIL_OT_stroke_cutter(wmOperatorType *ot)
/* properties */
WM_operator_properties_gesture_lasso(ot);
+
+ RNA_def_boolean(ot->srna, "flat_caps", 0, "Flat Caps", "");
}
bool ED_object_gpencil_exit(struct Main *bmain, Object *ob)
diff --git a/source/blender/editors/gpencil/gpencil_mesh.c b/source/blender/editors/gpencil/gpencil_mesh.c
index e4862617d12..c136ef2070e 100644
--- a/source/blender/editors/gpencil/gpencil_mesh.c
+++ b/source/blender/editors/gpencil/gpencil_mesh.c
@@ -25,12 +25,15 @@
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
+#include "BLI_ghash.h"
#include "BLI_math.h"
+#include "DNA_anim_types.h"
#include "DNA_gpencil_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
+#include "BKE_anim_data.h"
#include "BKE_context.h"
#include "BKE_duplilist.h"
#include "BKE_global.h"
@@ -86,6 +89,35 @@ typedef struct GpBakeOb {
Object *ob;
} GpBakeOb;
+/* Get list of keyframes used by selected objects. */
+static void animdata_keyframe_list_get(ListBase *ob_list,
+ const bool only_selected,
+ GHash *r_keyframes)
+{
+ /* Loop all objects to get the list of keyframes used. */
+ LISTBASE_FOREACH (GpBakeOb *, elem, ob_list) {
+ Object *ob = elem->ob;
+ AnimData *adt = BKE_animdata_from_id(&ob->id);
+ if ((adt == NULL) || (adt->action == NULL)) {
+ continue;
+ }
+ LISTBASE_FOREACH (FCurve *, fcurve, &adt->action->curves) {
+ int i;
+ BezTriple *bezt;
+ for (i = 0, bezt = fcurve->bezt; i < fcurve->totvert; i++, bezt++) {
+ /* Keyframe number is x value of point. */
+ if ((bezt->f2 & SELECT) || (!only_selected)) {
+ /* Insert only one key for each keyframe number. */
+ int key = (int)bezt->vec[1][0];
+ if (!BLI_ghash_haskey(r_keyframes, POINTER_FROM_INT(key))) {
+ BLI_ghash_insert(r_keyframes, POINTER_FROM_INT(key), POINTER_FROM_INT(key));
+ }
+ }
+ }
+ }
+ }
+}
+
static void gpencil_bake_duplilist(Depsgraph *depsgraph, Scene *scene, Object *ob, ListBase *list)
{
GpBakeOb *elem = NULL;
@@ -161,13 +193,13 @@ static int gpencil_bake_mesh_animation_exec(bContext *C, wmOperator *op)
View3D *v3d = CTX_wm_view3d(C);
Object *ob_gpencil = NULL;
- ListBase list = {NULL, NULL};
- gpencil_bake_ob_list(C, depsgraph, scene, &list);
+ ListBase ob_selected_list = {NULL, NULL};
+ gpencil_bake_ob_list(C, depsgraph, scene, &ob_selected_list);
/* Cannot check this in poll because the active object changes. */
- if (list.first == NULL) {
+ if (ob_selected_list.first == NULL) {
BKE_report(op->reports, RPT_INFO, "No valid object selected");
- gpencil_bake_free_ob_list(&list);
+ gpencil_bake_free_ob_list(&ob_selected_list);
return OPERATOR_CANCELLED;
}
@@ -186,29 +218,20 @@ static int gpencil_bake_mesh_animation_exec(bContext *C, wmOperator *op)
const int thickness = RNA_int_get(op->ptr, "thickness");
const bool use_seams = RNA_boolean_get(op->ptr, "seams");
const bool use_faces = RNA_boolean_get(op->ptr, "faces");
+ const bool only_selected = RNA_boolean_get(op->ptr, "only_selected");
const float offset = RNA_float_get(op->ptr, "offset");
const int frame_offset = RNA_int_get(op->ptr, "frame_target") - frame_start;
- char target[64];
- RNA_string_get(op->ptr, "target", target);
const int project_type = RNA_enum_get(op->ptr, "project_type");
+ ob_gpencil = (Object *)RNA_pointer_get(op->ptr, "target").data;
/* Create a new grease pencil object in origin. */
bool newob = false;
- if (STREQ(target, "*NEW")) {
+ if (ob_gpencil == NULL) {
ushort local_view_bits = (v3d && v3d->localvd) ? v3d->local_view_uuid : 0;
const float loc[3] = {0.0f, 0.0f, 0.0f};
ob_gpencil = ED_gpencil_add_object(C, loc, local_view_bits);
newob = true;
}
- else {
- ob_gpencil = BLI_findstring(&bmain->objects, target, offsetof(ID, name) + 2);
- }
-
- if ((ob_gpencil == NULL) || (ob_gpencil->type != OB_GPENCIL)) {
- BKE_report(op->reports, RPT_ERROR, "Target grease pencil object not valid");
- gpencil_bake_free_ob_list(&list);
- return OPERATOR_CANCELLED;
- }
bGPdata *gpd = (bGPdata *)ob_gpencil->data;
gpd->draw_mode = (project_type == GP_REPROJECT_KEEP) ? GP_DRAWMODE_3D : GP_DRAWMODE_2D;
@@ -237,6 +260,13 @@ static int gpencil_bake_mesh_animation_exec(bContext *C, wmOperator *op)
/* Loop all frame range. */
int oldframe = (int)DEG_get_ctime(depsgraph);
int key = -1;
+
+ /* Get list of keyframes. */
+ GHash *keyframe_list = BLI_ghash_int_new(__func__);
+ if (only_selected) {
+ animdata_keyframe_list_get(&ob_selected_list, only_selected, keyframe_list);
+ }
+
for (int i = frame_start; i < frame_end + 1; i++) {
key++;
/* Jump if not step limit but include last frame always. */
@@ -244,12 +274,17 @@ static int gpencil_bake_mesh_animation_exec(bContext *C, wmOperator *op)
continue;
}
+ /* Check if frame is in the list of frames to be exported. */
+ if ((only_selected) && (!BLI_ghash_haskey(keyframe_list, POINTER_FROM_INT(i)))) {
+ continue;
+ }
+
/* Move scene to new frame. */
CFRA = i;
BKE_scene_graph_update_for_newframe(depsgraph);
/* Loop all objects in the list. */
- LISTBASE_FOREACH (GpBakeOb *, elem, &list) {
+ LISTBASE_FOREACH (GpBakeOb *, elem, &ob_selected_list) {
Object *ob_eval = (Object *)DEG_get_evaluated_object(depsgraph, elem->ob);
/* Generate strokes. */
@@ -270,13 +305,14 @@ static int gpencil_bake_mesh_animation_exec(bContext *C, wmOperator *op)
if (project_type != GP_REPROJECT_KEEP) {
LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) {
bGPDframe *gpf = gpl->actframe;
- if (gpf != NULL) {
- LISTBASE_FOREACH (bGPDstroke *, gps, &gpf->strokes) {
- if ((gps->flag & GP_STROKE_TAG) == 0) {
- ED_gpencil_stroke_reproject(
- depsgraph, &gsc, sctx, gpl, gpf, gps, project_type, false);
- gps->flag |= GP_STROKE_TAG;
- }
+ if (gpf == NULL) {
+ continue;
+ }
+ LISTBASE_FOREACH (bGPDstroke *, gps, &gpf->strokes) {
+ if ((gps->flag & GP_STROKE_TAG) == 0) {
+ ED_gpencil_stroke_reproject(
+ depsgraph, &gsc, sctx, gpl, gpf, gps, project_type, false);
+ gps->flag |= GP_STROKE_TAG;
}
}
}
@@ -314,10 +350,14 @@ static int gpencil_bake_mesh_animation_exec(bContext *C, wmOperator *op)
}
/* Free memory. */
- gpencil_bake_free_ob_list(&list);
+ gpencil_bake_free_ob_list(&ob_selected_list);
if (sctx != NULL) {
ED_transform_snap_object_context_destroy(sctx);
}
+ /* Free temp hash table. */
+ if (keyframe_list != NULL) {
+ BLI_ghash_free(keyframe_list, NULL, NULL);
+ }
/* notifiers */
if (newob) {
@@ -334,6 +374,19 @@ static int gpencil_bake_mesh_animation_exec(bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
+static int gpencil_bake_mesh_animation_invoke(bContext *C,
+ wmOperator *op,
+ const wmEvent *UNUSED(event))
+{
+ /* Show popup dialog to allow editing. */
+ /* FIXME: hard-coded dimensions here are just arbitrary. */
+ return WM_operator_props_dialog_popup(C, op, 250);
+}
+
+static bool rna_GPencil_object_poll(PointerRNA *UNUSED(ptr), PointerRNA value)
+{
+ return ((Object *)value.owner_id)->type == OB_GPENCIL;
+}
void GPENCIL_OT_bake_mesh_animation(wmOperatorType *ot)
{
static const EnumPropertyItem reproject_type[] = {
@@ -363,6 +416,7 @@ void GPENCIL_OT_bake_mesh_animation(wmOperatorType *ot)
ot->description = "Bake Mesh Animation to Grease Pencil strokes";
/* callbacks */
+ ot->invoke = gpencil_bake_mesh_animation_invoke;
ot->exec = gpencil_bake_mesh_animation_exec;
ot->poll = gpencil_bake_mesh_animation_poll;
@@ -370,7 +424,15 @@ void GPENCIL_OT_bake_mesh_animation(wmOperatorType *ot)
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* properties */
- ot->prop = RNA_def_int(
+ ot->prop = RNA_def_pointer_runtime(ot->srna,
+ "target",
+ &RNA_Object,
+ "Target Object",
+ "Target grease pencil object. Leave empty for new object");
+ RNA_def_property_poll_runtime(ot->prop, rna_GPencil_object_poll);
+ RNA_def_property_flag(ot->prop, PROP_SKIP_SAVE);
+
+ prop = RNA_def_int(
ot->srna, "frame_start", 1, 1, 100000, "Start Frame", "The start frame", 1, 100000);
prop = RNA_def_int(
@@ -379,6 +441,8 @@ void GPENCIL_OT_bake_mesh_animation(wmOperatorType *ot)
prop = RNA_def_int(ot->srna, "step", 1, 1, 100, "Step", "Step between generated frames", 1, 100);
+ RNA_def_int(ot->srna, "thickness", 1, 1, 100, "Thickness", "", 1, 100);
+
prop = RNA_def_float_rotation(ot->srna,
"angle",
0,
@@ -391,18 +455,22 @@ void GPENCIL_OT_bake_mesh_animation(wmOperatorType *ot)
DEG2RADF(180.0f));
RNA_def_property_float_default(prop, DEG2RADF(70.0f));
- RNA_def_int(ot->srna, "thickness", 1, 1, 100, "Thickness", "", 1, 100);
+ RNA_def_float_distance(ot->srna,
+ "offset",
+ 0.001f,
+ 0.0,
+ 100.0,
+ "Stroke Offset",
+ "Offset strokes from fill",
+ 0.0,
+ 100.00);
+
RNA_def_boolean(ot->srna, "seams", 0, "Only Seam Edges", "Convert only seam edges");
RNA_def_boolean(ot->srna, "faces", 1, "Export Faces", "Export faces as filled strokes");
- RNA_def_float_distance(
- ot->srna, "offset", 0.001f, 0.0, 100.0, "Offset", "Offset strokes from fill", 0.0, 100.00);
- RNA_def_int(ot->srna, "frame_target", 1, 1, 100000, "Frame Target", "", 1, 100000);
- RNA_def_string(ot->srna,
- "target",
- "*NEW",
- 64,
- "Target Object",
- "Target grease pencil object name. Leave empty for new object");
+ RNA_def_boolean(
+ ot->srna, "only_selected", 0, "Only Selected Keyframes", "Convert only selected keyframes");
+ RNA_def_int(
+ ot->srna, "frame_target", 1, 1, 100000, "Target Frame", "Destination frame", 1, 100000);
RNA_def_enum(ot->srna, "project_type", reproject_type, GP_REPROJECT_VIEW, "Projection Type", "");
}
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index 601ab44c3d6..ea9385cb08f 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -772,6 +772,95 @@ static void ui_but_extra_icons_update_from_old_but(const uiBut *new_but, const u
}
/**
+ * Update pointers and other information in the old active button based on new information in the
+ * corresponding new button from the current layout pass.
+ *
+ * \param oldbut: The button from the last layout pass that will be moved to the new block.
+ * \param but: The newly added button with much of the up to date information, to be feed later.
+ *
+ * \note #uiBut has ownership of many of its pointers. When the button is freed all these
+ * pointers are freed as well, so ownership has to be moved out of \a but in order to free it.
+ */
+static void ui_but_update_old_active_from_new(uiBut *oldbut, uiBut *but)
+{
+ BLI_assert(oldbut->active);
+
+ /* flags from the buttons we want to refresh, may want to add more here... */
+ const int flag_copy = UI_BUT_REDALERT | UI_HAS_ICON;
+ const int drawflag_copy = 0; /* None currently. */
+
+ /* still stuff needs to be copied */
+ oldbut->rect = but->rect;
+ oldbut->context = but->context; /* set by Layout */
+
+ /* drawing */
+ oldbut->icon = but->icon;
+ oldbut->iconadd = but->iconadd;
+ oldbut->alignnr = but->alignnr;
+
+ /* typically the same pointers, but not on undo/redo */
+ /* XXX some menu buttons store button itself in but->poin. Ugly */
+ if (oldbut->poin != (char *)oldbut) {
+ SWAP(char *, oldbut->poin, but->poin);
+ SWAP(void *, oldbut->func_argN, but->func_argN);
+ }
+
+ /* Move tooltip from new to old. */
+ SWAP(uiButToolTipFunc, oldbut->tip_func, but->tip_func);
+ SWAP(void *, oldbut->tip_argN, but->tip_argN);
+
+ oldbut->flag = (oldbut->flag & ~flag_copy) | (but->flag & flag_copy);
+ oldbut->drawflag = (oldbut->drawflag & ~drawflag_copy) | (but->drawflag & drawflag_copy);
+
+ ui_but_extra_icons_update_from_old_but(but, oldbut);
+ SWAP(ListBase, but->extra_op_icons, oldbut->extra_op_icons);
+
+ if (oldbut->type == UI_BTYPE_SEARCH_MENU) {
+ uiButSearch *search_oldbut = (uiButSearch *)oldbut, *search_but = (uiButSearch *)but;
+
+ SWAP(uiButSearchArgFreeFn, search_oldbut->arg_free_fn, search_but->arg_free_fn);
+ SWAP(void *, search_oldbut->arg, search_but->arg);
+ }
+
+ /* copy hardmin for list rows to prevent 'sticking' highlight to mouse position
+ * when scrolling without moving mouse (see T28432) */
+ if (ELEM(oldbut->type, UI_BTYPE_ROW, UI_BTYPE_LISTROW)) {
+ oldbut->hardmax = but->hardmax;
+ }
+
+ if (oldbut->type == UI_BTYPE_PROGRESS_BAR) {
+ uiButProgressbar *progress_oldbut = (uiButProgressbar *)oldbut;
+ uiButProgressbar *progress_but = (uiButProgressbar *)but;
+ progress_oldbut->progress = progress_but->progress;
+ }
+
+ /* move/copy string from the new button to the old */
+ /* needed for alt+mouse wheel over enums */
+ if (but->str != but->strdata) {
+ if (oldbut->str != oldbut->strdata) {
+ SWAP(char *, but->str, oldbut->str);
+ }
+ else {
+ oldbut->str = but->str;
+ but->str = but->strdata;
+ }
+ }
+ else {
+ if (oldbut->str != oldbut->strdata) {
+ MEM_freeN(oldbut->str);
+ oldbut->str = oldbut->strdata;
+ }
+ BLI_strncpy(oldbut->strdata, but->strdata, sizeof(oldbut->strdata));
+ }
+
+ if (but->dragpoin && (but->dragflag & UI_BUT_DRAGPOIN_FREE)) {
+ SWAP(void *, but->dragpoin, oldbut->dragpoin);
+ }
+
+ /* note: if layout hasn't been applied yet, it uses old button pointers... */
+}
+
+/**
* \return true when \a but_p is set (only done for active buttons).
*/
static bool ui_but_update_from_old_block(const bContext *C,
@@ -779,138 +868,51 @@ static bool ui_but_update_from_old_block(const bContext *C,
uiBut **but_p,
uiBut **but_old_p)
{
- const int drawflag_copy = 0; /* None currently. */
-
uiBlock *oldblock = block->oldblock;
- uiBut *oldbut = NULL, *but = *but_p;
- bool found_active = false;
+ uiBut *but = *but_p;
#if 0
- /* simple/stupid - search every time */
- oldbut = ui_but_find_old(oldblock, but);
- (void)but_old_p;
+ /* Simple method - search every time. Keep this for easy testing of the "fast path." */
+ uiBut *oldbut = ui_but_find_old(oldblock, but);
+ UNUSED_VARS(but_old_p);
#else
BLI_assert(*but_old_p == NULL || BLI_findindex(&oldblock->buttons, *but_old_p) != -1);
- /* Fast-path - avoid loop-in-loop, calling #ui_but_find_old
- * as long as old/new buttons are aligned. */
+ /* As long as old and new buttons are aligned, avoid loop-in-loop (calling #ui_but_find_old). */
+ uiBut *oldbut;
if (LIKELY(*but_old_p && ui_but_equals_old(but, *but_old_p))) {
oldbut = *but_old_p;
}
else {
- /* fallback to block search */
+ /* Fallback to block search. */
oldbut = ui_but_find_old(oldblock, but);
}
(*but_old_p) = oldbut ? oldbut->next : NULL;
#endif
+ bool found_active = false;
+
if (!oldbut) {
- return found_active;
+ return false;
}
if (oldbut->active) {
- /* flags from the buttons we want to refresh, may want to add more here... */
- const int flag_copy = UI_BUT_REDALERT | UI_HAS_ICON;
-
- found_active = true;
-
-#if 0
- but->flag = oldbut->flag;
- but->active = oldbut->active;
- but->pos = oldbut->pos;
- but->ofs = oldbut->ofs;
- but->editstr = oldbut->editstr;
- but->editval = oldbut->editval;
- but->editvec = oldbut->editvec;
- but->selsta = oldbut->selsta;
- but->selend = oldbut->selend;
- but->softmin = oldbut->softmin;
- but->softmax = oldbut->softmax;
- oldbut->active = NULL;
-#endif
-
- /* move button over from oldblock to new block */
+ /* Move button over from oldblock to new block. */
BLI_remlink(&oldblock->buttons, oldbut);
BLI_insertlinkafter(&block->buttons, but, oldbut);
oldbut->block = block;
*but_p = oldbut;
- /* still stuff needs to be copied */
- oldbut->rect = but->rect;
- oldbut->context = but->context; /* set by Layout */
-
- /* drawing */
- oldbut->icon = but->icon;
- oldbut->iconadd = but->iconadd;
- oldbut->alignnr = but->alignnr;
-
- /* typically the same pointers, but not on undo/redo */
- /* XXX some menu buttons store button itself in but->poin. Ugly */
- if (oldbut->poin != (char *)oldbut) {
- SWAP(char *, oldbut->poin, but->poin);
- SWAP(void *, oldbut->func_argN, but->func_argN);
- }
-
- /* Move tooltip from new to old. */
- SWAP(uiButToolTipFunc, oldbut->tip_func, but->tip_func);
- SWAP(void *, oldbut->tip_argN, but->tip_argN);
-
- oldbut->flag = (oldbut->flag & ~flag_copy) | (but->flag & flag_copy);
- oldbut->drawflag = (oldbut->drawflag & ~drawflag_copy) | (but->drawflag & drawflag_copy);
-
- ui_but_extra_icons_update_from_old_but(but, oldbut);
- SWAP(ListBase, but->extra_op_icons, oldbut->extra_op_icons);
-
- if (oldbut->type == UI_BTYPE_SEARCH_MENU) {
- uiButSearch *search_oldbut = (uiButSearch *)oldbut, *search_but = (uiButSearch *)but;
-
- SWAP(uiButSearchArgFreeFn, search_oldbut->arg_free_fn, search_but->arg_free_fn);
- SWAP(void *, search_oldbut->arg, search_but->arg);
- }
-
- /* copy hardmin for list rows to prevent 'sticking' highlight to mouse position
- * when scrolling without moving mouse (see T28432) */
- if (ELEM(oldbut->type, UI_BTYPE_ROW, UI_BTYPE_LISTROW)) {
- oldbut->hardmax = but->hardmax;
- }
-
- if (oldbut->type == UI_BTYPE_PROGRESS_BAR) {
- uiButProgressbar *progress_oldbut = (uiButProgressbar *)oldbut;
- uiButProgressbar *progress_but = (uiButProgressbar *)but;
- progress_oldbut->progress = progress_but->progress;
- }
+ ui_but_update_old_active_from_new(oldbut, but);
if (!BLI_listbase_is_empty(&block->butstore)) {
UI_butstore_register_update(block, oldbut, but);
}
- /* move/copy string from the new button to the old */
- /* needed for alt+mouse wheel over enums */
- if (but->str != but->strdata) {
- if (oldbut->str != oldbut->strdata) {
- SWAP(char *, but->str, oldbut->str);
- }
- else {
- oldbut->str = but->str;
- but->str = but->strdata;
- }
- }
- else {
- if (oldbut->str != oldbut->strdata) {
- MEM_freeN(oldbut->str);
- oldbut->str = oldbut->strdata;
- }
- BLI_strncpy(oldbut->strdata, but->strdata, sizeof(oldbut->strdata));
- }
-
- if (but->dragpoin && (but->dragflag & UI_BUT_DRAGPOIN_FREE)) {
- SWAP(void *, but->dragpoin, oldbut->dragpoin);
- }
-
BLI_remlink(&block->buttons, but);
ui_but_free(C, but);
- /* note: if layout hasn't been applied yet, it uses old button pointers... */
+ found_active = true;
}
else {
const int flag_copy = UI_BUT_DRAG_MULTI;
diff --git a/source/blender/editors/interface/interface_eyedropper.c b/source/blender/editors/interface/interface_eyedropper.c
index a740a152f1c..4d0e1584156 100644
--- a/source/blender/editors/interface/interface_eyedropper.c
+++ b/source/blender/editors/interface/interface_eyedropper.c
@@ -78,7 +78,7 @@ wmKeyMap *eyedropper_colorband_modal_keymap(wmKeyConfig *keyconf)
{
static const EnumPropertyItem modal_items_point[] = {
{EYE_MODAL_POINT_CANCEL, "CANCEL", 0, "Cancel", ""},
- {EYE_MODAL_POINT_SAMPLE, "SAMPLE_SAMPLE", 0, "Sample a point", ""},
+ {EYE_MODAL_POINT_SAMPLE, "SAMPLE_SAMPLE", 0, "Sample a Point", ""},
{EYE_MODAL_POINT_CONFIRM, "SAMPLE_CONFIRM", 0, "Confirm Sampling", ""},
{EYE_MODAL_POINT_RESET, "SAMPLE_RESET", 0, "Reset Sampling", ""},
{0, NULL, 0, NULL, NULL},
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index d4d24b3e3c2..62c387638dc 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -5330,7 +5330,7 @@ static void ui_template_palette_menu(bContext *UNUSED(C), uiLayout *layout, void
{
uiLayout *row;
- uiItemL(layout, IFACE_("Sort by:"), ICON_NONE);
+ uiItemL(layout, IFACE_("Sort By:"), ICON_NONE);
row = uiLayoutRow(layout, false);
uiItemEnumO_value(row, IFACE_("Hue"), ICON_NONE, "PALETTE_OT_sort", "type", 1);
row = uiLayoutRow(layout, false);
diff --git a/source/blender/editors/mesh/editmesh_bevel.c b/source/blender/editors/mesh/editmesh_bevel.c
index a90d6530453..012bca050cf 100644
--- a/source/blender/editors/mesh/editmesh_bevel.c
+++ b/source/blender/editors/mesh/editmesh_bevel.c
@@ -642,56 +642,56 @@ wmKeyMap *bevel_modal_keymap(wmKeyConfig *keyconf)
static const EnumPropertyItem modal_items[] = {
{BEV_MODAL_CANCEL, "CANCEL", 0, "Cancel", "Cancel bevel"},
{BEV_MODAL_CONFIRM, "CONFIRM", 0, "Confirm", "Confirm bevel"},
- {BEV_MODAL_VALUE_OFFSET, "VALUE_OFFSET", 0, "Change offset", "Value changes offset"},
- {BEV_MODAL_VALUE_PROFILE, "VALUE_PROFILE", 0, "Change profile", "Value changes profile"},
- {BEV_MODAL_VALUE_SEGMENTS, "VALUE_SEGMENTS", 0, "Change segments", "Value changes segments"},
- {BEV_MODAL_SEGMENTS_UP, "SEGMENTS_UP", 0, "Increase segments", "Increase segments"},
- {BEV_MODAL_SEGMENTS_DOWN, "SEGMENTS_DOWN", 0, "Decrease segments", "Decrease segments"},
+ {BEV_MODAL_VALUE_OFFSET, "VALUE_OFFSET", 0, "Change Offset", "Value changes offset"},
+ {BEV_MODAL_VALUE_PROFILE, "VALUE_PROFILE", 0, "Change Profile", "Value changes profile"},
+ {BEV_MODAL_VALUE_SEGMENTS, "VALUE_SEGMENTS", 0, "Change Segments", "Value changes segments"},
+ {BEV_MODAL_SEGMENTS_UP, "SEGMENTS_UP", 0, "Increase Segments", "Increase segments"},
+ {BEV_MODAL_SEGMENTS_DOWN, "SEGMENTS_DOWN", 0, "Decrease Segments", "Decrease segments"},
{BEV_MODAL_OFFSET_MODE_CHANGE,
"OFFSET_MODE_CHANGE",
0,
- "Change offset mode",
+ "Change Offset Mode",
"Cycle through offset modes"},
{BEV_MODAL_CLAMP_OVERLAP_TOGGLE,
"CLAMP_OVERLAP_TOGGLE",
0,
- "Toggle clamp overlap",
+ "Toggle Clamp Overlap",
"Toggle clamp overlap flag"},
{BEV_MODAL_AFFECT_CHANGE,
"AFFECT_CHANGE",
0,
- "Change affect type",
+ "Change Affect Type",
"Change which geometry type the operation affects, edges or vertices"},
{BEV_MODAL_HARDEN_NORMALS_TOGGLE,
"HARDEN_NORMALS_TOGGLE",
0,
- "Toggle harden normals",
+ "Toggle Harden Normals",
"Toggle harden normals flag"},
{BEV_MODAL_MARK_SEAM_TOGGLE,
"MARK_SEAM_TOGGLE",
0,
- "Toggle mark seam",
+ "Toggle Mark Seam",
"Toggle mark seam flag"},
{BEV_MODAL_MARK_SHARP_TOGGLE,
"MARK_SHARP_TOGGLE",
0,
- "Toggle mark sharp",
+ "Toggle Mark Sharp",
"Toggle mark sharp flag"},
{BEV_MODAL_OUTER_MITER_CHANGE,
"OUTER_MITER_CHANGE",
0,
- "Change outer miter",
+ "Change Outer Miter",
"Cycle through outer miter kinds"},
{BEV_MODAL_INNER_MITER_CHANGE,
"INNER_MITER_CHANGE",
0,
- "Change inner miter",
+ "Change Inner Miter",
"Cycle through inner miter kinds"},
{BEV_MODAL_PROFILE_TYPE_CHANGE, "PROFILE_TYPE_CHANGE", 0, "Cycle through profile types", ""},
{BEV_MODAL_VERTEX_MESH_CHANGE,
"VERTEX_MESH_CHANGE",
0,
- "Change intersection method",
+ "Change Intersection Method",
"Cycle through intersection methods"},
{0, NULL, 0, NULL, NULL},
};
diff --git a/source/blender/editors/mesh/editmesh_select_similar.c b/source/blender/editors/mesh/editmesh_select_similar.c
index f94d3ba5a70..00349983c57 100644
--- a/source/blender/editors/mesh/editmesh_select_similar.c
+++ b/source/blender/editors/mesh/editmesh_select_similar.c
@@ -83,7 +83,7 @@ static const EnumPropertyItem prop_similar_types[] = {
{SIMFACE_SIDES, "SIDES", 0, "Polygon Sides", ""},
{SIMFACE_PERIMETER, "PERIMETER", 0, "Perimeter", ""},
{SIMFACE_NORMAL, "NORMAL", 0, "Normal", ""},
- {SIMFACE_COPLANAR, "COPLANAR", 0, "Co-planar", ""},
+ {SIMFACE_COPLANAR, "COPLANAR", 0, "Coplanar", ""},
{SIMFACE_SMOOTH, "SMOOTH", 0, "Flat/Smooth", ""},
{SIMFACE_FACEMAP, "FACE_MAP", 0, "Face-Map", ""},
#ifdef WITH_FREESTYLE
diff --git a/source/blender/editors/object/object_hook.c b/source/blender/editors/object/object_hook.c
index 5cfe02dbc59..91c9916d227 100644
--- a/source/blender/editors/object/object_hook.c
+++ b/source/blender/editors/object/object_hook.c
@@ -238,12 +238,11 @@ static void select_editlattice_hook(Object *obedit, HookModifierData *hmd)
static int return_editcurve_indexar(Object *obedit, int *r_tot, int **r_indexar, float r_cent[3])
{
ListBase *editnurb = object_editcurve_get(obedit);
- Nurb *nu;
BPoint *bp;
BezTriple *bezt;
int *index, a, nr, totvert = 0;
- for (nu = editnurb->first; nu; nu = nu->next) {
+ LISTBASE_FOREACH (Nurb *, nu, editnurb) {
if (nu->type == CU_BEZIER) {
bezt = nu->bezt;
a = nu->pntsu;
@@ -280,7 +279,7 @@ static int return_editcurve_indexar(Object *obedit, int *r_tot, int **r_indexar,
nr = 0;
zero_v3(r_cent);
- for (nu = editnurb->first; nu; nu = nu->next) {
+ LISTBASE_FOREACH (Nurb *, nu, editnurb) {
if (nu->type == CU_BEZIER) {
bezt = nu->bezt;
a = nu->pntsu;
@@ -377,12 +376,11 @@ static bool object_hook_index_array(Main *bmain,
static void select_editcurve_hook(Object *obedit, HookModifierData *hmd)
{
ListBase *editnurb = object_editcurve_get(obedit);
- Nurb *nu;
BPoint *bp;
BezTriple *bezt;
int index = 0, a, nr = 0;
- for (nu = editnurb->first; nu; nu = nu->next) {
+ LISTBASE_FOREACH (Nurb *, nu, editnurb) {
if (nu->type == CU_BEZIER) {
bezt = nu->bezt;
a = nu->pntsu;
diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c
index 4eed9187d66..b8891b612c9 100644
--- a/source/blender/editors/object/object_modifier.c
+++ b/source/blender/editors/object/object_modifier.c
@@ -1478,8 +1478,8 @@ static char *modifier_apply_as_shapekey_get_description(struct bContext *UNUSED(
void OBJECT_OT_modifier_apply_as_shapekey(wmOperatorType *ot)
{
- ot->name = "Apply Modifier As Shapekey";
- ot->description = "Apply modifier as a new shapekey and remove from the stack";
+ ot->name = "Apply Modifier as Shape Key";
+ ot->description = "Apply modifier as a new shape key and remove from the stack";
ot->idname = "OBJECT_OT_modifier_apply_as_shapekey";
ot->invoke = modifier_apply_as_shapekey_invoke;
diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c
index de3e5f3d5f9..3d65a9e5fcb 100644
--- a/source/blender/editors/object/object_relations.c
+++ b/source/blender/editors/object/object_relations.c
@@ -1359,7 +1359,7 @@ enum {
static const EnumPropertyItem prop_make_track_types[] = {
{CREATE_TRACK_DAMPTRACK, "DAMPTRACK", 0, "Damped Track Constraint", ""},
- {CREATE_TRACK_TRACKTO, "TRACKTO", 0, "Track To Constraint", ""},
+ {CREATE_TRACK_TRACKTO, "TRACKTO", 0, "Track to Constraint", ""},
{CREATE_TRACK_LOCKTRACK, "LOCKTRACK", 0, "Lock Track Constraint", ""},
{0, NULL, 0, NULL, NULL},
};
diff --git a/source/blender/editors/physics/particle_object.c b/source/blender/editors/physics/particle_object.c
index 56bdc5c21f4..017cd63d9d5 100644
--- a/source/blender/editors/physics/particle_object.c
+++ b/source/blender/editors/physics/particle_object.c
@@ -691,7 +691,7 @@ void PARTICLE_OT_disconnect_hair(wmOperatorType *ot)
ot->flag = OPTYPE_UNDO;
RNA_def_boolean(
- ot->srna, "all", 0, "All hair", "Disconnect all hair systems from the emitter mesh");
+ ot->srna, "all", 0, "All Hair", "Disconnect all hair systems from the emitter mesh");
}
/* from/to_world_space : whether from/to particles are in world or hair space
@@ -981,7 +981,7 @@ void PARTICLE_OT_connect_hair(wmOperatorType *ot)
/* No REGISTER, redo does not work due to missing update, see T47750. */
ot->flag = OPTYPE_UNDO;
- RNA_def_boolean(ot->srna, "all", 0, "All hair", "Connect all hair systems to the emitter mesh");
+ RNA_def_boolean(ot->srna, "all", 0, "All Hair", "Connect all hair systems to the emitter mesh");
}
/************************ particle system copy operator *********************/
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c
index 27a1d4e4a50..6f80165ed3c 100644
--- a/source/blender/editors/screen/screen_ops.c
+++ b/source/blender/editors/screen/screen_ops.c
@@ -5523,8 +5523,8 @@ static void keymap_modal_set(wmKeyConfig *keyconf)
static const EnumPropertyItem modal_items[] = {
{KM_MODAL_CANCEL, "CANCEL", 0, "Cancel", ""},
{KM_MODAL_APPLY, "APPLY", 0, "Apply", ""},
- {KM_MODAL_SNAP_ON, "SNAP", 0, "Snap on", ""},
- {KM_MODAL_SNAP_OFF, "SNAP_OFF", 0, "Snap off", ""},
+ {KM_MODAL_SNAP_ON, "SNAP", 0, "Snap On", ""},
+ {KM_MODAL_SNAP_OFF, "SNAP_OFF", 0, "Snap Off", ""},
{0, NULL, 0, NULL, NULL},
};
diff --git a/source/blender/editors/sculpt_paint/paint_mask.c b/source/blender/editors/sculpt_paint/paint_mask.c
index 2193a31f19b..605cdfcbe9b 100644
--- a/source/blender/editors/sculpt_paint/paint_mask.c
+++ b/source/blender/editors/sculpt_paint/paint_mask.c
@@ -246,8 +246,16 @@ typedef struct LassoGestureData {
} LassoGestureData;
typedef struct LineGestureData {
+ /* Plane aligned to the gesture line. */
float true_plane[4];
float plane[4];
+
+ /* Planes to limit the action to the length of the gesture segment at both sides of the affected
+ * area. */
+ float side_plane[2][4];
+ float true_side_plane[2][4];
+ bool use_side_planes;
+
bool flip;
} LineGestureData;
@@ -320,6 +328,13 @@ static void sculpt_gesture_operator_properties(wmOperatorType *ot)
false,
"Front Faces Only",
"Affect only faces facing towards the view");
+
+ RNA_def_boolean(ot->srna,
+ "use_limit_to_segment",
+ false,
+ "Limit to Segment",
+ "Apply the gesture action only to the area that is contained within the "
+ "segement without extending its effect to the entire line");
}
static void sculpt_gesture_context_init_common(bContext *C,
@@ -332,6 +347,7 @@ static void sculpt_gesture_context_init_common(bContext *C,
/* Operator properties. */
sgcontext->front_faces_only = RNA_boolean_get(op->ptr, "use_front_faces_only");
+ sgcontext->line.use_side_planes = RNA_boolean_get(op->ptr, "use_limit_to_segment");
/* SculptSession */
sgcontext->ss = ob->sculpt;
@@ -448,6 +464,50 @@ static SculptGestureContext *sculpt_gesture_init_from_box(bContext *C, wmOperato
return sgcontext;
}
+static void sculpt_gesture_line_plane_from_tri(float *r_plane,
+ SculptGestureContext *sgcontext,
+ const bool flip,
+ const float p1[3],
+ const float p2[3],
+ const float p3[3])
+{
+ float normal[3];
+ normal_tri_v3(normal, p1, p2, p3);
+ mul_v3_mat3_m4v3(normal, sgcontext->vc.obact->imat, normal);
+ if (flip) {
+ mul_v3_fl(normal, -1.0f);
+ }
+ float plane_point_object_space[3];
+ mul_v3_m4v3(plane_point_object_space, sgcontext->vc.obact->imat, p1);
+ plane_from_point_normal_v3(r_plane, plane_point_object_space, normal);
+}
+
+/* Creates 4 points in the plane defined by the line and 2 extra points with an offset relative to
+ * this plane. */
+static void sculpt_gesture_line_calculate_plane_points(SculptGestureContext *sgcontext,
+ float line_points[2][2],
+ float r_plane_points[4][3],
+ float r_offset_plane_points[2][3])
+{
+ float depth_point[3];
+ add_v3_v3v3(depth_point, sgcontext->true_view_origin, sgcontext->true_view_normal);
+ ED_view3d_win_to_3d(
+ sgcontext->vc.v3d, sgcontext->vc.region, depth_point, line_points[0], r_plane_points[0]);
+ ED_view3d_win_to_3d(
+ sgcontext->vc.v3d, sgcontext->vc.region, depth_point, line_points[1], r_plane_points[3]);
+
+ madd_v3_v3v3fl(depth_point, sgcontext->true_view_origin, sgcontext->true_view_normal, 10.0f);
+ ED_view3d_win_to_3d(
+ sgcontext->vc.v3d, sgcontext->vc.region, depth_point, line_points[0], r_plane_points[1]);
+ ED_view3d_win_to_3d(
+ sgcontext->vc.v3d, sgcontext->vc.region, depth_point, line_points[1], r_plane_points[2]);
+
+ float normal[3];
+ normal_tri_v3(normal, r_plane_points[0], r_plane_points[1], r_plane_points[2]);
+ add_v3_v3v3(r_offset_plane_points[0], r_plane_points[0], normal);
+ add_v3_v3v3(r_offset_plane_points[1], r_plane_points[3], normal);
+}
+
static SculptGestureContext *sculpt_gesture_init_from_line(bContext *C, wmOperator *op)
{
SculptGestureContext *sgcontext = MEM_callocN(sizeof(SculptGestureContext),
@@ -464,36 +524,33 @@ static SculptGestureContext *sculpt_gesture_init_from_line(bContext *C, wmOperat
sgcontext->line.flip = RNA_boolean_get(op->ptr, "flip");
- float depth_point[3];
- float plane_points[3][3];
-
- /* Calculate a triangle in the line's plane. */
- add_v3_v3v3(depth_point, sgcontext->true_view_origin, sgcontext->true_view_normal);
- ED_view3d_win_to_3d(
- sgcontext->vc.v3d, sgcontext->vc.region, depth_point, line_points[0], plane_points[0]);
-
- madd_v3_v3v3fl(depth_point, sgcontext->true_view_origin, sgcontext->true_view_normal, 10.0f);
- ED_view3d_win_to_3d(
- sgcontext->vc.v3d, sgcontext->vc.region, depth_point, line_points[0], plane_points[1]);
- ED_view3d_win_to_3d(
- sgcontext->vc.v3d, sgcontext->vc.region, depth_point, line_points[1], plane_points[2]);
-
- /* Calculate final line plane and normal using the triangle. */
- float normal[3];
- normal_tri_v3(normal, plane_points[0], plane_points[1], plane_points[2]);
- if (!sgcontext->vc.rv3d->is_persp) {
- mul_v3_fl(normal, -1.0f);
- }
-
- /* Apply flip. */
- if (sgcontext->line.flip) {
- mul_v3_fl(normal, -1.0f);
- }
-
- mul_v3_mat3_m4v3(normal, sgcontext->vc.obact->imat, normal);
- float plane_point_object_space[3];
- mul_v3_m4v3(plane_point_object_space, sgcontext->vc.obact->imat, plane_points[0]);
- plane_from_point_normal_v3(sgcontext->line.true_plane, plane_point_object_space, normal);
+ float plane_points[4][3];
+ float offset_plane_points[2][3];
+ sculpt_gesture_line_calculate_plane_points(
+ sgcontext, line_points, plane_points, offset_plane_points);
+
+ /* Calculate line plane and normal. */
+ const bool flip = sgcontext->line.flip ^ !sgcontext->vc.rv3d->is_persp;
+ sculpt_gesture_line_plane_from_tri(sgcontext->line.true_plane,
+ sgcontext,
+ flip,
+ plane_points[0],
+ plane_points[1],
+ plane_points[2]);
+
+ /* Calculate the side planes. */
+ sculpt_gesture_line_plane_from_tri(sgcontext->line.true_side_plane[0],
+ sgcontext,
+ false,
+ plane_points[1],
+ plane_points[0],
+ offset_plane_points[0]);
+ sculpt_gesture_line_plane_from_tri(sgcontext->line.true_side_plane[1],
+ sgcontext,
+ false,
+ plane_points[3],
+ plane_points[2],
+ offset_plane_points[1]);
return sgcontext;
}
@@ -544,14 +601,20 @@ static void sculpt_gesture_flip_for_symmetry_pass(SculptGestureContext *sgcontex
flip_v3_v3(sgcontext->view_normal, sgcontext->true_view_normal, symmpass);
flip_v3_v3(sgcontext->view_origin, sgcontext->true_view_origin, symmpass);
flip_plane(sgcontext->line.plane, sgcontext->line.true_plane, symmpass);
+ flip_plane(sgcontext->line.side_plane[0], sgcontext->line.true_side_plane[0], symmpass);
+ flip_plane(sgcontext->line.side_plane[1], sgcontext->line.true_side_plane[1], symmpass);
}
static void sculpt_gesture_update_effected_nodes_by_line_plane(SculptGestureContext *sgcontext)
{
SculptSession *ss = sgcontext->ss;
- float clip_planes[1][4];
+ float clip_planes[3][4];
copy_v4_v4(clip_planes[0], sgcontext->line.plane);
- PBVHFrustumPlanes frustum = {.planes = clip_planes, .num_planes = 1};
+ copy_v4_v4(clip_planes[1], sgcontext->line.side_plane[0]);
+ copy_v4_v4(clip_planes[2], sgcontext->line.side_plane[1]);
+
+ const int num_planes = sgcontext->line.use_side_planes ? 3 : 1;
+ PBVHFrustumPlanes frustum = {.planes = clip_planes, .num_planes = num_planes};
BKE_pbvh_search_gather(ss->pbvh,
BKE_pbvh_node_frustum_contain_AABB,
&frustum,
@@ -630,6 +693,11 @@ static bool sculpt_gesture_is_vertex_effected(SculptGestureContext *sgcontext, P
case SCULPT_GESTURE_SHAPE_LASSO:
return sculpt_gesture_is_effected_lasso(sgcontext, vd->co);
case SCULPT_GESTURE_SHAPE_LINE:
+ if (sgcontext->line.use_side_planes) {
+ return plane_point_side_v3(sgcontext->line.plane, vd->co) > 0.0f &&
+ plane_point_side_v3(sgcontext->line.side_plane[0], vd->co) > 0.0f &&
+ plane_point_side_v3(sgcontext->line.side_plane[1], vd->co) > 0.0f;
+ }
return plane_point_side_v3(sgcontext->line.plane, vd->co) > 0.0f;
}
return false;
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index ae0d43bcf5c..76e5f8e7099 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -3805,20 +3805,33 @@ static void do_grab_brush_task_cb_ex(void *__restrict userdata,
ss, &test, data->brush->falloff_shape);
const int thread_id = BLI_task_parallel_thread_id(tls);
+ const bool grab_silhouette = brush->flag2 & BRUSH_GRAB_SILHOUETTE;
+
BKE_pbvh_vertex_iter_begin(ss->pbvh, data->nodes[n], vd, PBVH_ITER_UNIQUE)
{
SCULPT_orig_vert_data_update(&orig_data, &vd);
if (sculpt_brush_test_sq_fn(&test, orig_data.co)) {
- const float fade = bstrength * SCULPT_brush_strength_factor(ss,
- brush,
- orig_data.co,
- sqrtf(test.dist),
- orig_data.no,
- NULL,
- vd.mask ? *vd.mask : 0.0f,
- vd.index,
- thread_id);
+ float fade = bstrength * SCULPT_brush_strength_factor(ss,
+ brush,
+ orig_data.co,
+ sqrtf(test.dist),
+ orig_data.no,
+ NULL,
+ vd.mask ? *vd.mask : 0.0f,
+ vd.index,
+ thread_id);
+
+ if (grab_silhouette) {
+ float silhouette_test_dir[3];
+ normalize_v3_v3(silhouette_test_dir, grab_delta);
+ if (dot_v3v3(ss->cache->initial_normal, ss->cache->grab_delta) < 0.0f) {
+ mul_v3_fl(silhouette_test_dir, -1.0f);
+ }
+ float vno[3];
+ normal_short_to_float_v3(vno, orig_data.no);
+ fade *= max_ff(dot_v3v3(vno, silhouette_test_dir), 0.0f);
+ }
mul_v3_v3fl(proxy[vd.i], grab_delta, fade);
@@ -5666,15 +5679,11 @@ static void do_brush_action(Sculpt *sd, Object *ob, Brush *brush, UnifiedPaintSe
/* Check for unsupported features. */
PBVHType type = BKE_pbvh_type(ss->pbvh);
if (brush->sculpt_tool == SCULPT_TOOL_PAINT && type != PBVH_FACES) {
- if (!U.experimental.use_sculpt_vertex_colors) {
- return;
- }
+ return;
}
if (brush->sculpt_tool == SCULPT_TOOL_SMEAR && type != PBVH_FACES) {
- if (!U.experimental.use_sculpt_vertex_colors) {
- return;
- }
+ return;
}
/* Build a list of all nodes that are potentially within the brush's area of influence */
diff --git a/source/blender/editors/sculpt_paint/sculpt_cloth.c b/source/blender/editors/sculpt_paint/sculpt_cloth.c
index 67129d5da50..bcc73650195 100644
--- a/source/blender/editors/sculpt_paint/sculpt_cloth.c
+++ b/source/blender/editors/sculpt_paint/sculpt_cloth.c
@@ -326,6 +326,9 @@ static void do_cloth_brush_build_constraints_task_cb_ex(
* positions. */
const bool cloth_is_deform_brush = ss->cache != NULL && brush != NULL &&
SCULPT_is_cloth_deform_brush(brush);
+
+ const bool use_falloff_plane = brush->cloth_force_falloff_type ==
+ BRUSH_CLOTH_FORCE_FALLOFF_PLANE;
float radius_squared = 0.0f;
if (cloth_is_deform_brush) {
radius_squared = ss->cache->initial_radius * ss->cache->initial_radius;
@@ -380,12 +383,21 @@ static void do_cloth_brush_build_constraints_task_cb_ex(
if (brush && brush->sculpt_tool == SCULPT_TOOL_CLOTH) {
/* The cloth brush works by applying forces in most of its modes, but some of them require
* deformation coordinates to make the simulation stable. */
- if (brush->cloth_deform_type == BRUSH_CLOTH_DEFORM_GRAB && len_squared < radius_squared) {
- /* When the grab brush brush is used as part of the cloth brush, deformation constraints
- * are created with different strengths and only inside the radius of the brush. */
- const float fade = BKE_brush_curve_strength(brush, sqrtf(len_squared), ss->cache->radius);
- cloth_brush_add_deformation_constraint(
- data->cloth_sim, node_index, vd.index, fade * CLOTH_DEFORMATION_GRAB_STRENGTH);
+ if (brush->cloth_deform_type == BRUSH_CLOTH_DEFORM_GRAB) {
+ if (use_falloff_plane) {
+ /* With plane falloff the strength of the constraints is set when applying the
+ * deformation forces. */
+ cloth_brush_add_deformation_constraint(
+ data->cloth_sim, node_index, vd.index, CLOTH_DEFORMATION_GRAB_STRENGTH);
+ }
+ else if (len_squared < radius_squared) {
+ /* With radial falloff deformation constraints are created with different strengths and
+ * only inside the radius of the brush. */
+ const float fade = BKE_brush_curve_strength(
+ brush, sqrtf(len_squared), ss->cache->radius);
+ cloth_brush_add_deformation_constraint(
+ data->cloth_sim, node_index, vd.index, fade * CLOTH_DEFORMATION_GRAB_STRENGTH);
+ }
}
else if (brush->cloth_deform_type == BRUSH_CLOTH_DEFORM_SNAKE_HOOK) {
/* Cloth Snake Hook creates deformation constraint with fixed strength because the strength
@@ -436,9 +448,8 @@ static void do_cloth_brush_apply_forces_task_cb_ex(void *__restrict userdata,
const float *grab_delta = data->grab_delta;
float(*imat)[4] = data->mat;
- const bool use_falloff_plane = !SCULPT_is_cloth_deform_brush(brush) &&
- brush->cloth_force_falloff_type ==
- BRUSH_CLOTH_FORCE_FALLOFF_PLANE;
+ const bool use_falloff_plane = brush->cloth_force_falloff_type ==
+ BRUSH_CLOTH_FORCE_FALLOFF_PLANE;
PBVHVertexIter vd;
const float bstrength = ss->cache->bstrength;
@@ -470,12 +481,6 @@ static void do_cloth_brush_apply_forces_task_cb_ex(void *__restrict userdata,
madd_v3_v3fl(gravity, ss->cache->gravity_direction, -data->sd->gravity_factor);
}
- /* Original data for deform brushes. */
- SculptOrigVertData orig_data;
- if (SCULPT_is_cloth_deform_brush(brush)) {
- SCULPT_orig_vert_data_init(&orig_data, data->ob, data->nodes[n]);
- }
-
BKE_pbvh_vertex_iter_begin(ss->pbvh, data->nodes[n], vd, PBVH_ITER_UNIQUE)
{
float force[3];
@@ -486,8 +491,7 @@ static void do_cloth_brush_apply_forces_task_cb_ex(void *__restrict userdata,
float current_vertex_location[3];
if (brush->cloth_deform_type == BRUSH_CLOTH_DEFORM_GRAB) {
- SCULPT_orig_vert_data_update(&orig_data, &vd);
- copy_v3_v3(current_vertex_location, orig_data.co);
+ copy_v3_v3(current_vertex_location, ss->cache->cloth_sim->init_pos[vd.index]);
}
else {
copy_v3_v3(current_vertex_location, vd.co);
@@ -504,7 +508,7 @@ static void do_cloth_brush_apply_forces_task_cb_ex(void *__restrict userdata,
float dist = sqrtf(test.dist);
if (use_falloff_plane) {
- dist = dist_to_plane_v3(vd.co, deform_plane);
+ dist = dist_to_plane_v3(current_vertex_location, deform_plane);
}
const float fade = sim_factor * bstrength *
@@ -539,9 +543,15 @@ static void do_cloth_brush_apply_forces_task_cb_ex(void *__restrict userdata,
break;
case BRUSH_CLOTH_DEFORM_GRAB:
madd_v3_v3v3fl(cloth_sim->deformation_pos[vd.index],
- orig_data.co,
+ cloth_sim->init_pos[vd.index],
ss->cache->grab_delta_symmetry,
fade);
+ if (use_falloff_plane) {
+ cloth_sim->deformation_strength[vd.index] = clamp_f(fade, 0.0f, 1.0f);
+ }
+ else {
+ cloth_sim->deformation_strength[vd.index] = 1.0f;
+ }
zero_v3(force);
break;
case BRUSH_CLOTH_DEFORM_SNAKE_HOOK:
@@ -965,8 +975,8 @@ static void cloth_brush_apply_brush_foces(Sculpt *sd, Object *ob, PBVHNode **nod
}
}
- if (brush->cloth_deform_type == BRUSH_CLOTH_DEFORM_SNAKE_HOOK) {
- /* Set the deformation strength to 0. Snake hook will initialize the strength in the required
+ if (ELEM(brush->cloth_deform_type, BRUSH_CLOTH_DEFORM_SNAKE_HOOK, BRUSH_CLOTH_DEFORM_GRAB)) {
+ /* Set the deformation strength to 0. Brushes will initialize the strength in the required
* area. */
const int totverts = SCULPT_vertex_count_get(ss);
for (int i = 0; i < totverts; i++) {
@@ -1253,9 +1263,14 @@ void SCULPT_cloth_plane_falloff_preview_draw(const uint gpuattr,
const float outline_col[3],
float outline_alpha)
{
- float local_mat_inv[4][4];
- invert_m4_m4(local_mat_inv, ss->cache->stroke_local_mat);
- GPU_matrix_mul(ss->cache->stroke_local_mat);
+ float local_mat[4][4];
+ copy_m4_m4(local_mat, ss->cache->stroke_local_mat);
+
+ if (ss->cache->brush->cloth_deform_type == BRUSH_CLOTH_DEFORM_GRAB) {
+ add_v3_v3v3(local_mat[3], ss->cache->true_location, ss->cache->grab_delta);
+ }
+
+ GPU_matrix_mul(local_mat);
const float dist = ss->cache->radius;
const float arrow_x = ss->cache->radius * 0.2f;
diff --git a/source/blender/editors/sculpt_paint/sculpt_face_set.c b/source/blender/editors/sculpt_paint/sculpt_face_set.c
index af6a06caf69..3c87407b2db 100644
--- a/source/blender/editors/sculpt_paint/sculpt_face_set.c
+++ b/source/blender/editors/sculpt_paint/sculpt_face_set.c
@@ -1018,6 +1018,7 @@ void SCULPT_OT_face_sets_randomize_colors(wmOperatorType *ot)
typedef enum eSculptFaceSetEditMode {
SCULPT_FACE_SET_EDIT_GROW = 0,
SCULPT_FACE_SET_EDIT_SHRINK = 1,
+ SCULPT_FACE_SET_EDIT_DELETE_GEOMETRY = 2,
} eSculptFaceSetEditMode;
static EnumPropertyItem prop_sculpt_face_sets_edit_types[] = {
@@ -1035,6 +1036,13 @@ static EnumPropertyItem prop_sculpt_face_sets_edit_types[] = {
"Shrink Face Set",
"Shrinks the Face Sets boundary by one face based on mesh topology",
},
+ {
+ SCULPT_FACE_SET_EDIT_DELETE_GEOMETRY,
+ "DELETE_GEOMETRY",
+ 0,
+ "Delete Geometry",
+ "Deletes the faces that are assigned to the Face Set",
+ },
{0, NULL, 0, NULL, NULL},
};
@@ -1096,6 +1104,78 @@ static void sculpt_face_set_shrink(Object *ob,
}
}
+static bool check_single_face_set(SculptSession *ss, int *face_sets, const bool check_visible_only)
+{
+
+ int first_face_set = SCULPT_FACE_SET_NONE;
+ if (check_visible_only) {
+ for (int f = 0; f < ss->totfaces; f++) {
+ if (face_sets[f] > 0) {
+ first_face_set = face_sets[f];
+ break;
+ }
+ }
+ }
+ else {
+ first_face_set = abs(face_sets[0]);
+ }
+
+ if (first_face_set == SCULPT_FACE_SET_NONE) {
+ return true;
+ }
+
+ for (int f = 0; f < ss->totfaces; f++) {
+ const int face_set_id = check_visible_only ? face_sets[f] : abs(face_sets[f]);
+ if (face_set_id != first_face_set) {
+ return false;
+ }
+ }
+ return true;
+}
+
+static void sculpt_face_set_delete_geometry(Object *ob,
+ SculptSession *ss,
+ const int active_face_set_id,
+ const bool modify_hidden)
+{
+
+ Mesh *mesh = ob->data;
+ const BMAllocTemplate allocsize = BMALLOC_TEMPLATE_FROM_ME(mesh);
+ BMesh *bm = BM_mesh_create(&allocsize,
+ &((struct BMeshCreateParams){
+ .use_toolflags = true,
+ }));
+
+ BM_mesh_bm_from_me(bm,
+ mesh,
+ (&(struct BMeshFromMeshParams){
+ .calc_face_normal = true,
+ }));
+
+ BM_mesh_elem_table_init(bm, BM_FACE);
+ BM_mesh_elem_table_ensure(bm, BM_FACE);
+ BM_mesh_elem_hflag_disable_all(bm, BM_VERT | BM_EDGE | BM_FACE, BM_ELEM_TAG, false);
+ BMIter iter;
+ BMFace *f;
+ BM_ITER_MESH (f, &iter, bm, BM_FACES_OF_MESH) {
+ const int face_index = BM_elem_index_get(f);
+ const int face_set_id = modify_hidden ? abs(ss->face_sets[face_index]) :
+ ss->face_sets[face_index];
+ BM_elem_flag_set(f, BM_ELEM_TAG, face_set_id == active_face_set_id);
+ }
+ BM_mesh_delete_hflag_context(bm, BM_ELEM_TAG, DEL_FACES);
+ BM_mesh_elem_hflag_disable_all(bm, BM_VERT | BM_EDGE | BM_FACE, BM_ELEM_TAG, false);
+
+ BM_mesh_bm_to_me(NULL,
+ bm,
+ ob->data,
+ (&(struct BMeshToMeshParams){
+ .calc_object_remap = false,
+ }));
+
+ BM_mesh_free(bm);
+}
+
static void sculpt_face_set_apply_edit(Object *ob,
const int active_face_set_id,
const int mode,
@@ -1103,80 +1183,135 @@ static void sculpt_face_set_apply_edit(Object *ob,
{
SculptSession *ss = ob->sculpt;
- int *prev_face_sets = MEM_dupallocN(ss->face_sets);
-
switch (mode) {
- case SCULPT_FACE_SET_EDIT_GROW:
+ case SCULPT_FACE_SET_EDIT_GROW: {
+ int *prev_face_sets = MEM_dupallocN(ss->face_sets);
sculpt_face_set_grow(ob, ss, prev_face_sets, active_face_set_id, modify_hidden);
+ MEM_SAFE_FREE(prev_face_sets);
break;
- case SCULPT_FACE_SET_EDIT_SHRINK:
+ }
+ case SCULPT_FACE_SET_EDIT_SHRINK: {
+ int *prev_face_sets = MEM_dupallocN(ss->face_sets);
sculpt_face_set_shrink(ob, ss, prev_face_sets, active_face_set_id, modify_hidden);
+ MEM_SAFE_FREE(prev_face_sets);
+ break;
+ }
+ case SCULPT_FACE_SET_EDIT_DELETE_GEOMETRY:
+ sculpt_face_set_delete_geometry(ob, ss, active_face_set_id, modify_hidden);
break;
}
-
- MEM_SAFE_FREE(prev_face_sets);
}
-static int sculpt_face_set_edit_invoke(bContext *C, wmOperator *op, const wmEvent *event)
+static bool sculpt_face_set_edit_is_operation_valid(SculptSession *ss,
+ const eSculptFaceSetEditMode mode,
+ const bool modify_hidden)
{
- Object *ob = CTX_data_active_object(C);
- SculptSession *ss = ob->sculpt;
- Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C);
-
- const int mode = RNA_enum_get(op->ptr, "mode");
-
- /* Dyntopo not supported. */
if (BKE_pbvh_type(ss->pbvh) == PBVH_BMESH) {
+ /* Dyntopo is not supported. */
return OPERATOR_CANCELLED;
}
- /* Ignore other events to avoid repeated operations. */
- if (event->val != KM_PRESS) {
- return OPERATOR_CANCELLED;
+ if (mode == SCULPT_FACE_SET_EDIT_DELETE_GEOMETRY) {
+ if (BKE_pbvh_type(ss->pbvh) == PBVH_GRIDS) {
+ /* Modification of base mesh geometry requires special remapping of multires displacement,
+ * which does not happen here.
+ * Disable delete operation. It can be supported in the future by doing similar displacement
+ * data remapping as what happens in the mesh edit mode. */
+ return false;
+ }
+ if (check_single_face_set(ss, ss->face_sets, !modify_hidden)) {
+ /* Cancel the operator if the mesh only contains one Face Set to avoid deleting the
+ * entire object. */
+ return false;
+ }
}
+ return true;
+}
- BKE_sculpt_update_object_for_edit(depsgraph, ob, true, false, false);
+static void sculpt_face_set_edit_modify_geometry(bContext *C,
+ Object *ob,
+ const int active_face_set,
+ const eSculptFaceSetEditMode mode,
+ const bool modify_hidden)
+{
+ ED_sculpt_undo_geometry_begin(ob, "edit face set delete geometry");
+ sculpt_face_set_apply_edit(ob, abs(active_face_set), mode, modify_hidden);
+ ED_sculpt_undo_geometry_end(ob);
+ BKE_mesh_batch_cache_dirty_tag(ob->data, BKE_MESH_BATCH_DIRTY_ALL);
+ DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY);
+ WM_event_add_notifier(C, NC_GEOM | ND_DATA, ob->data);
+}
- /* Update the current active Face Set and Vertex as the operator can be used directly from the
- * tool without brush cursor. */
- SculptCursorGeometryInfo sgi;
- float mouse[2];
- mouse[0] = event->mval[0];
- mouse[1] = event->mval[1];
- SCULPT_cursor_geometry_info_update(C, &sgi, mouse, false);
+static void face_set_edit_do_post_visibility_updates(Object *ob, PBVHNode **nodes, int totnode)
+{
+ SculptSession *ss = ob->sculpt;
+ PBVH *pbvh = ss->pbvh;
+
+ /* Sync face sets visibility and vertex visibility as now all Face Sets are visible. */
+ SCULPT_visibility_sync_all_face_sets_to_vertices(ob);
+
+ for (int i = 0; i < totnode; i++) {
+ BKE_pbvh_node_mark_update_visibility(nodes[i]);
+ }
+
+ BKE_pbvh_update_vertex_data(ss->pbvh, PBVH_UpdateVisibility);
+
+ if (BKE_pbvh_type(pbvh) == PBVH_FACES) {
+ BKE_mesh_flush_hidden_from_verts(ob->data);
+ }
+}
+static void sculpt_face_set_edit_modify_face_sets(Object *ob,
+ const int active_face_set,
+ const eSculptFaceSetEditMode mode,
+ const bool modify_hidden)
+{
PBVH *pbvh = ob->sculpt->pbvh;
PBVHNode **nodes;
int totnode;
BKE_pbvh_search_gather(pbvh, NULL, NULL, &nodes, &totnode);
if (!nodes) {
- return OPERATOR_CANCELLED;
+ return;
}
-
SCULPT_undo_push_begin("face set edit");
SCULPT_undo_push_node(ob, nodes[0], SCULPT_UNDO_FACE_SETS);
-
- const int active_face_set = SCULPT_active_face_set_get(ss);
- const bool modify_hidden = RNA_boolean_get(op->ptr, "modify_hidden");
-
sculpt_face_set_apply_edit(ob, abs(active_face_set), mode, modify_hidden);
-
SCULPT_undo_push_end();
+ face_set_edit_do_post_visibility_updates(ob, nodes, totnode);
+ MEM_freeN(nodes);
+}
- /* Sync face sets visibility and vertex visibility as now all Face Sets are visible. */
- SCULPT_visibility_sync_all_face_sets_to_vertices(ob);
+static int sculpt_face_set_edit_invoke(bContext *C, wmOperator *op, const wmEvent *event)
+{
+ Object *ob = CTX_data_active_object(C);
+ SculptSession *ss = ob->sculpt;
+ Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C);
- for (int i = 0; i < totnode; i++) {
- BKE_pbvh_node_mark_update_visibility(nodes[i]);
+ const int mode = RNA_enum_get(op->ptr, "mode");
+ const bool modify_hidden = RNA_boolean_get(op->ptr, "modify_hidden");
+
+ if (!sculpt_face_set_edit_is_operation_valid(ss, mode, modify_hidden)) {
+ return OPERATOR_CANCELLED;
}
- BKE_pbvh_update_vertex_data(ss->pbvh, PBVH_UpdateVisibility);
+ BKE_sculpt_update_object_for_edit(depsgraph, ob, true, false, false);
- MEM_SAFE_FREE(nodes);
+ /* Update the current active Face Set and Vertex as the operator can be used directly from the
+ * tool without brush cursor. */
+ SculptCursorGeometryInfo sgi;
+ const float mouse[2] = {event->mval[0], event->mval[1]};
+ SCULPT_cursor_geometry_info_update(C, &sgi, mouse, false);
+ const int active_face_set = SCULPT_active_face_set_get(ss);
- if (BKE_pbvh_type(pbvh) == PBVH_FACES) {
- BKE_mesh_flush_hidden_from_verts(ob->data);
+ switch (mode) {
+ case SCULPT_FACE_SET_EDIT_DELETE_GEOMETRY:
+ sculpt_face_set_edit_modify_geometry(C, ob, active_face_set, mode, modify_hidden);
+ break;
+ case SCULPT_FACE_SET_EDIT_GROW:
+ case SCULPT_FACE_SET_EDIT_SHRINK:
+ sculpt_face_set_edit_modify_face_sets(ob, active_face_set, mode, modify_hidden);
+ break;
}
SCULPT_tag_update_overlays(C);
diff --git a/source/blender/editors/space_clip/tracking_ops.c b/source/blender/editors/space_clip/tracking_ops.c
index 0631b6ea8a0..4d3e6cf4d6a 100644
--- a/source/blender/editors/space_clip/tracking_ops.c
+++ b/source/blender/editors/space_clip/tracking_ops.c
@@ -1043,13 +1043,13 @@ static int clear_track_path_exec(bContext *C, wmOperator *op)
void CLIP_OT_clear_track_path(wmOperatorType *ot)
{
static const EnumPropertyItem clear_path_actions[] = {
- {TRACK_CLEAR_UPTO, "UPTO", 0, "Clear up-to", "Clear path up to current frame"},
+ {TRACK_CLEAR_UPTO, "UPTO", 0, "Clear Up To", "Clear path up to current frame"},
{TRACK_CLEAR_REMAINED,
"REMAINED",
0,
- "Clear remained",
+ "Clear Remained",
"Clear path at remaining frames (after current)"},
- {TRACK_CLEAR_ALL, "ALL", 0, "Clear all", "Clear the whole path"},
+ {TRACK_CLEAR_ALL, "ALL", 0, "Clear All", "Clear the whole path"},
{0, NULL, 0, NULL, NULL},
};
diff --git a/source/blender/editors/space_clip/tracking_select.c b/source/blender/editors/space_clip/tracking_select.c
index 478d22c7582..063ea9592aa 100644
--- a/source/blender/editors/space_clip/tracking_select.c
+++ b/source/blender/editors/space_clip/tracking_select.c
@@ -975,15 +975,15 @@ static int select_grouped_exec(bContext *C, wmOperator *op)
void CLIP_OT_select_grouped(wmOperatorType *ot)
{
static const EnumPropertyItem select_group_items[] = {
- {0, "KEYFRAMED", 0, "Keyframed tracks", "Select all keyframed tracks"},
- {1, "ESTIMATED", 0, "Estimated tracks", "Select all estimated tracks"},
- {2, "TRACKED", 0, "Tracked tracks", "Select all tracked tracks"},
- {3, "LOCKED", 0, "Locked tracks", "Select all locked tracks"},
- {4, "DISABLED", 0, "Disabled tracks", "Select all disabled tracks"},
+ {0, "KEYFRAMED", 0, "Keyframed Tracks", "Select all keyframed tracks"},
+ {1, "ESTIMATED", 0, "Estimated Tracks", "Select all estimated tracks"},
+ {2, "TRACKED", 0, "Tracked Tracks", "Select all tracked tracks"},
+ {3, "LOCKED", 0, "Locked Tracks", "Select all locked tracks"},
+ {4, "DISABLED", 0, "Disabled Tracks", "Select all disabled tracks"},
{5,
"COLOR",
0,
- "Tracks with same color",
+ "Tracks with Same Color",
"Select all tracks with same color as active track"},
{6, "FAILED", 0, "Failed Tracks", "Select all tracks which failed to be reconstructed"},
{0, NULL, 0, NULL, NULL},
diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c
index 91653fb7785..7cfd749d013 100644
--- a/source/blender/editors/space_file/file_ops.c
+++ b/source/blender/editors/space_file/file_ops.c
@@ -2415,7 +2415,8 @@ void file_directory_enter_handle(bContext *C, void *UNUSED(arg_unused), void *UN
WM_operator_properties_create_ptr(&ptr, ot);
RNA_string_set(&ptr, "directory", sfile->params->dir);
RNA_boolean_set(&ptr, "open", true);
- /* Enable confirmation prompt, else it's too easy to accidentally create new directories. */
+ /* Enable confirmation prompt, else it's too easy
+ * to accidentally create new directories. */
RNA_boolean_set(&ptr, "confirm", true);
if (lastdir) {
diff --git a/source/blender/editors/space_file/fsmenu.c b/source/blender/editors/space_file/fsmenu.c
index 329b5fe67fd..b7d47902fe8 100644
--- a/source/blender/editors/space_file/fsmenu.c
+++ b/source/blender/editors/space_file/fsmenu.c
@@ -203,7 +203,7 @@ static void fsmenu_xdg_insert_entry(GHash *xdg_map,
xdg_path = xdg_path_buf;
}
fsmenu_insert_entry(
- fsmenu, FS_CATEGORY_SYSTEM_BOOKMARKS, xdg_path, IFACE_(default_path), icon, FS_INSERT_LAST);
+ fsmenu, FS_CATEGORY_SYSTEM_BOOKMARKS, xdg_path, N_(default_path), icon, FS_INSERT_LAST);
}
/** \} */
@@ -698,49 +698,49 @@ void fsmenu_read_system(struct FSMenu *fsmenu, int read_bookmarks)
fsmenu_add_windows_folder(fsmenu,
FS_CATEGORY_SYSTEM_BOOKMARKS,
&FOLDERID_Profile,
- IFACE_("Home"),
+ N_("Home"),
ICON_HOME,
FS_INSERT_LAST);
fsmenu_add_windows_folder(fsmenu,
FS_CATEGORY_SYSTEM_BOOKMARKS,
&FOLDERID_Desktop,
- IFACE_("Desktop"),
+ N_("Desktop"),
ICON_DESKTOP,
FS_INSERT_LAST);
fsmenu_add_windows_folder(fsmenu,
FS_CATEGORY_SYSTEM_BOOKMARKS,
&FOLDERID_Documents,
- IFACE_("Documents"),
+ N_("Documents"),
ICON_DOCUMENTS,
FS_INSERT_LAST);
fsmenu_add_windows_folder(fsmenu,
FS_CATEGORY_SYSTEM_BOOKMARKS,
&FOLDERID_Downloads,
- IFACE_("Downloads"),
+ N_("Downloads"),
ICON_IMPORT,
FS_INSERT_LAST);
fsmenu_add_windows_folder(fsmenu,
FS_CATEGORY_SYSTEM_BOOKMARKS,
&FOLDERID_Music,
- IFACE_("Music"),
+ N_("Music"),
ICON_FILE_SOUND,
FS_INSERT_LAST);
fsmenu_add_windows_folder(fsmenu,
FS_CATEGORY_SYSTEM_BOOKMARKS,
&FOLDERID_Pictures,
- IFACE_("Pictures"),
+ N_("Pictures"),
ICON_FILE_IMAGE,
FS_INSERT_LAST);
fsmenu_add_windows_folder(fsmenu,
FS_CATEGORY_SYSTEM_BOOKMARKS,
&FOLDERID_Videos,
- IFACE_("Videos"),
+ N_("Videos"),
ICON_FILE_MOVIE,
FS_INSERT_LAST);
fsmenu_add_windows_folder(fsmenu,
FS_CATEGORY_SYSTEM_BOOKMARKS,
&FOLDERID_Fonts,
- IFACE_("Fonts"),
+ N_("Fonts"),
ICON_FILE_FONT,
FS_INSERT_LAST);
@@ -757,16 +757,12 @@ void fsmenu_read_system(struct FSMenu *fsmenu, int read_bookmarks)
{
/* We store some known macOS system paths and corresponding icons
* and names in the FS_CATEGORY_OTHER (not displayed directly) category. */
- fsmenu_insert_entry(fsmenu,
- FS_CATEGORY_OTHER,
- "/Library/Fonts/",
- IFACE_("Fonts"),
- ICON_FILE_FONT,
- FS_INSERT_LAST);
+ fsmenu_insert_entry(
+ fsmenu, FS_CATEGORY_OTHER, "/Library/Fonts/", N_("Fonts"), ICON_FILE_FONT, FS_INSERT_LAST);
fsmenu_insert_entry(fsmenu,
FS_CATEGORY_OTHER,
"/Applications/",
- IFACE_("Applications"),
+ N_("Applications"),
ICON_FILE_FOLDER,
FS_INSERT_LAST);
@@ -777,13 +773,13 @@ void fsmenu_read_system(struct FSMenu *fsmenu, int read_bookmarks)
fsmenu_insert_entry(fsmenu, FS_CATEGORY_OTHER, line, name, icon, FS_INSERT_LAST);
FS_MACOS_PATH("%s/", NULL, ICON_HOME)
- FS_MACOS_PATH("%s/Desktop/", IFACE_("Desktop"), ICON_DESKTOP)
- FS_MACOS_PATH("%s/Documents/", IFACE_("Documents"), ICON_DOCUMENTS)
- FS_MACOS_PATH("%s/Downloads/", IFACE_("Downloads"), ICON_IMPORT)
- FS_MACOS_PATH("%s/Movies/", IFACE_("Movies"), ICON_FILE_MOVIE)
- FS_MACOS_PATH("%s/Music/", IFACE_("Music"), ICON_FILE_SOUND)
- FS_MACOS_PATH("%s/Pictures/", IFACE_("Pictures"), ICON_FILE_IMAGE)
- FS_MACOS_PATH("%s/Library/Fonts/", IFACE_("Fonts"), ICON_FILE_FONT)
+ FS_MACOS_PATH("%s/Desktop/", N_("Desktop"), ICON_DESKTOP)
+ FS_MACOS_PATH("%s/Documents/", N_("Documents"), ICON_DOCUMENTS)
+ FS_MACOS_PATH("%s/Downloads/", N_("Downloads"), ICON_IMPORT)
+ FS_MACOS_PATH("%s/Movies/", N_("Movies"), ICON_FILE_MOVIE)
+ FS_MACOS_PATH("%s/Music/", N_("Music"), ICON_FILE_SOUND)
+ FS_MACOS_PATH("%s/Pictures/", N_("Pictures"), ICON_FILE_IMAGE)
+ FS_MACOS_PATH("%s/Library/Fonts/", N_("Fonts"), ICON_FILE_FONT)
# undef FS_MACOS_PATH
@@ -902,7 +898,7 @@ void fsmenu_read_system(struct FSMenu *fsmenu, int read_bookmarks)
if (read_bookmarks && home) {
fsmenu_insert_entry(
- fsmenu, FS_CATEGORY_SYSTEM_BOOKMARKS, home, IFACE_("Home"), ICON_HOME, FS_INSERT_LAST);
+ fsmenu, FS_CATEGORY_SYSTEM_BOOKMARKS, home, N_("Home"), ICON_HOME, FS_INSERT_LAST);
/* Follow the XDG spec, check if these are available. */
GHash *xdg_map = fsmenu_xdg_user_dirs_parse(home);
diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c
index d430e331b6c..2e33f3ef4c7 100644
--- a/source/blender/editors/space_graph/graph_draw.c
+++ b/source/blender/editors/space_graph/graph_draw.c
@@ -321,10 +321,12 @@ static void draw_fcurve_active_handle_vertices(const FCurve *fcu,
immUniformColor3fvAlpha(active_col, 0.01f); /* Almost invisible - only keep for smoothness. */
immBeginAtMost(GPU_PRIM_POINTS, 2);
- if ((bezt->f1 & SELECT)) {
+ const BezTriple *left_bezt = active_keyframe_index > 0 ? &fcu->bezt[active_keyframe_index - 1] :
+ bezt;
+ if (left_bezt->ipo == BEZT_IPO_BEZ && (bezt->f1 & SELECT)) {
immVertex2fv(pos, bezt->vec[0]);
}
- if ((bezt->f3 & SELECT)) {
+ if (bezt->ipo == BEZT_IPO_BEZ && (bezt->f3 & SELECT)) {
immVertex2fv(pos, bezt->vec[2]);
}
immEnd();
diff --git a/source/blender/editors/space_graph/graph_select.c b/source/blender/editors/space_graph/graph_select.c
index df89a4ff725..57aaa1fefce 100644
--- a/source/blender/editors/space_graph/graph_select.c
+++ b/source/blender/editors/space_graph/graph_select.c
@@ -1481,6 +1481,7 @@ static int mouse_graph_keys(bAnimContext *ac,
/* if points can be selected on this F-Curve */
/* TODO: what about those with no keyframes? */
+ bool something_was_selected = false;
if (!curves_only && ((nvi->fcu->flag & FCURVE_PROTECTED) == 0)) {
/* only if there's keyframe */
if (nvi->bezt) {
@@ -1488,14 +1489,17 @@ static int mouse_graph_keys(bAnimContext *ac,
if (select_mode == SELECT_INVERT) {
if (nvi->hpoint == NEAREST_HANDLE_KEY) {
bezt->f2 ^= SELECT;
+ something_was_selected = (bezt->f2 & SELECT);
}
else if (nvi->hpoint == NEAREST_HANDLE_LEFT) {
/* toggle selection */
bezt->f1 ^= SELECT;
+ something_was_selected = (bezt->f1 & SELECT);
}
else {
/* toggle selection */
bezt->f3 ^= SELECT;
+ something_was_selected = (bezt->f3 & SELECT);
}
}
else {
@@ -1508,6 +1512,7 @@ static int mouse_graph_keys(bAnimContext *ac,
else {
bezt->f3 |= SELECT;
}
+ something_was_selected = true;
}
if (!run_modal && BEZT_ISSEL_ANY(bezt) && !already_selected) {
@@ -1558,10 +1563,10 @@ static int mouse_graph_keys(bAnimContext *ac,
}
}
- /* Set active F-Curve, except when dragging the selected keys.
- * needs to be called with (sipo->flag & SIPO_SELCUVERTSONLY)
+ /* Set active F-Curve when something was actually selected (so not on a deselect), except when
+ * dragging the selected keys. Needs to be called with (sipo->flag & SIPO_SELCUVERTSONLY),
* otherwise the active flag won't be set T26452. */
- if (!run_modal && nvi->fcu->flag & FCURVE_SELECTED) {
+ if (!run_modal && (nvi->fcu->flag & FCURVE_SELECTED) && something_was_selected) {
/* NOTE: Sync the filter flags with findnearest_fcurve_vert. */
int filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_CURVE_VISIBLE | ANIMFILTER_NODUPLIS);
ANIM_set_active_channel(ac, ac->data, ac->datatype, filter, nvi->fcu, nvi->ctype);
diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c
index 8a705ef49dd..9554608ea7c 100644
--- a/source/blender/editors/space_sequencer/sequencer_edit.c
+++ b/source/blender/editors/space_sequencer/sequencer_edit.c
@@ -97,11 +97,11 @@ EnumPropertyItem sequencer_prop_effect_types[] = {
#define SEQ_SIDE_MOUSE -1
EnumPropertyItem prop_side_types[] = {
- {SEQ_SIDE_MOUSE, "MOUSE", 0, "Mouse position", ""},
+ {SEQ_SIDE_MOUSE, "MOUSE", 0, "Mouse Position", ""},
{SEQ_SIDE_LEFT, "LEFT", 0, "Left", ""},
{SEQ_SIDE_RIGHT, "RIGHT", 0, "Right", ""},
{SEQ_SIDE_BOTH, "BOTH", 0, "Both", ""},
- {SEQ_SIDE_NO_CHANGE, "NO_CHANGE", 0, "No change", ""},
+ {SEQ_SIDE_NO_CHANGE, "NO_CHANGE", 0, "No Change", ""},
{0, NULL, 0, NULL, NULL},
};
diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c
index 5c7f84ea386..3c3b11f0786 100644
--- a/source/blender/editors/space_text/text_ops.c
+++ b/source/blender/editors/space_text/text_ops.c
@@ -409,7 +409,7 @@ void TEXT_OT_open(wmOperatorType *ot)
FILE_DEFAULTDISPLAY,
FILE_SORT_ALPHA); /* TODO: relative_path. */
RNA_def_boolean(
- ot->srna, "internal", 0, "Make internal", "Make text file internal after loading");
+ ot->srna, "internal", 0, "Make Internal", "Make text file internal after loading");
}
/** \} */
@@ -3693,7 +3693,7 @@ void TEXT_OT_replace(wmOperatorType *ot)
/* properties */
PropertyRNA *prop;
- prop = RNA_def_boolean(ot->srna, "all", false, "Replace all", "Replace all occurrences");
+ prop = RNA_def_boolean(ot->srna, "all", false, "Replace All", "Replace all occurrences");
RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
}
diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c
index 8e03ed6e11d..f67eb73bbd1 100644
--- a/source/blender/editors/space_view3d/view3d_buttons.c
+++ b/source/blender/editors/space_view3d/view3d_buttons.c
@@ -283,7 +283,6 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
else if (ob->type == OB_CURVE || ob->type == OB_SURF) {
TransformMedian_Curve *median = &median_basis.curve;
Curve *cu = ob->data;
- Nurb *nu;
BPoint *bp;
BezTriple *bezt;
int a;
@@ -291,8 +290,7 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
StructRNA *seltype = NULL;
void *selp = NULL;
- nu = nurbs->first;
- while (nu) {
+ LISTBASE_FOREACH (Nurb *, nu, nurbs) {
if (nu->type == CU_BEZIER) {
bezt = nu->bezt;
a = nu->pntsu;
@@ -343,7 +341,6 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
bp++;
}
}
- nu = nu->next;
}
if (totcurvedata == 1) {
@@ -973,15 +970,13 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
const TransformMedian_Curve *median = &median_basis.curve,
*ve_median = &ve_median_basis.curve;
Curve *cu = ob->data;
- Nurb *nu;
BPoint *bp;
BezTriple *bezt;
int a;
ListBase *nurbs = BKE_curve_editNurbs_get(cu);
const float scale_w = compute_scale_factor(ve_median->weight, median->weight);
- nu = nurbs->first;
- while (nu) {
+ LISTBASE_FOREACH (Nurb *, nu, nurbs) {
if (nu->type == CU_BEZIER) {
for (a = nu->pntsu, bezt = nu->bezt; a--; bezt++) {
if (bezt->f2 & SELECT) {
@@ -1038,8 +1033,6 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
}
BKE_nurb_test_2d(nu);
BKE_nurb_handles_test(nu, true, false); /* test for bezier too */
-
- nu = nu->next;
}
}
else if ((ob->type == OB_LATTICE) && (apply_vcos || median_basis.lattice.weight)) {
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index 4e08b6b1c5d..1b1740cd5bc 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -646,12 +646,12 @@ wmKeyMap *transform_modal_keymap(wmKeyConfig *keyconf)
static const EnumPropertyItem modal_items[] = {
{TFM_MODAL_CONFIRM, "CONFIRM", 0, "Confirm", ""},
{TFM_MODAL_CANCEL, "CANCEL", 0, "Cancel", ""},
- {TFM_MODAL_AXIS_X, "AXIS_X", 0, "X axis", ""},
- {TFM_MODAL_AXIS_Y, "AXIS_Y", 0, "Y axis", ""},
- {TFM_MODAL_AXIS_Z, "AXIS_Z", 0, "Z axis", ""},
- {TFM_MODAL_PLANE_X, "PLANE_X", 0, "X plane", ""},
- {TFM_MODAL_PLANE_Y, "PLANE_Y", 0, "Y plane", ""},
- {TFM_MODAL_PLANE_Z, "PLANE_Z", 0, "Z plane", ""},
+ {TFM_MODAL_AXIS_X, "AXIS_X", 0, "X Axis", ""},
+ {TFM_MODAL_AXIS_Y, "AXIS_Y", 0, "Y Axis", ""},
+ {TFM_MODAL_AXIS_Z, "AXIS_Z", 0, "Z Axis", ""},
+ {TFM_MODAL_PLANE_X, "PLANE_X", 0, "X Plane", ""},
+ {TFM_MODAL_PLANE_Y, "PLANE_Y", 0, "Y Plane", ""},
+ {TFM_MODAL_PLANE_Z, "PLANE_Z", 0, "Z Plane", ""},
{TFM_MODAL_CONS_OFF, "CONS_OFF", 0, "Clear Constraints", ""},
{TFM_MODAL_SNAP_INV_ON, "SNAP_INV_ON", 0, "Snap Invert", ""},
{TFM_MODAL_SNAP_INV_OFF, "SNAP_INV_OFF", 0, "Snap Invert (Off)", ""},
@@ -672,13 +672,13 @@ wmKeyMap *transform_modal_keymap(wmKeyConfig *keyconf)
0,
"Decrease Max AutoIK Chain Length",
""},
- {TFM_MODAL_EDGESLIDE_UP, "EDGESLIDE_EDGE_NEXT", 0, "Select next Edge Slide Edge", ""},
- {TFM_MODAL_EDGESLIDE_DOWN, "EDGESLIDE_PREV_NEXT", 0, "Select previous Edge Slide Edge", ""},
+ {TFM_MODAL_EDGESLIDE_UP, "EDGESLIDE_EDGE_NEXT", 0, "Select Next Edge Slide Edge", ""},
+ {TFM_MODAL_EDGESLIDE_DOWN, "EDGESLIDE_PREV_NEXT", 0, "Select Previous Edge Slide Edge", ""},
{TFM_MODAL_PROPSIZE, "PROPORTIONAL_SIZE", 0, "Adjust Proportional Influence", ""},
{TFM_MODAL_INSERTOFS_TOGGLE_DIR,
"INSERTOFS_TOGGLE_DIR",
0,
- "Toggle Direction for Node Auto-offset",
+ "Toggle Direction for Node Auto-Offset",
""},
{TFM_MODAL_TRANSLATE, "TRANSLATE", 0, "Move", ""},
{TFM_MODAL_ROTATE, "ROTATE", 0, "Rotate", ""},
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilarmature.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilarmature.c
index aee345757c6..c67d622ffec 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencilarmature.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilarmature.c
@@ -215,7 +215,7 @@ static void panel_draw(const bContext *UNUSED(C), Panel *panel)
uiLayoutSetPropDecorate(sub, false);
uiItemR(sub, ptr, "invert_vertex_group", 0, "", ICON_ARROW_LEFTRIGHT);
- col = uiLayoutColumnWithHeading(layout, true, IFACE_("Bind to"));
+ col = uiLayoutColumnWithHeading(layout, true, IFACE_("Bind To"));
uiItemR(col, ptr, "use_vertex_groups", 0, IFACE_("Vertex Groups"), ICON_NONE);
uiItemR(col, ptr, "use_bone_envelopes", 0, IFACE_("Bone Envelopes"), ICON_NONE);
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilsubdiv.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilsubdiv.c
index 6eb12974408..8f17be97710 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencilsubdiv.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilsubdiv.c
@@ -101,6 +101,11 @@ static void deformStroke(GpencilModifierData *md,
}
BKE_gpencil_stroke_subdivide(gps, mmd->level, mmd->type);
+
+ /* If the stroke is cyclic, must generate the closing geometry. */
+ if (gps->flag & GP_STROKE_CYCLIC) {
+ BKE_gpencil_stroke_close(gps);
+ }
}
static void bakeModifier(struct Main *UNUSED(bmain),
diff --git a/source/blender/makesdna/DNA_brush_types.h b/source/blender/makesdna/DNA_brush_types.h
index 37b7947dbea..713f5ee2afa 100644
--- a/source/blender/makesdna/DNA_brush_types.h
+++ b/source/blender/makesdna/DNA_brush_types.h
@@ -775,6 +775,7 @@ typedef enum eBrushFlags2 {
BRUSH_POSE_USE_LOCK_ROTATION = (1 << 5),
BRUSH_CLOTH_USE_COLLISION = (1 << 6),
BRUSH_AREA_RADIUS_PRESSURE = (1 << 7),
+ BRUSH_GRAB_SILHOUETTE = (1 << 8),
} eBrushFlags2;
typedef enum {
diff --git a/source/blender/makesdna/DNA_constraint_types.h b/source/blender/makesdna/DNA_constraint_types.h
index 92ee3f062a6..c95e5376670 100644
--- a/source/blender/makesdna/DNA_constraint_types.h
+++ b/source/blender/makesdna/DNA_constraint_types.h
@@ -690,8 +690,10 @@ typedef enum eBConstraint_Types {
/* flag 0x20 (1 << 5) was used to indicate that a constraint was evaluated
* using a 'local' hack for posebones only. */
typedef enum eBConstraint_Flags {
+#ifdef DNA_DEPRECATED_ALLOW
/* Expansion for old box constraint layouts. Just for versioning. */
CONSTRAINT_EXPAND_DEPRECATED = (1 << 0),
+#endif
/* pre-check for illegal object name or bone name */
CONSTRAINT_DISABLE = (1 << 2),
/* to indicate which Ipo should be shown, maybe for 3d access later too */
diff --git a/source/blender/makesdna/DNA_gpencil_modifier_types.h b/source/blender/makesdna/DNA_gpencil_modifier_types.h
index 7e2ec8b6c65..3a9f9bd7b66 100644
--- a/source/blender/makesdna/DNA_gpencil_modifier_types.h
+++ b/source/blender/makesdna/DNA_gpencil_modifier_types.h
@@ -57,7 +57,9 @@ typedef enum GpencilModifierMode {
eGpencilModifierMode_Realtime = (1 << 0),
eGpencilModifierMode_Render = (1 << 1),
eGpencilModifierMode_Editmode = (1 << 2),
+#ifdef DNA_DEPRECATED_ALLOW
eGpencilModifierMode_Expanded_DEPRECATED = (1 << 3),
+#endif
eGpencilModifierMode_Virtual = (1 << 4),
} GpencilModifierMode;
diff --git a/source/blender/makesdna/DNA_mesh_types.h b/source/blender/makesdna/DNA_mesh_types.h
index e2837ba85f8..a822a6723fa 100644
--- a/source/blender/makesdna/DNA_mesh_types.h
+++ b/source/blender/makesdna/DNA_mesh_types.h
@@ -48,7 +48,6 @@ struct MPropCol;
struct MVert;
struct Material;
struct Mesh;
-struct Multires;
struct SubdivCCG;
#
@@ -230,9 +229,6 @@ typedef struct Mesh {
* default and Face Sets can be used without affecting the color of the mesh. */
int face_sets_color_default;
- /** Deprecated multiresolution modeling data, only keep for loading old files. */
- struct Multires *mr DNA_DEPRECATED;
-
Mesh_Runtime runtime;
} Mesh;
diff --git a/source/blender/makesdna/DNA_meshdata_types.h b/source/blender/makesdna/DNA_meshdata_types.h
index 45bf6e8c282..7cc94a2ad0b 100644
--- a/source/blender/makesdna/DNA_meshdata_types.h
+++ b/source/blender/makesdna/DNA_meshdata_types.h
@@ -518,54 +518,4 @@ typedef struct MRecast {
int i;
} MRecast;
-/** Multires structs kept for compatibility with old files. */
-typedef struct MultiresCol {
- float a, r, g, b;
-} MultiresCol;
-
-typedef struct MultiresColFace {
- /* vertex colors */
- MultiresCol col[4];
-} MultiresColFace;
-
-typedef struct MultiresFace {
- unsigned int v[4];
- unsigned int mid;
- char flag, mat_nr, _pad[2];
-} MultiresFace;
-
-typedef struct MultiresEdge {
- unsigned int v[2];
- unsigned int mid;
-} MultiresEdge;
-
-typedef struct MultiresLevel {
- struct MultiresLevel *next, *prev;
-
- MultiresFace *faces;
- MultiresColFace *colfaces;
- MultiresEdge *edges;
-
- unsigned int totvert, totface, totedge;
- char _pad[4];
-
- /* Kept for compatibility with even older files */
- MVert *verts;
-} MultiresLevel;
-
-typedef struct Multires {
- ListBase levels;
- MVert *verts;
-
- unsigned char level_count, current, newlvl, edgelvl, pinlvl, renderlvl;
- unsigned char use_col, flag;
-
- /* Special level 1 data that cannot be modified from other levels */
- CustomData vdata;
- CustomData fdata;
- short *edge_flags;
- char *edge_creases;
-} Multires;
-/* End multi-res structs. */
-
/** \} */
diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h
index 29bcc5fe903..0d642e4f3d5 100644
--- a/source/blender/makesdna/DNA_modifier_types.h
+++ b/source/blender/makesdna/DNA_modifier_types.h
@@ -106,8 +106,10 @@ typedef enum ModifierMode {
eModifierMode_Render = (1 << 1),
eModifierMode_Editmode = (1 << 2),
eModifierMode_OnCage = (1 << 3),
- /* Old modifier box expansion, just for versioning. */
+#ifdef DNA_DEPRECATED_ALLOW
+ /** Old modifier box expansion, just for versioning. */
eModifierMode_Expanded_DEPRECATED = (1 << 4),
+#endif
eModifierMode_Virtual = (1 << 5),
eModifierMode_ApplyOnSpline = (1 << 6),
eModifierMode_DisableTemporary = (1u << 31),
diff --git a/source/blender/makesdna/DNA_shader_fx_types.h b/source/blender/makesdna/DNA_shader_fx_types.h
index 5bb78edb280..5567d65b6db 100644
--- a/source/blender/makesdna/DNA_shader_fx_types.h
+++ b/source/blender/makesdna/DNA_shader_fx_types.h
@@ -49,7 +49,9 @@ typedef enum ShaderFxMode {
eShaderFxMode_Realtime = (1 << 0),
eShaderFxMode_Render = (1 << 1),
eShaderFxMode_Editmode = (1 << 2),
+#ifdef DNA_DEPRECATED_ALLOW
eShaderFxMode_Expanded_DEPRECATED = (1 << 3),
+#endif
} ShaderFxMode;
typedef enum {
diff --git a/source/blender/makesrna/intern/rna_action.c b/source/blender/makesrna/intern/rna_action.c
index 89687c1234c..576431b7fd1 100644
--- a/source/blender/makesrna/intern/rna_action.c
+++ b/source/blender/makesrna/intern/rna_action.c
@@ -450,7 +450,7 @@ static void rna_def_dopesheet(BlenderRNA *brna)
prop = RNA_def_property(srna, "show_shapekeys", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOSHAPEKEYS);
RNA_def_property_ui_text(
- prop, "Display Shapekeys", "Include visualization of shape key related animation data");
+ prop, "Display Shape Keys", "Include visualization of shape key related animation data");
RNA_def_property_ui_icon(prop, ICON_SHAPEKEY_DATA, 0);
RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL);
diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c
index d119be66916..6f227ec210c 100644
--- a/source/blender/makesrna/intern/rna_brush.c
+++ b/source/blender/makesrna/intern/rna_brush.c
@@ -2968,6 +2968,12 @@ static void rna_def_brush(BlenderRNA *brna)
"Apply the maximum grab strength to the active vertex instead of the cursor location");
RNA_def_property_update(prop, 0, "rna_Brush_update");
+ prop = RNA_def_property(srna, "use_grab_silhouette", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag2", BRUSH_GRAB_SILHOUETTE);
+ RNA_def_property_ui_text(
+ prop, "Grab Silhouette", "Grabs trying to automask the silhouette of the object");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
+
prop = RNA_def_property(srna, "use_paint_antialiasing", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "sampling_flag", BRUSH_PAINT_ANTIALIASING);
RNA_def_property_ui_text(prop, "Anti-Aliasing", "Smooths the edges of the strokes");
diff --git a/source/blender/makesrna/intern/rna_color.c b/source/blender/makesrna/intern/rna_color.c
index 79f2ab70651..b02377f4bb0 100644
--- a/source/blender/makesrna/intern/rna_color.c
+++ b/source/blender/makesrna/intern/rna_color.c
@@ -796,7 +796,7 @@ static void rna_def_curvemapping(BlenderRNA *brna)
static const EnumPropertyItem tone_items[] = {
{CURVE_TONE_STANDARD, "STANDARD", 0, "Standard", ""},
- {CURVE_TONE_FILMLIKE, "FILMLIKE", 0, "Film like", ""},
+ {CURVE_TONE_FILMLIKE, "FILMLIKE", 0, "Filmlike", ""},
{0, NULL, 0, NULL, NULL},
};
diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c
index 2d6bf2897e0..2e73fabe103 100644
--- a/source/blender/makesrna/intern/rna_curve.c
+++ b/source/blender/makesrna/intern/rna_curve.c
@@ -543,11 +543,9 @@ static void rna_Curve_resolution_u_update_data(Main *bmain, Scene *scene, Pointe
{
Curve *cu = (Curve *)ptr->owner_id;
ListBase *nurbs = BKE_curve_nurbs_get(cu);
- Nurb *nu = nurbs->first;
- while (nu) {
+ LISTBASE_FOREACH (Nurb *, nu, nurbs) {
nu->resolu = cu->resolu;
- nu = nu->next;
}
rna_Curve_update_data(bmain, scene, ptr);
@@ -557,11 +555,9 @@ static void rna_Curve_resolution_v_update_data(Main *bmain, Scene *scene, Pointe
{
Curve *cu = (Curve *)ptr->owner_id;
ListBase *nurbs = BKE_curve_nurbs_get(cu);
- Nurb *nu = nurbs->first;
- while (nu) {
+ LISTBASE_FOREACH (Nurb *, nu, nurbs) {
nu->resolv = cu->resolv;
- nu = nu->next;
}
rna_Curve_update_data(bmain, scene, ptr);
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index 0dea0e47978..78d02795325 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -4788,7 +4788,7 @@ static void def_sh_tex_voronoi(StructRNA *srna)
{SHD_VORONOI_DISTANCE_TO_EDGE,
"DISTANCE_TO_EDGE",
0,
- "Distance To Edge",
+ "Distance to Edge",
"Computes the distance to the edge of the voronoi cell"},
{SHD_VORONOI_N_SPHERE_RADIUS,
"N_SPHERE_RADIUS",
@@ -7725,15 +7725,15 @@ static void def_cmp_viewer(StructRNA *srna)
static const EnumPropertyItem tileorder_items[] = {
{0, "CENTEROUT", 0, "Center", "Expand from center"},
{1, "RANDOM", 0, "Random", "Random tiles"},
- {2, "BOTTOMUP", 0, "Bottom up", "Expand from bottom"},
- {3, "RULE_OF_THIRDS", 0, "Rule of thirds", "Expand from 9 places"},
+ {2, "BOTTOMUP", 0, "Bottom Up", "Expand from bottom"},
+ {3, "RULE_OF_THIRDS", 0, "Rule of Thirds", "Expand from 9 places"},
{0, NULL, 0, NULL, NULL},
};
prop = RNA_def_property(srna, "tile_order", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "custom1");
RNA_def_property_enum_items(prop, tileorder_items);
- RNA_def_property_ui_text(prop, "Tile order", "Tile order");
+ RNA_def_property_ui_text(prop, "Tile Order", "Tile order");
RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
prop = RNA_def_property(srna, "center_x", PROP_FLOAT, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 24cff501b59..62d5917bc10 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -379,7 +379,7 @@ const EnumPropertyItem rna_enum_image_type_items[] = {
{R_IMF_IMTYPE_FFMPEG,
"FFMPEG",
ICON_FILE_MOVIE,
- "FFmpeg video",
+ "FFmpeg Video",
"The most versatile way to output video files"},
#endif
{0, NULL, 0, NULL, NULL},
@@ -2864,13 +2864,13 @@ static void rna_def_tool_settings(BlenderRNA *brna)
};
static const EnumPropertyItem gpencil_stroke_snap_items[] = {
- {0, "NONE", 0, "All points", "Snap to all points"},
+ {0, "NONE", 0, "All Points", "Snap to all points"},
{GP_PROJECT_DEPTH_STROKE_ENDPOINTS,
"ENDS",
0,
- "End points",
+ "End Points",
"Snap to first and last points and interpolate"},
- {GP_PROJECT_DEPTH_STROKE_FIRST, "FIRST", 0, "First point", "Snap to first point"},
+ {GP_PROJECT_DEPTH_STROKE_FIRST, "FIRST", 0, "First Point", "Snap to first point"},
{0, NULL, 0, NULL, NULL},
};
@@ -5510,12 +5510,12 @@ static void rna_def_scene_ffmpeg_settings(BlenderRNA *brna)
"Constant Bitrate",
"Configure constant bit rate, rather than constant output quality"},
{FFM_CRF_LOSSLESS, "LOSSLESS", 0, "Lossless", ""},
- {FFM_CRF_PERC_LOSSLESS, "PERC_LOSSLESS", 0, "Perceptually lossless", ""},
- {FFM_CRF_HIGH, "HIGH", 0, "High quality", ""},
- {FFM_CRF_MEDIUM, "MEDIUM", 0, "Medium quality", ""},
- {FFM_CRF_LOW, "LOW", 0, "Low quality", ""},
- {FFM_CRF_VERYLOW, "VERYLOW", 0, "Very low quality", ""},
- {FFM_CRF_LOWEST, "LOWEST", 0, "Lowest quality", ""},
+ {FFM_CRF_PERC_LOSSLESS, "PERC_LOSSLESS", 0, "Perceptually Lossless", ""},
+ {FFM_CRF_HIGH, "HIGH", 0, "High Quality", ""},
+ {FFM_CRF_MEDIUM, "MEDIUM", 0, "Medium Quality", ""},
+ {FFM_CRF_LOW, "LOW", 0, "Low Quality", ""},
+ {FFM_CRF_VERYLOW, "VERYLOW", 0, "Very Low Quality", ""},
+ {FFM_CRF_LOWEST, "LOWEST", 0, "Lowest Quality", ""},
{0, NULL, 0, NULL, NULL},
};
@@ -5738,7 +5738,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
{0,
"AUTO",
0,
- "Auto-detect",
+ "Auto-Detect",
"Automatically determine the number of threads, based on CPUs"},
{R_FIXED_THREADS, "FIXED", 0, "Fixed", "Manually determine the number of threads"},
{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 c7bdf7a2dd6..e477bf6d284 100644
--- a/source/blender/makesrna/intern/rna_sculpt_paint.c
+++ b/source/blender/makesrna/intern/rna_sculpt_paint.c
@@ -1151,7 +1151,7 @@ static void rna_def_particle_edit(BlenderRNA *brna)
static const EnumPropertyItem edit_type_items[] = {
{PE_TYPE_PARTICLES, "PARTICLES", 0, "Particles", ""},
- {PE_TYPE_SOFTBODY, "SOFT_BODY", 0, "Soft body", ""},
+ {PE_TYPE_SOFTBODY, "SOFT_BODY", 0, "Soft Body", ""},
{PE_TYPE_CLOTH, "CLOTH", 0, "Cloth", ""},
{0, NULL, 0, NULL, NULL},
};
diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c
index 9d322d0d09b..e180ab5dfb6 100644
--- a/source/blender/makesrna/intern/rna_sequencer.c
+++ b/source/blender/makesrna/intern/rna_sequencer.c
@@ -1936,7 +1936,7 @@ static void rna_def_sequence(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "cache_flag", SEQ_CACHE_STORE_PREPROCESSED);
RNA_def_property_ui_text(
prop,
- "Cache Pre-processed",
+ "Cache Pre-Processed",
"Cache pre-processed images, for faster tweaking of effects at the cost of memory usage");
prop = RNA_def_property(srna, "use_cache_composite", PROP_BOOLEAN, PROP_NONE);
@@ -2100,7 +2100,7 @@ static void rna_def_editor(BlenderRNA *brna)
RNA_def_property_ui_range(prop, 0.0f, SEQ_CACHE_COST_MAX, 0.1f, 1);
RNA_def_property_float_sdna(prop, NULL, "recycle_max_cost");
RNA_def_property_ui_text(
- prop, "Recycle Up To Cost", "Only frames with cost lower than this value will be recycled");
+ prop, "Recycle Up to Cost", "Only frames with cost lower than this value will be recycled");
}
static void rna_def_filter_video(StructRNA *srna)
@@ -2822,7 +2822,7 @@ static void rna_def_speed_control(StructRNA *srna)
prop = RNA_def_property(srna, "use_frame_interpolate", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", SEQ_SPEED_USE_INTERPOLATION);
RNA_def_property_ui_text(
- prop, "Frame interpolation", "Do crossfade blending between current and next frame");
+ prop, "Frame Interpolation", "Do crossfade blending between current and next frame");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
}
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index 3255f335e74..f5f7930964a 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -5185,7 +5185,7 @@ static void rna_def_space_dopesheet(BlenderRNA *brna)
prop = RNA_def_property(srna, "show_interpolation", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SACTION_SHOW_INTERPOLATION);
RNA_def_property_ui_text(prop,
- "Show Handles And Interpolation",
+ "Show Handles and Interpolation",
"Display keyframe handle types and non-bezier interpolation modes");
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_DOPESHEET, NULL);
@@ -5208,7 +5208,7 @@ static void rna_def_space_dopesheet(BlenderRNA *brna)
/* editing */
prop = RNA_def_property(srna, "use_auto_merge_keyframes", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SACTION_NOTRANSKEYCULL);
- RNA_def_property_ui_text(prop, "AutoMerge Keyframes", "Automatically merge nearby keyframes");
+ RNA_def_property_ui_text(prop, "Auto-Merge Keyframes", "Automatically merge nearby keyframes");
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_DOPESHEET, NULL);
prop = RNA_def_property(srna, "use_realtime_update", PROP_BOOLEAN, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c
index 4d5f0f6c2fa..fb6d40b3a55 100644
--- a/source/blender/makesrna/intern/rna_texture.c
+++ b/source/blender/makesrna/intern/rna_texture.c
@@ -1074,8 +1074,8 @@ static void rna_def_texture_stucci(BlenderRNA *brna)
static const EnumPropertyItem prop_stucci_stype[] = {
{TEX_PLASTIC, "PLASTIC", 0, "Plastic", "Use standard stucci"},
- {TEX_WALLIN, "WALL_IN", 0, "Wall in", "Create Dimples"},
- {TEX_WALLOUT, "WALL_OUT", 0, "Wall out", "Create Ridges"},
+ {TEX_WALLIN, "WALL_IN", 0, "Wall In", "Create Dimples"},
+ {TEX_WALLOUT, "WALL_OUT", 0, "Wall Out", "Create Ridges"},
{0, NULL, 0, NULL, NULL},
};
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index c31766efe58..3d389dd9b07 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -4786,7 +4786,7 @@ static void rna_def_userdef_view(BlenderRNA *brna)
prop = RNA_def_property(srna, "font_path_ui_mono", PROP_STRING, PROP_FILEPATH);
RNA_def_property_string_sdna(prop, NULL, "font_path_ui_mono");
- RNA_def_property_ui_text(prop, "Mono-space Font", "Path to interface mono-space Font");
+ RNA_def_property_ui_text(prop, "Monospaced Font", "Path to interface monospaced Font");
RNA_def_property_update(prop, NC_WINDOW, "rna_userdef_font_update");
/* Language. */
diff --git a/source/blender/makesrna/intern/rna_wm_api.c b/source/blender/makesrna/intern/rna_wm_api.c
index 2cabc89feee..2c373eb8d46 100644
--- a/source/blender/makesrna/intern/rna_wm_api.c
+++ b/source/blender/makesrna/intern/rna_wm_api.c
@@ -1135,7 +1135,7 @@ void RNA_api_keymapitems(StructRNA *srna)
RNA_def_boolean(func, "alt", 0, "Alt", "");
RNA_def_boolean(func, "oskey", 0, "OS Key", "");
RNA_def_enum(func, "key_modifier", rna_enum_event_type_items, 0, "Key Modifier", "");
- RNA_def_boolean(func, "repeat", true, "Repeat", "When set, accept key-repeat events");
+ RNA_def_boolean(func, "repeat", false, "Repeat", "When set, accept key-repeat events");
RNA_def_boolean(func,
"head",
0,
@@ -1159,7 +1159,7 @@ void RNA_api_keymapitems(StructRNA *srna)
RNA_def_boolean(func, "alt", 0, "Alt", "");
RNA_def_boolean(func, "oskey", 0, "OS Key", "");
RNA_def_enum(func, "key_modifier", rna_enum_event_type_items, 0, "Key Modifier", "");
- RNA_def_boolean(func, "repeat", true, "Repeat", "When set, accept key-repeat events");
+ RNA_def_boolean(func, "repeat", false, "Repeat", "When set, accept key-repeat events");
parm = RNA_def_pointer(func, "item", "KeyMapItem", "Item", "Added key map item");
RNA_def_function_return(func, parm);
diff --git a/source/blender/modifiers/intern/MOD_armature.c b/source/blender/modifiers/intern/MOD_armature.c
index 324cac3df8b..38fb19e3233 100644
--- a/source/blender/modifiers/intern/MOD_armature.c
+++ b/source/blender/modifiers/intern/MOD_armature.c
@@ -258,7 +258,7 @@ static void panel_draw(const bContext *UNUSED(C), Panel *panel)
uiItemR(col, ptr, "use_deform_preserve_volume", 0, NULL, ICON_NONE);
uiItemR(col, ptr, "use_multi_modifier", 0, NULL, ICON_NONE);
- col = uiLayoutColumnWithHeading(layout, true, IFACE_("Bind to"));
+ col = uiLayoutColumnWithHeading(layout, true, IFACE_("Bind To"));
uiItemR(col, ptr, "use_vertex_groups", 0, IFACE_("Vertex Groups"), ICON_NONE);
uiItemR(col, ptr, "use_bone_envelopes", 0, IFACE_("Bone Envelopes"), ICON_NONE);
diff --git a/source/blender/modifiers/intern/MOD_ui_common.c b/source/blender/modifiers/intern/MOD_ui_common.c
index bad76a0b559..ba43434aeb3 100644
--- a/source/blender/modifiers/intern/MOD_ui_common.c
+++ b/source/blender/modifiers/intern/MOD_ui_common.c
@@ -229,14 +229,14 @@ static void modifier_ops_extra_draw(bContext *C, uiLayout *layout, void *md_v)
/* Apply as shapekey. */
if (BKE_modifier_is_same_topology(md) && !BKE_modifier_is_non_geometrical(md)) {
uiItemBooleanO(layout,
- CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Apply As Shapekey"),
+ CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Apply as Shape Key"),
ICON_SHAPEKEY_DATA,
"OBJECT_OT_modifier_apply_as_shapekey",
"keep_modifier",
false);
uiItemBooleanO(layout,
- CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Save As Shapekey"),
+ CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Save as Shape Key"),
ICON_SHAPEKEY_DATA,
"OBJECT_OT_modifier_apply_as_shapekey",
"keep_modifier",
diff --git a/source/blender/python/intern/bpy_app.c b/source/blender/python/intern/bpy_app.c
index 554ab2645a7..a580b4f10f0 100644
--- a/source/blender/python/intern/bpy_app.c
+++ b/source/blender/python/intern/bpy_app.c
@@ -82,6 +82,7 @@ static PyTypeObject BlenderAppType;
static PyStructSequence_Field app_info_fields[] = {
{"version", "The Blender version as a tuple of 3 numbers. eg. (2, 83, 1)"},
+ {"version_file", "The blend file version, compatible with ``bpy.data.version``"},
{"version_string", "The Blender version formatted as a string"},
{"version_cycle", "The release status of this build alpha/beta/rc/release"},
{"version_char", "Deprecated, always an empty string"},
@@ -151,6 +152,8 @@ static PyObject *make_app_info(void)
SetObjItem(
PyC_Tuple_Pack_I32(BLENDER_VERSION / 100, BLENDER_VERSION % 100, BLENDER_VERSION_PATCH));
+ SetObjItem(PyC_Tuple_Pack_I32(
+ BLENDER_FILE_VERSION / 100, BLENDER_FILE_VERSION % 100, BLENDER_FILE_SUBVERSION));
SetStrItem(BKE_blender_version_string());
SetStrItem(STRINGIFY(BLENDER_VERSION_CYCLE));
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index 613de5a9b17..4604f66d866 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -3771,7 +3771,7 @@ static void gesture_circle_modal_keymap(wmKeyConfig *keyconf)
{GESTURE_MODAL_CIRCLE_SIZE, "SIZE", 0, "Size", ""},
{GESTURE_MODAL_SELECT, "SELECT", 0, "Select", ""},
- {GESTURE_MODAL_DESELECT, "DESELECT", 0, "DeSelect", ""},
+ {GESTURE_MODAL_DESELECT, "DESELECT", 0, "Deselect", ""},
{GESTURE_MODAL_NOP, "NOP", 0, "No Operation", ""},
{0, NULL, 0, NULL, NULL},
@@ -3834,7 +3834,7 @@ static void gesture_box_modal_keymap(wmKeyConfig *keyconf)
static const EnumPropertyItem modal_items[] = {
{GESTURE_MODAL_CANCEL, "CANCEL", 0, "Cancel", ""},
{GESTURE_MODAL_SELECT, "SELECT", 0, "Select", ""},
- {GESTURE_MODAL_DESELECT, "DESELECT", 0, "DeSelect", ""},
+ {GESTURE_MODAL_DESELECT, "DESELECT", 0, "Deselect", ""},
{GESTURE_MODAL_BEGIN, "BEGIN", 0, "Begin", ""},
{GESTURE_MODAL_MOVE, "MOVE", 0, "Move", ""},
{0, NULL, 0, NULL, NULL},