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:
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/animation/anim_channels_defines.c38
-rw-r--r--source/blender/editors/animation/anim_filter.c14
-rw-r--r--source/blender/editors/animation/anim_intern.h2
-rw-r--r--source/blender/editors/armature/armature_add.c16
-rw-r--r--source/blender/editors/armature/armature_edit.c2
-rw-r--r--source/blender/editors/armature/armature_naming.c2
-rw-r--r--source/blender/editors/armature/armature_relations.c2
-rw-r--r--source/blender/editors/armature/armature_select.c2
-rw-r--r--source/blender/editors/armature/armature_skinning.c4
-rw-r--r--source/blender/editors/armature/meshlaplacian.c2
-rw-r--r--source/blender/editors/armature/meshlaplacian.h3
-rw-r--r--source/blender/editors/armature/pose_edit.c2
-rw-r--r--source/blender/editors/armature/pose_group.c2
-rw-r--r--source/blender/editors/asset/intern/asset_list.cc4
-rw-r--r--source/blender/editors/gpencil/annotate_paint.c2
-rw-r--r--source/blender/editors/gpencil/gpencil_convert.c2
-rw-r--r--source/blender/editors/gpencil/gpencil_edit.c2
-rw-r--r--source/blender/editors/gpencil/gpencil_edit_curve.c2
-rw-r--r--source/blender/editors/gpencil/gpencil_interpolate.c2
-rw-r--r--source/blender/editors/gpencil/gpencil_merge.c2
-rw-r--r--source/blender/editors/gpencil/gpencil_mesh.c2
-rw-r--r--source/blender/editors/gpencil/gpencil_ops_versioning.c2
-rw-r--r--source/blender/editors/gpencil/gpencil_primitive.c2
-rw-r--r--source/blender/editors/gpencil/gpencil_sculpt_paint.c2
-rw-r--r--source/blender/editors/gpencil/gpencil_vertex_ops.c2
-rw-r--r--source/blender/editors/gpencil/gpencil_vertex_paint.c2
-rw-r--r--source/blender/editors/gpencil/gpencil_weight_paint.c2
-rw-r--r--source/blender/editors/include/ED_anim_api.h2
-rw-r--r--source/blender/editors/include/ED_keyframing.h1
-rw-r--r--source/blender/editors/include/UI_icons.h8
-rw-r--r--source/blender/editors/include/UI_view2d.h4
-rw-r--r--source/blender/editors/interface/interface_icons.c4
-rw-r--r--source/blender/editors/interface/interface_templates.c13
-rw-r--r--source/blender/editors/mesh/editmesh_select_similar.c45
-rw-r--r--source/blender/editors/object/CMakeLists.txt2
-rw-r--r--source/blender/editors/object/object_add.c24
-rw-r--r--source/blender/editors/object/object_intern.h2
-rw-r--r--source/blender/editors/object/object_modifier.c6
-rw-r--r--source/blender/editors/object/object_ops.c2
-rw-r--r--source/blender/editors/object/object_relations.c4
-rw-r--r--source/blender/editors/render/render_opengl.cc2
-rw-r--r--source/blender/editors/screen/screendump.c2
-rw-r--r--source/blender/editors/sculpt_paint/paint_hide.c2
-rw-r--r--source/blender/editors/sculpt_paint/paint_image.c2
-rw-r--r--source/blender/editors/sculpt_paint/paint_image_proj.c2
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c2
-rw-r--r--source/blender/editors/sculpt_paint/sculpt_brush_types.c2
-rw-r--r--source/blender/editors/sculpt_paint/sculpt_ops.c2
-rw-r--r--source/blender/editors/sculpt_paint/sculpt_undo.c2
-rw-r--r--source/blender/editors/sculpt_paint/sculpt_uv.c4
-rw-r--r--source/blender/editors/space_api/spacetypes.c2
-rw-r--r--source/blender/editors/space_buttons/CMakeLists.txt2
-rw-r--r--source/blender/editors/space_buttons/buttons_context.c16
-rw-r--r--source/blender/editors/space_file/filelist.c3
-rw-r--r--source/blender/editors/space_file/fsmenu.c2
-rw-r--r--source/blender/editors/space_info/info_stats.cc2
-rw-r--r--source/blender/editors/space_nla/nla_edit.c7
-rw-r--r--source/blender/editors/space_node/drawnode.cc5
-rw-r--r--source/blender/editors/space_node/node_draw.cc15
-rw-r--r--source/blender/editors/space_node/node_edit.cc6
-rw-r--r--source/blender/editors/space_node/node_intern.hh2
-rw-r--r--source/blender/editors/space_node/node_relationships.cc92
-rw-r--r--source/blender/editors/space_node/node_select.cc156
-rw-r--r--source/blender/editors/space_outliner/outliner_draw.cc8
-rw-r--r--source/blender/editors/space_outliner/outliner_intern.hh2
-rw-r--r--source/blender/editors/space_outliner/outliner_select.cc2
-rw-r--r--source/blender/editors/space_outliner/outliner_tools.cc12
-rw-r--r--source/blender/editors/space_outliner/outliner_tree.cc10
-rw-r--r--source/blender/editors/space_outliner/tree/tree_element_id.cc2
-rw-r--r--source/blender/editors/space_sequencer/sequencer_add.c2
-rw-r--r--source/blender/editors/space_sequencer/sequencer_scopes.c2
-rw-r--r--source/blender/editors/space_view3d/view3d_buttons.c3
72 files changed, 405 insertions, 208 deletions
diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c
index 5afb9334612..a697fd2fc96 100644
--- a/source/blender/editors/animation/anim_channels_defines.c
+++ b/source/blender/editors/animation/anim_channels_defines.c
@@ -35,8 +35,8 @@
#include "DNA_armature_types.h"
#include "DNA_cachefile_types.h"
#include "DNA_camera_types.h"
+#include "DNA_curves_types.h"
#include "DNA_gpencil_types.h"
-#include "DNA_hair_types.h"
#include "DNA_key_types.h"
#include "DNA_lattice_types.h"
#include "DNA_light_types.h"
@@ -700,8 +700,8 @@ static int acf_object_icon(bAnimListElem *ale)
return ICON_OUTLINER_OB_FONT;
case OB_SURF:
return ICON_OUTLINER_OB_SURFACE;
- case OB_HAIR:
- return ICON_OUTLINER_OB_HAIR;
+ case OB_CURVES:
+ return ICON_OUTLINER_OB_CURVES;
case OB_POINTCLOUD:
return ICON_OUTLINER_OB_POINTCLOUD;
case OB_VOLUME:
@@ -2813,15 +2813,15 @@ static bAnimChannelType ACF_DSSPK = {
/* Hair Expander ------------------------------------------- */
/* TODO: just get this from RNA? */
-static int acf_dshair_icon(bAnimListElem *UNUSED(ale))
+static int acf_dscurves_icon(bAnimListElem *UNUSED(ale))
{
- return ICON_HAIR_DATA;
+ return ICON_CURVES_DATA;
}
/* Get the appropriate flag(s) for the setting when it is valid. */
-static int acf_dshair_setting_flag(bAnimContext *UNUSED(ac),
- eAnimChannel_Settings setting,
- bool *neg)
+static int acf_dscurves_setting_flag(bAnimContext *UNUSED(ac),
+ eAnimChannel_Settings setting,
+ bool *neg)
{
/* clear extra return data first */
*neg = false;
@@ -2846,22 +2846,24 @@ static int acf_dshair_setting_flag(bAnimContext *UNUSED(ac),
}
/* get pointer to the setting */
-static void *acf_dshair_setting_ptr(bAnimListElem *ale, eAnimChannel_Settings setting, short *type)
+static void *acf_dscurves_setting_ptr(bAnimListElem *ale,
+ eAnimChannel_Settings setting,
+ short *type)
{
- Hair *hair = (Hair *)ale->data;
+ Curves *curves = (Curves *)ale->data;
/* clear extra return data first */
*type = 0;
switch (setting) {
case ACHANNEL_SETTING_EXPAND: /* expanded */
- return GET_ACF_FLAG_PTR(hair->flag, type);
+ return GET_ACF_FLAG_PTR(curves->flag, type);
case ACHANNEL_SETTING_SELECT: /* selected */
case ACHANNEL_SETTING_MUTE: /* muted (for NLA only) */
case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
- if (hair->adt) {
- return GET_ACF_FLAG_PTR(hair->adt->flag, type);
+ if (curves->adt) {
+ return GET_ACF_FLAG_PTR(curves->adt->flag, type);
}
return NULL;
@@ -2870,9 +2872,9 @@ static void *acf_dshair_setting_ptr(bAnimListElem *ale, eAnimChannel_Settings se
}
}
-/* hair expander type define */
+/* Curves expander type define */
static bAnimChannelType ACF_DSHAIR = {
- "Hair Expander", /* type name */
+ "Curves Expander", /* type name */
ACHANNEL_ROLE_EXPANDER, /* role */
acf_generic_dataexpand_color, /* backdrop color */
@@ -2882,11 +2884,11 @@ static bAnimChannelType ACF_DSHAIR = {
acf_generic_idblock_name, /* name */
acf_generic_idblock_name_prop, /* name prop */
- acf_dshair_icon, /* icon */
+ acf_dscurves_icon, /* icon */
acf_generic_dataexpand_setting_valid, /* has setting */
- acf_dshair_setting_flag, /* flag for setting */
- acf_dshair_setting_ptr /* pointer for setting */
+ acf_dscurves_setting_flag, /* flag for setting */
+ acf_dscurves_setting_ptr /* pointer for setting */
};
/* PointCloud Expander ------------------------------------------- */
diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c
index c1a09b9d21f..3307385b84a 100644
--- a/source/blender/editors/animation/anim_filter.c
+++ b/source/blender/editors/animation/anim_filter.c
@@ -47,8 +47,8 @@
#include "DNA_brush_types.h"
#include "DNA_cachefile_types.h"
#include "DNA_camera_types.h"
+#include "DNA_curves_types.h"
#include "DNA_gpencil_types.h"
-#include "DNA_hair_types.h"
#include "DNA_key_types.h"
#include "DNA_lattice_types.h"
#include "DNA_layer_types.h"
@@ -791,10 +791,10 @@ static bAnimListElem *make_new_animlistelem(void *data,
break;
}
case ANIMTYPE_DSHAIR: {
- Hair *hair = (Hair *)data;
- AnimData *adt = hair->adt;
+ Curves *curves = (Curves *)data;
+ AnimData *adt = curves->adt;
- ale->flag = FILTER_HAIR_OBJD(hair);
+ ale->flag = FILTER_CURVES_OBJD(curves);
ale->key_data = (adt) ? adt->action : NULL;
ale->datatype = ALE_ACT;
@@ -2616,16 +2616,16 @@ static size_t animdata_filter_ds_obdata(
expanded = FILTER_SPK_OBJD(spk);
break;
}
- case OB_HAIR: /* ---------- Hair ----------- */
+ case OB_CURVES: /* ---------- Curves ----------- */
{
- Hair *hair = (Hair *)ob->data;
+ Curves *curves = (Curves *)ob->data;
if (ads->filterflag2 & ADS_FILTER_NOHAIR) {
return 0;
}
type = ANIMTYPE_DSHAIR;
- expanded = FILTER_HAIR_OBJD(hair);
+ expanded = FILTER_CURVES_OBJD(curves);
break;
}
case OB_POINTCLOUD: /* ---------- PointCloud ----------- */
diff --git a/source/blender/editors/animation/anim_intern.h b/source/blender/editors/animation/anim_intern.h
index fb7b6b8983a..9029c451290 100644
--- a/source/blender/editors/animation/anim_intern.h
+++ b/source/blender/editors/animation/anim_intern.h
@@ -13,7 +13,7 @@
* 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, Joshua Leung
+ * The Original Code is Copyright (C) 2009, Blender Foundation, Joshua Leung.
* This is a new part of Blender (with some old code)
*/
diff --git a/source/blender/editors/armature/armature_add.c b/source/blender/editors/armature/armature_add.c
index 4a327904ddd..e1d4b5fec73 100644
--- a/source/blender/editors/armature/armature_add.c
+++ b/source/blender/editors/armature/armature_add.c
@@ -15,11 +15,11 @@
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
- * Operators and API's for creating bones
*/
/** \file
* \ingroup edarmature
+ * Operators and API's for creating bones.
*/
#include "DNA_anim_types.h"
@@ -859,14 +859,28 @@ static void updateDuplicateCustomBoneShapes(bContext *C, EditBone *dup_bone, Obj
Main *bmain = CTX_data_main(C);
char name_flip[MAX_ID_NAME - 2];
+ /* Invert the X location */
+ pchan->custom_translation[0] *= -1;
+ /* Invert the Y rotation */
+ pchan->custom_rotation_euler[1] *= -1;
+ /* Invert the Z rotation */
+ pchan->custom_rotation_euler[2] *= -1;
+
/* Skip the first two chars in the object name as those are used to store object type */
BLI_string_flip_side_name(name_flip, pchan->custom->id.name + 2, false, sizeof(name_flip));
Object *shape_ob = (Object *)BKE_libblock_find_name(bmain, ID_OB, name_flip);
+ /* If name_flip doesn't exist, BKE_libblock_find_name() returns pchan->custom (best match) */
+ shape_ob = shape_ob == pchan->custom ? NULL : shape_ob;
+
if (shape_ob != NULL) {
/* A flipped shape object exists, use it! */
pchan->custom = shape_ob;
}
+ else {
+ /* Flip shape */
+ pchan->custom_scale_xyz[0] *= -1;
+ }
}
}
diff --git a/source/blender/editors/armature/armature_edit.c b/source/blender/editors/armature/armature_edit.c
index b709980cabe..0094783e50f 100644
--- a/source/blender/editors/armature/armature_edit.c
+++ b/source/blender/editors/armature/armature_edit.c
@@ -15,11 +15,11 @@
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
- * Armature EditMode tools - transforms, chain based editing, and other settings
*/
/** \file
* \ingroup edarmature
+ * Armature EditMode tools - transforms, chain based editing, and other settings.
*/
#include "DNA_armature_types.h"
diff --git a/source/blender/editors/armature/armature_naming.c b/source/blender/editors/armature/armature_naming.c
index 750c64d74a7..c45c6297d86 100644
--- a/source/blender/editors/armature/armature_naming.c
+++ b/source/blender/editors/armature/armature_naming.c
@@ -15,11 +15,11 @@
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
- * Operators and API's for renaming bones both in and out of Edit Mode
*/
/** \file
* \ingroup edarmature
+ * Operators and API's for renaming bones both in and out of Edit Mode.
*
* This file contains functions/API's for renaming bones and/or working with them.
*/
diff --git a/source/blender/editors/armature/armature_relations.c b/source/blender/editors/armature/armature_relations.c
index eebe8a447f7..17d25aec198 100644
--- a/source/blender/editors/armature/armature_relations.c
+++ b/source/blender/editors/armature/armature_relations.c
@@ -15,11 +15,11 @@
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
- * Operators for relations between bones and for transferring bones between armature objects
*/
/** \file
* \ingroup edarmature
+ * Operators for relations between bones and for transferring bones between armature objects.
*/
#include "MEM_guardedalloc.h"
diff --git a/source/blender/editors/armature/armature_select.c b/source/blender/editors/armature/armature_select.c
index f9b52eb53ed..111989f1d86 100644
--- a/source/blender/editors/armature/armature_select.c
+++ b/source/blender/editors/armature/armature_select.c
@@ -15,11 +15,11 @@
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
- * API's and Operators for selecting armature bones in EditMode
*/
/** \file
* \ingroup edarmature
+ * API's and Operators for selecting armature bones in EditMode.
*/
#include "MEM_guardedalloc.h"
diff --git a/source/blender/editors/armature/armature_skinning.c b/source/blender/editors/armature/armature_skinning.c
index ec5c665402b..9ef198f442c 100644
--- a/source/blender/editors/armature/armature_skinning.c
+++ b/source/blender/editors/armature/armature_skinning.c
@@ -15,12 +15,12 @@
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
- * API's for creating vertex groups from bones
- * - Interfaces with heat weighting in meshlaplacian
*/
/** \file
* \ingroup edarmature
+ * API's for creating vertex groups from bones
+ * - Interfaces with heat weighting in meshlaplacian.
*/
#include "DNA_armature_types.h"
diff --git a/source/blender/editors/armature/meshlaplacian.c b/source/blender/editors/armature/meshlaplacian.c
index 14f47a84286..b3b6c37cf61 100644
--- a/source/blender/editors/armature/meshlaplacian.c
+++ b/source/blender/editors/armature/meshlaplacian.c
@@ -12,11 +12,11 @@
* 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.
- * meshlaplacian.c: Algorithms using the mesh laplacian.
*/
/** \file
* \ingroup edarmature
+ * Algorithms using the mesh laplacian.
*/
#include "MEM_guardedalloc.h"
diff --git a/source/blender/editors/armature/meshlaplacian.h b/source/blender/editors/armature/meshlaplacian.h
index 7e7b64c7510..f024b17f1cc 100644
--- a/source/blender/editors/armature/meshlaplacian.h
+++ b/source/blender/editors/armature/meshlaplacian.h
@@ -12,12 +12,11 @@
* 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.
- *
- * BIF_meshlaplacian.h: Algorithms using the mesh laplacian.
*/
/** \file
* \ingroup edarmature
+ * BIF_meshlaplacian.h: Algorithms using the mesh laplacian.
*/
#pragma once
diff --git a/source/blender/editors/armature/pose_edit.c b/source/blender/editors/armature/pose_edit.c
index cc99027c470..5db4a4b6eaa 100644
--- a/source/blender/editors/armature/pose_edit.c
+++ b/source/blender/editors/armature/pose_edit.c
@@ -15,11 +15,11 @@
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
- * Pose Mode API's and Operators for Pose Mode armatures
*/
/** \file
* \ingroup edarmature
+ * Pose Mode API's and Operators for Pose Mode armatures.
*/
#include "MEM_guardedalloc.h"
diff --git a/source/blender/editors/armature/pose_group.c b/source/blender/editors/armature/pose_group.c
index 466c423c27c..10ffa3fcae2 100644
--- a/source/blender/editors/armature/pose_group.c
+++ b/source/blender/editors/armature/pose_group.c
@@ -15,11 +15,11 @@
*
* The Original Code is Copyright (C) 2008 Blender Foundation
* All rights reserved.
- * Implementation of Bone Groups operators and editing API's
*/
/** \file
* \ingroup edarmature
+ * Implementation of Bone Groups operators and editing API's.
*/
#include <string.h>
diff --git a/source/blender/editors/asset/intern/asset_list.cc b/source/blender/editors/asset/intern/asset_list.cc
index c075ae390d9..fa0946ffe3d 100644
--- a/source/blender/editors/asset/intern/asset_list.cc
+++ b/source/blender/editors/asset/intern/asset_list.cc
@@ -41,6 +41,7 @@
#include "WM_api.h"
/* XXX uses private header of file-space. */
+#include "../space_file/file_indexer.h"
#include "../space_file/filelist.h"
#include "ED_asset_handle.h"
@@ -170,7 +171,8 @@ void AssetList::setup()
"",
"");
- filelist_setindexer(files, &file_indexer_asset);
+ const bool use_asset_indexer = !USER_EXPERIMENTAL_TEST(&U, no_asset_indexing);
+ filelist_setindexer(files, use_asset_indexer ? &file_indexer_asset : &file_indexer_noop);
char path[FILE_MAXDIR] = "";
if (user_library) {
diff --git a/source/blender/editors/gpencil/annotate_paint.c b/source/blender/editors/gpencil/annotate_paint.c
index e75e9314659..042fe5d3806 100644
--- a/source/blender/editors/gpencil/annotate_paint.c
+++ b/source/blender/editors/gpencil/annotate_paint.c
@@ -13,7 +13,7 @@
* 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) 2008/2018, Blender Foundation
+ * The Original Code is Copyright (C) 2008-2018, Blender Foundation
* This is a new part of Blender
*/
diff --git a/source/blender/editors/gpencil/gpencil_convert.c b/source/blender/editors/gpencil/gpencil_convert.c
index bf414851aed..8e7a0083ded 100644
--- a/source/blender/editors/gpencil/gpencil_convert.c
+++ b/source/blender/editors/gpencil/gpencil_convert.c
@@ -15,11 +15,11 @@
*
* The Original Code is Copyright (C) 2008, Blender Foundation
* This is a new part of Blender
- * Operator for converting Grease Pencil data to geometry
*/
/** \file
* \ingroup edgpencil
+ * Operator for converting Grease Pencil data to geometry.
*/
#include <math.h>
diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c
index c910162415d..dda36cf78d9 100644
--- a/source/blender/editors/gpencil/gpencil_edit.c
+++ b/source/blender/editors/gpencil/gpencil_edit.c
@@ -15,11 +15,11 @@
*
* The Original Code is Copyright (C) 2008, Blender Foundation
* This is a new part of Blender
- * Operators for editing Grease Pencil strokes
*/
/** \file
* \ingroup edgpencil
+ * Operators for editing Grease Pencil strokes.
*/
#include <math.h>
diff --git a/source/blender/editors/gpencil/gpencil_edit_curve.c b/source/blender/editors/gpencil/gpencil_edit_curve.c
index 2d7497357f2..5002623fbb1 100644
--- a/source/blender/editors/gpencil/gpencil_edit_curve.c
+++ b/source/blender/editors/gpencil/gpencil_edit_curve.c
@@ -15,11 +15,11 @@
*
* The Original Code is Copyright (C) 2008, Blender Foundation
* This is a new part of Blender
- * Operators for editing Grease Pencil strokes
*/
/** \file
* \ingroup edgpencil
+ * Operators for editing Grease Pencil strokes.
*/
#include <math.h>
diff --git a/source/blender/editors/gpencil/gpencil_interpolate.c b/source/blender/editors/gpencil/gpencil_interpolate.c
index 2023ae5fe27..2d88461fb15 100644
--- a/source/blender/editors/gpencil/gpencil_interpolate.c
+++ b/source/blender/editors/gpencil/gpencil_interpolate.c
@@ -15,11 +15,11 @@
*
* The Original Code is Copyright (C) 2016, Blender Foundation
* This is a new part of Blender
- * Operators for interpolating new Grease Pencil frames from existing strokes
*/
/** \file
* \ingroup edgpencil
+ * Operators for interpolating new Grease Pencil frames from existing strokes.
*/
#include <math.h>
diff --git a/source/blender/editors/gpencil/gpencil_merge.c b/source/blender/editors/gpencil/gpencil_merge.c
index 925c2e1cd7f..884167d7496 100644
--- a/source/blender/editors/gpencil/gpencil_merge.c
+++ b/source/blender/editors/gpencil/gpencil_merge.c
@@ -15,11 +15,11 @@
*
* The Original Code is Copyright (C) 2019, Blender Foundation.
* This is a new part of Blender
- * Operators for merge Grease Pencil strokes
*/
/** \file
* \ingroup edgpencil
+ * Operators for merge Grease Pencil strokes.
*/
#include <stdio.h>
diff --git a/source/blender/editors/gpencil/gpencil_mesh.c b/source/blender/editors/gpencil/gpencil_mesh.c
index efe29e852f2..adf76e79c2a 100644
--- a/source/blender/editors/gpencil/gpencil_mesh.c
+++ b/source/blender/editors/gpencil/gpencil_mesh.c
@@ -15,11 +15,11 @@
*
* The Original Code is Copyright (C) 2008, Blender Foundation
* This is a new part of Blender
- * Operator for converting Grease Pencil data to geometry
*/
/** \file
* \ingroup edgpencil
+ * Operator for converting Grease Pencil data to geometry.
*/
#include "MEM_guardedalloc.h"
diff --git a/source/blender/editors/gpencil/gpencil_ops_versioning.c b/source/blender/editors/gpencil/gpencil_ops_versioning.c
index 45842c28dff..d9706c281ca 100644
--- a/source/blender/editors/gpencil/gpencil_ops_versioning.c
+++ b/source/blender/editors/gpencil/gpencil_ops_versioning.c
@@ -15,11 +15,11 @@
*
* The Original Code is Copyright (C) 2018, Blender Foundation,
* This is a new part of Blender
- * Use deprecated data to convert old 2.7x files
*/
/** \file
* \ingroup edgpencil
+ * Use deprecated data to convert old 2.7x files.
*/
/* Allow using deprecated functionality. */
diff --git a/source/blender/editors/gpencil/gpencil_primitive.c b/source/blender/editors/gpencil/gpencil_primitive.c
index 2715491414a..fa31dfffbc1 100644
--- a/source/blender/editors/gpencil/gpencil_primitive.c
+++ b/source/blender/editors/gpencil/gpencil_primitive.c
@@ -15,11 +15,11 @@
*
* The Original Code is Copyright (C) 2017, Blender Foundation
* This is a new part of Blender
- * Operators for creating new Grease Pencil primitives (boxes, circles, ...)
*/
/** \file
* \ingroup edgpencil
+ * Operators for creating new Grease Pencil primitives (boxes, circles, ...).
*/
#include <math.h>
diff --git a/source/blender/editors/gpencil/gpencil_sculpt_paint.c b/source/blender/editors/gpencil/gpencil_sculpt_paint.c
index 29f34cc2d67..66b7f260f28 100644
--- a/source/blender/editors/gpencil/gpencil_sculpt_paint.c
+++ b/source/blender/editors/gpencil/gpencil_sculpt_paint.c
@@ -15,11 +15,11 @@
*
* The Original Code is Copyright (C) 2015, Blender Foundation
* This is a new part of Blender
- * Brush based operators for editing Grease Pencil strokes
*/
/** \file
* \ingroup edgpencil
+ * Brush based operators for editing Grease Pencil strokes.
*/
#include <math.h>
diff --git a/source/blender/editors/gpencil/gpencil_vertex_ops.c b/source/blender/editors/gpencil/gpencil_vertex_ops.c
index 891bd3ca5ec..d9f4cc87afc 100644
--- a/source/blender/editors/gpencil/gpencil_vertex_ops.c
+++ b/source/blender/editors/gpencil/gpencil_vertex_ops.c
@@ -15,11 +15,11 @@
*
* The Original Code is Copyright (C) 2015, Blender Foundation
* This is a new part of Blender
- * Brush based operators for editing Grease Pencil strokes
*/
/** \file
* \ingroup edgpencil
+ * Brush based operators for editing Grease Pencil strokes.
*/
#include "MEM_guardedalloc.h"
diff --git a/source/blender/editors/gpencil/gpencil_vertex_paint.c b/source/blender/editors/gpencil/gpencil_vertex_paint.c
index 05304f9914f..2c16894354e 100644
--- a/source/blender/editors/gpencil/gpencil_vertex_paint.c
+++ b/source/blender/editors/gpencil/gpencil_vertex_paint.c
@@ -15,11 +15,11 @@
*
* The Original Code is Copyright (C) 2015, Blender Foundation
* This is a new part of Blender
- * Brush based operators for editing Grease Pencil strokes
*/
/** \file
* \ingroup edgpencil
+ * Brush based operators for editing Grease Pencil strokes.
*/
#include "MEM_guardedalloc.h"
diff --git a/source/blender/editors/gpencil/gpencil_weight_paint.c b/source/blender/editors/gpencil/gpencil_weight_paint.c
index 15f99d83f6d..fe4ab648581 100644
--- a/source/blender/editors/gpencil/gpencil_weight_paint.c
+++ b/source/blender/editors/gpencil/gpencil_weight_paint.c
@@ -15,11 +15,11 @@
*
* The Original Code is Copyright (C) 2015, Blender Foundation
* This is a new part of Blender
- * Brush based operators for editing Grease Pencil strokes
*/
/** \file
* \ingroup edgpencil
+ * Brush based operators for editing Grease Pencil strokes.
*/
#include "MEM_guardedalloc.h"
diff --git a/source/blender/editors/include/ED_anim_api.h b/source/blender/editors/include/ED_anim_api.h
index 3294316f880..04a892ab411 100644
--- a/source/blender/editors/include/ED_anim_api.h
+++ b/source/blender/editors/include/ED_anim_api.h
@@ -378,7 +378,7 @@ typedef enum eAnimFilter_Flags {
#define FILTER_MESH_OBJD(me) (CHECK_TYPE_INLINE(me, Mesh *), ((me->flag & ME_DS_EXPAND)))
#define FILTER_LATTICE_OBJD(lt) (CHECK_TYPE_INLINE(lt, Lattice *), ((lt->flag & LT_DS_EXPAND)))
#define FILTER_SPK_OBJD(spk) (CHECK_TYPE_INLINE(spk, Speaker *), ((spk->flag & SPK_DS_EXPAND)))
-#define FILTER_HAIR_OBJD(ha) (CHECK_TYPE_INLINE(ha, Hair *), ((ha->flag & HA_DS_EXPAND)))
+#define FILTER_CURVES_OBJD(ha) (CHECK_TYPE_INLINE(ha, Curves *), ((ha->flag & HA_DS_EXPAND)))
#define FILTER_POINTS_OBJD(pt) (CHECK_TYPE_INLINE(pt, PointCloud *), ((pt->flag & PT_DS_EXPAND)))
#define FILTER_VOLUME_OBJD(vo) (CHECK_TYPE_INLINE(vo, Volume *), ((vo->flag & VO_DS_EXPAND)))
#define FILTER_SIMULATION_OBJD(sim) \
diff --git a/source/blender/editors/include/ED_keyframing.h b/source/blender/editors/include/ED_keyframing.h
index 8d89555c732..22a6bdb27ba 100644
--- a/source/blender/editors/include/ED_keyframing.h
+++ b/source/blender/editors/include/ED_keyframing.h
@@ -14,7 +14,6 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* The Original Code is Copyright (C) 2008, Blender Foundation
- * This is a new part of Blender (with some old code)
*/
/** \file
diff --git a/source/blender/editors/include/UI_icons.h b/source/blender/editors/include/UI_icons.h
index 4cf606bf98d..05353de2f92 100644
--- a/source/blender/editors/include/UI_icons.h
+++ b/source/blender/editors/include/UI_icons.h
@@ -752,9 +752,9 @@ DEF_ICON_BLANK(257)
DEF_ICON_BLANK(257b)
/* ADDITIONAL OBJECT TYPES */
-DEF_ICON_OBJECT(OUTLINER_OB_HAIR)
-DEF_ICON_OBJECT_DATA(OUTLINER_DATA_HAIR)
-DEF_ICON_OBJECT_DATA(HAIR_DATA)
+DEF_ICON_OBJECT(OUTLINER_OB_CURVES)
+DEF_ICON_OBJECT_DATA(OUTLINER_DATA_CURVES)
+DEF_ICON_OBJECT_DATA(CURVES_DATA)
DEF_ICON_OBJECT(OUTLINER_OB_POINTCLOUD)
DEF_ICON_OBJECT_DATA(OUTLINER_DATA_POINTCLOUD)
DEF_ICON_OBJECT_DATA(POINTCLOUD_DATA)
@@ -840,7 +840,7 @@ DEF_ICON(MATPLANE)
DEF_ICON(MATSPHERE)
DEF_ICON(MATCUBE)
DEF_ICON(MONKEY)
-DEF_ICON(HAIR)
+DEF_ICON(CURVES)
DEF_ICON(ALIASED)
DEF_ICON(ANTIALIASED)
DEF_ICON(MAT_SPHERE_SKY)
diff --git a/source/blender/editors/include/UI_view2d.h b/source/blender/editors/include/UI_view2d.h
index a3f39e1286e..0a28b1cafe1 100644
--- a/source/blender/editors/include/UI_view2d.h
+++ b/source/blender/editors/include/UI_view2d.h
@@ -15,12 +15,12 @@
*
* The Original Code is Copyright (C) 2008 Blender Foundation.
* All rights reserved.
- * Generic 2d view with should allow drawing grids,
- * panning, zooming, scrolling, ..
*/
/** \file
* \ingroup editorui
+ * Generic 2D view with should allow drawing grids,
+ * panning, zooming, scrolling, .. etc.
*/
#pragma once
diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c
index c0d6b8a1a6c..d7d3288a68d 100644
--- a/source/blender/editors/interface/interface_icons.c
+++ b/source/blender/editors/interface/interface_icons.c
@@ -2335,8 +2335,8 @@ int UI_icon_from_idcode(const int idcode)
return ICON_TEXT;
case ID_VF:
return ICON_FONT_DATA;
- case ID_HA:
- return ICON_HAIR_DATA;
+ case ID_CV:
+ return ICON_CURVES_DATA;
case ID_PT:
return ICON_POINTCLOUD_DATA;
case ID_VO:
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index d605847c270..03d0cba5ec8 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -667,6 +667,13 @@ static void template_id_cb(bContext *C, void *arg_litem, void *arg_event)
/* Assign new pointer, takes care of updates/notifiers */
RNA_id_pointer_create(override_id, &idptr);
+ /* Insert into override hierarchy if possible. */
+ ID *owner_id = template_ui->ptr.owner_id;
+ if (owner_id != NULL && ID_IS_OVERRIDE_LIBRARY_REAL(owner_id)) {
+ override_id->override_library->hierarchy_root =
+ owner_id->override_library->hierarchy_root;
+ owner_id->override_library->flag &= ~IDOVERRIDE_LIBRARY_FLAG_NO_HIERARCHY;
+ }
}
undo_push_label = "Make Library Override";
}
@@ -792,8 +799,8 @@ static const char *template_id_browse_tip(const StructRNA *type)
return N_("Browse Workspace to be linked");
case ID_LP:
return N_("Browse LightProbe to be linked");
- case ID_HA:
- return N_("Browse Hair Data to be linked");
+ case ID_CV:
+ return N_("Browse Hair Curves Data to be linked");
case ID_PT:
return N_("Browse Point Cloud Data to be linked");
case ID_VO:
@@ -874,7 +881,7 @@ static uiBut *template_id_def_new_but(uiBlock *block,
BLT_I18NCONTEXT_ID_FREESTYLELINESTYLE,
BLT_I18NCONTEXT_ID_WORKSPACE,
BLT_I18NCONTEXT_ID_LIGHTPROBE,
- BLT_I18NCONTEXT_ID_HAIR,
+ BLT_I18NCONTEXT_ID_CURVES,
BLT_I18NCONTEXT_ID_POINTCLOUD,
BLT_I18NCONTEXT_ID_VOLUME,
BLT_I18NCONTEXT_ID_SIMULATION, );
diff --git a/source/blender/editors/mesh/editmesh_select_similar.c b/source/blender/editors/mesh/editmesh_select_similar.c
index 949b12f9a65..5ea3c0d7b32 100644
--- a/source/blender/editors/mesh/editmesh_select_similar.c
+++ b/source/blender/editors/mesh/editmesh_select_similar.c
@@ -68,6 +68,7 @@ static const EnumPropertyItem prop_similar_types[] = {
{SIMVERT_FACE, "FACE", 0, "Amount of Adjacent Faces", ""},
{SIMVERT_VGROUP, "VGROUP", 0, "Vertex Groups", ""},
{SIMVERT_EDGE, "EDGE", 0, "Amount of Connecting Edges", ""},
+ {SIMVERT_CREASE, "VCREASE", 0, "Vertex Crease", ""},
{SIMEDGE_LENGTH, "LENGTH", 0, "Length", ""},
{SIMEDGE_DIR, "DIR", 0, "Direction", ""},
@@ -1009,12 +1010,16 @@ static int similar_vert_select_exec(bContext *C, wmOperator *op)
}
KDTree_3d *tree_3d = NULL;
+ KDTree_1d *tree_1d = NULL;
GSet *gset = NULL;
switch (type) {
case SIMVERT_NORMAL:
tree_3d = BLI_kdtree_3d_new(tot_verts_selected_all);
break;
+ case SIMVERT_CREASE:
+ tree_1d = BLI_kdtree_1d_new(tot_verts_selected_all);
+ break;
case SIMVERT_EDGE:
case SIMVERT_FACE:
gset = BLI_gset_ptr_new("Select similar vertex: edge/face");
@@ -1025,6 +1030,7 @@ static int similar_vert_select_exec(bContext *C, wmOperator *op)
}
int normal_tree_index = 0;
+ int tree_1d_index = 0;
for (uint ob_index = 0; ob_index < objects_len; ob_index++) {
Object *ob = objects[ob_index];
BMEditMesh *em = BKE_editmesh_from_object(ob);
@@ -1050,6 +1056,12 @@ static int similar_vert_select_exec(bContext *C, wmOperator *op)
}
defbase_selected = BLI_BITMAP_NEW(defbase_len, __func__);
}
+ else if (type == SIMVERT_CREASE) {
+ if (!CustomData_has_layer(&bm->vdata, CD_CREASE)) {
+ BLI_kdtree_1d_insert(tree_1d, tree_1d_index++, (float[1]){0.0f});
+ continue;
+ }
+ }
BMVert *vert; /* Mesh vertex. */
BMIter iter; /* Selected verts iterator. */
@@ -1085,6 +1097,11 @@ static int similar_vert_select_exec(bContext *C, wmOperator *op)
}
break;
}
+ case SIMVERT_CREASE: {
+ const float *value = CustomData_bmesh_get(&bm->vdata, vert->head.data, CD_CREASE);
+ BLI_kdtree_1d_insert(tree_1d, tree_1d_index++, value);
+ break;
+ }
}
}
}
@@ -1113,6 +1130,10 @@ static int similar_vert_select_exec(bContext *C, wmOperator *op)
}
/* Remove duplicated entries. */
+ if (tree_1d != NULL) {
+ BLI_kdtree_1d_deduplicate(tree_1d);
+ BLI_kdtree_1d_balance(tree_1d);
+ }
if (tree_3d != NULL) {
BLI_kdtree_3d_deduplicate(tree_3d);
BLI_kdtree_3d_balance(tree_3d);
@@ -1124,6 +1145,7 @@ static int similar_vert_select_exec(bContext *C, wmOperator *op)
BMEditMesh *em = BKE_editmesh_from_object(ob);
BMesh *bm = em->bm;
bool changed = false;
+ bool has_crease_layer = false;
int cd_dvert_offset = -1;
BLI_bitmap *defbase_selected = NULL;
int defbase_len = 0;
@@ -1158,6 +1180,17 @@ static int similar_vert_select_exec(bContext *C, wmOperator *op)
continue;
}
}
+ else if (type == SIMVERT_CREASE) {
+ has_crease_layer = CustomData_has_layer(&bm->vdata, CD_CREASE);
+ if (!has_crease_layer) {
+ /* Proceed only if we have to select all the vertices that have custom data value of 0.0f.
+ * In this case we will just select all the vertices.
+ * Otherwise continue the for loop. */
+ if (!ED_select_similar_compare_float_tree(tree_1d, 0.0f, thresh, compare)) {
+ continue;
+ }
+ }
+ }
BMVert *vert; /* Mesh vertex. */
BMIter iter; /* Selected verts iterator. */
@@ -1224,6 +1257,17 @@ static int similar_vert_select_exec(bContext *C, wmOperator *op)
}
break;
}
+ case SIMVERT_CREASE: {
+ if (!has_crease_layer) {
+ select = true;
+ break;
+ }
+ const float *value = CustomData_bmesh_get(&bm->vdata, vert->head.data, CD_CREASE);
+ if (ED_select_similar_compare_float_tree(tree_1d, *value, thresh, compare)) {
+ select = true;
+ }
+ break;
+ }
}
if (select) {
@@ -1249,6 +1293,7 @@ static int similar_vert_select_exec(bContext *C, wmOperator *op)
}
MEM_freeN(objects);
+ BLI_kdtree_1d_free(tree_1d);
BLI_kdtree_3d_free(tree_3d);
if (gset != NULL) {
BLI_gset_free(gset, NULL);
diff --git a/source/blender/editors/object/CMakeLists.txt b/source/blender/editors/object/CMakeLists.txt
index a953c7d7f89..df76e605ebb 100644
--- a/source/blender/editors/object/CMakeLists.txt
+++ b/source/blender/editors/object/CMakeLists.txt
@@ -88,7 +88,7 @@ endif()
if(WITH_EXPERIMENTAL_FEATURES)
add_definitions(-DWITH_SIMULATION_DATABLOCK)
add_definitions(-DWITH_POINT_CLOUD)
- add_definitions(-DWITH_HAIR_NODES)
+ add_definitions(-DWITH_NEW_CURVES_TYPE)
endif()
blender_add_lib(bf_editor_object "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c
index 0f1b0f5bdc0..d1deb6824ea 100644
--- a/source/blender/editors/object/object_add.c
+++ b/source/blender/editors/object/object_add.c
@@ -62,6 +62,7 @@
#include "BKE_constraint.h"
#include "BKE_context.h"
#include "BKE_curve.h"
+#include "BKE_curves.h"
#include "BKE_displist.h"
#include "BKE_duplilist.h"
#include "BKE_effect.h"
@@ -69,7 +70,6 @@
#include "BKE_gpencil_curve.h"
#include "BKE_gpencil_geom.h"
#include "BKE_gpencil_modifier.h"
-#include "BKE_hair.h"
#include "BKE_key.h"
#include "BKE_lattice.h"
#include "BKE_layer.h"
@@ -1894,18 +1894,18 @@ void OBJECT_OT_speaker_add(wmOperatorType *ot)
/** \} */
/* -------------------------------------------------------------------- */
-/** \name Add Hair Operator
+/** \name Add Hair Curves Operator
* \{ */
-static bool object_hair_add_poll(bContext *C)
+static bool object_hair_curves_add_poll(bContext *C)
{
- if (!U.experimental.use_new_hair_type) {
+ if (!U.experimental.use_new_curves_type) {
return false;
}
return ED_operator_objectmode(C);
}
-static int object_hair_add_exec(bContext *C, wmOperator *op)
+static int object_hair_curves_add_exec(bContext *C, wmOperator *op)
{
ushort local_view_bits;
float loc[3], rot[3];
@@ -1913,22 +1913,22 @@ static int object_hair_add_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
- Object *object = ED_object_add_type(C, OB_HAIR, NULL, loc, rot, false, local_view_bits);
+ Object *object = ED_object_add_type(C, OB_CURVES, NULL, loc, rot, false, local_view_bits);
object->dtx |= OB_DRAWBOUNDOX; /* TODO: remove once there is actual drawing. */
return OPERATOR_FINISHED;
}
-void OBJECT_OT_hair_add(wmOperatorType *ot)
+void OBJECT_OT_hair_curves_add(wmOperatorType *ot)
{
/* identifiers */
- ot->name = "Add Hair";
- ot->description = "Add a hair object to the scene";
- ot->idname = "OBJECT_OT_hair_add";
+ ot->name = "Add Hair Curves";
+ ot->description = "Add a hair curves object to the scene";
+ ot->idname = "OBJECT_OT_hair_curves_add";
/* api callbacks */
- ot->exec = object_hair_add_exec;
- ot->poll = object_hair_add_poll;
+ ot->exec = object_hair_curves_add_exec;
+ ot->poll = object_hair_curves_add_poll;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
diff --git a/source/blender/editors/object/object_intern.h b/source/blender/editors/object/object_intern.h
index f478f5004d4..ddd44fb9ded 100644
--- a/source/blender/editors/object/object_intern.h
+++ b/source/blender/editors/object/object_intern.h
@@ -129,7 +129,7 @@ void OBJECT_OT_light_add(struct wmOperatorType *ot);
void OBJECT_OT_effector_add(struct wmOperatorType *ot);
void OBJECT_OT_camera_add(struct wmOperatorType *ot);
void OBJECT_OT_speaker_add(struct wmOperatorType *ot);
-void OBJECT_OT_hair_add(struct wmOperatorType *ot);
+void OBJECT_OT_hair_curves_add(struct wmOperatorType *ot);
void OBJECT_OT_pointcloud_add(struct wmOperatorType *ot);
/**
* Only used as menu.
diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c
index 775fac96d57..af428512cfd 100644
--- a/source/blender/editors/object/object_modifier.c
+++ b/source/blender/editors/object/object_modifier.c
@@ -53,12 +53,12 @@
#include "BKE_armature.h"
#include "BKE_context.h"
#include "BKE_curve.h"
+#include "BKE_curves.h"
#include "BKE_displist.h"
#include "BKE_editmesh.h"
#include "BKE_effect.h"
#include "BKE_global.h"
#include "BKE_gpencil_modifier.h"
-#include "BKE_hair.h"
#include "BKE_key.h"
#include "BKE_lattice.h"
#include "BKE_lib_id.h"
@@ -132,8 +132,8 @@ static void object_force_modifier_update_for_bind(Depsgraph *depsgraph, Object *
else if (ob->type == OB_GPENCIL) {
BKE_gpencil_modifiers_calc(depsgraph, scene_eval, ob_eval);
}
- else if (ob->type == OB_HAIR) {
- BKE_hair_data_update(depsgraph, scene_eval, ob);
+ else if (ob->type == OB_CURVES) {
+ BKE_curves_data_update(depsgraph, scene_eval, ob);
}
else if (ob->type == OB_POINTCLOUD) {
BKE_pointcloud_data_update(depsgraph, scene_eval, ob);
diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c
index 03a36006fea..a9a429e7e6f 100644
--- a/source/blender/editors/object/object_ops.c
+++ b/source/blender/editors/object/object_ops.c
@@ -105,7 +105,7 @@ void ED_operatortypes_object(void)
WM_operatortype_append(OBJECT_OT_light_add);
WM_operatortype_append(OBJECT_OT_camera_add);
WM_operatortype_append(OBJECT_OT_speaker_add);
- WM_operatortype_append(OBJECT_OT_hair_add);
+ WM_operatortype_append(OBJECT_OT_hair_curves_add);
WM_operatortype_append(OBJECT_OT_pointcloud_add);
WM_operatortype_append(OBJECT_OT_volume_add);
WM_operatortype_append(OBJECT_OT_volume_import);
diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c
index 57a0fe0a39d..8678bf9bd92 100644
--- a/source/blender/editors/object/object_relations.c
+++ b/source/blender/editors/object/object_relations.c
@@ -63,11 +63,11 @@
#include "BKE_constraint.h"
#include "BKE_context.h"
#include "BKE_curve.h"
+#include "BKE_curves.h"
#include "BKE_displist.h"
#include "BKE_editmesh.h"
#include "BKE_fcurve.h"
#include "BKE_gpencil.h"
-#include "BKE_hair.h"
#include "BKE_idprop.h"
#include "BKE_idtype.h"
#include "BKE_lattice.h"
@@ -1872,7 +1872,7 @@ static void single_obdata_users(
ob->data,
BKE_id_copy_ex(bmain, ob->data, NULL, LIB_ID_COPY_DEFAULT | LIB_ID_COPY_ACTIONS));
break;
- case OB_HAIR:
+ case OB_CURVES:
ob->data = ID_NEW_SET(
ob->data,
BKE_id_copy_ex(bmain, ob->data, NULL, LIB_ID_COPY_DEFAULT | LIB_ID_COPY_ACTIONS));
diff --git a/source/blender/editors/render/render_opengl.cc b/source/blender/editors/render/render_opengl.cc
index c4ce8bac126..fb6742c9fd5 100644
--- a/source/blender/editors/render/render_opengl.cc
+++ b/source/blender/editors/render/render_opengl.cc
@@ -635,7 +635,7 @@ static int gather_frames_to_render_for_id(LibraryIDLinkCallbackData *cb_data)
case ID_MC: /* MovieClip */
case ID_MSK: /* Mask */
case ID_LP: /* LightProbe */
- case ID_HA: /* Hair */
+ case ID_CV: /* Curves */
case ID_PT: /* PointCloud */
case ID_VO: /* Volume */
case ID_SIM: /* Simulation */
diff --git a/source/blender/editors/screen/screendump.c b/source/blender/editors/screen/screendump.c
index 4bc9f1e2565..2b16b70d1ef 100644
--- a/source/blender/editors/screen/screendump.c
+++ b/source/blender/editors/screen/screendump.c
@@ -15,11 +15,11 @@
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
- * Making screendumps.
*/
/** \file
* \ingroup edscr
+ * Making screenshots of the entire window or sub-regions.
*/
#include <errno.h>
diff --git a/source/blender/editors/sculpt_paint/paint_hide.c b/source/blender/editors/sculpt_paint/paint_hide.c
index da627c6b7db..805d2221f6f 100644
--- a/source/blender/editors/sculpt_paint/paint_hide.c
+++ b/source/blender/editors/sculpt_paint/paint_hide.c
@@ -15,11 +15,11 @@
*
* The Original Code is Copyright (C) 2010 by Nicholas Bishop
* All rights reserved.
- * Implements the PBVH node hiding operator
*/
/** \file
* \ingroup edsculpt
+ * Implements the PBVH node hiding operator.
*/
#include "MEM_guardedalloc.h"
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c
index a912bb5cf3b..d5aa7647603 100644
--- a/source/blender/editors/sculpt_paint/paint_image.c
+++ b/source/blender/editors/sculpt_paint/paint_image.c
@@ -14,8 +14,6 @@
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
- *
- * The Original Code is: some of this file.
*/
/** \file
diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c
index f05cd4c3d5f..4d23119dd5f 100644
--- a/source/blender/editors/sculpt_paint/paint_image_proj.c
+++ b/source/blender/editors/sculpt_paint/paint_image_proj.c
@@ -14,8 +14,6 @@
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
- *
- * The Original Code is: some of this file.
*/
/** \file
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index 07e26a3d931..ea3d694542c 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -15,11 +15,11 @@
*
* The Original Code is Copyright (C) 2006 by Nicholas Bishop
* All rights reserved.
- * Implements the Sculpt Mode tools
*/
/** \file
* \ingroup edsculpt
+ * Implements the Sculpt Mode tools.
*/
#include "MEM_guardedalloc.h"
diff --git a/source/blender/editors/sculpt_paint/sculpt_brush_types.c b/source/blender/editors/sculpt_paint/sculpt_brush_types.c
index c2acc361a79..0d2c5641183 100644
--- a/source/blender/editors/sculpt_paint/sculpt_brush_types.c
+++ b/source/blender/editors/sculpt_paint/sculpt_brush_types.c
@@ -15,11 +15,11 @@
*
* The Original Code is Copyright (C) 2006 by Nicholas Bishop
* All rights reserved.
- * Implements the Sculpt Mode tools
*/
/** \file
* \ingroup edsculpt
+ * Implements the Sculpt Mode tools.
*/
#include "MEM_guardedalloc.h"
diff --git a/source/blender/editors/sculpt_paint/sculpt_ops.c b/source/blender/editors/sculpt_paint/sculpt_ops.c
index 119d246a770..f50775f8a32 100644
--- a/source/blender/editors/sculpt_paint/sculpt_ops.c
+++ b/source/blender/editors/sculpt_paint/sculpt_ops.c
@@ -15,11 +15,11 @@
*
* The Original Code is Copyright (C) 2006 by Nicholas Bishop
* All rights reserved.
- * Implements the Sculpt Mode tools
*/
/** \file
* \ingroup edsculpt
+ * Implements the Sculpt Mode tools.
*/
#include "MEM_guardedalloc.h"
diff --git a/source/blender/editors/sculpt_paint/sculpt_undo.c b/source/blender/editors/sculpt_paint/sculpt_undo.c
index 8819496c168..0b64d1f8a35 100644
--- a/source/blender/editors/sculpt_paint/sculpt_undo.c
+++ b/source/blender/editors/sculpt_paint/sculpt_undo.c
@@ -15,11 +15,11 @@
*
* The Original Code is Copyright (C) 2006 by Nicholas Bishop
* All rights reserved.
- * Implements the Sculpt Mode tools
*/
/** \file
* \ingroup edsculpt
+ * Implements the Sculpt Mode tools.
*/
#include <stddef.h>
diff --git a/source/blender/editors/sculpt_paint/sculpt_uv.c b/source/blender/editors/sculpt_paint/sculpt_uv.c
index e5ca5e4defd..35ad582d4ec 100644
--- a/source/blender/editors/sculpt_paint/sculpt_uv.c
+++ b/source/blender/editors/sculpt_paint/sculpt_uv.c
@@ -13,13 +13,13 @@
* 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) Blender Foundation, 2002-2009
+ * The Original Code is Copyright (C) 2002-2009, Blender Foundation
* All rights reserved.
- * UV Sculpt tools
*/
/** \file
* \ingroup edsculpt
+ * UV Sculpt tools.
*/
#include "MEM_guardedalloc.h"
diff --git a/source/blender/editors/space_api/spacetypes.c b/source/blender/editors/space_api/spacetypes.c
index f8adba30547..b786cada908 100644
--- a/source/blender/editors/space_api/spacetypes.c
+++ b/source/blender/editors/space_api/spacetypes.c
@@ -13,7 +13,7 @@
* 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) Blender Foundation, 2008
+ * The Original Code is Copyright (C) 2008, Blender Foundation
*/
/** \file
diff --git a/source/blender/editors/space_buttons/CMakeLists.txt b/source/blender/editors/space_buttons/CMakeLists.txt
index e2b2579c256..14cc03e3120 100644
--- a/source/blender/editors/space_buttons/CMakeLists.txt
+++ b/source/blender/editors/space_buttons/CMakeLists.txt
@@ -48,7 +48,7 @@ endif()
if(WITH_EXPERIMENTAL_FEATURES)
add_definitions(-DWITH_SIMULATION_DATABLOCK)
add_definitions(-DWITH_POINT_CLOUD)
- add_definitions(-DWITH_HAIR_NODES)
+ add_definitions(-DWITH_NEW_CURVES_TYPE)
endif()
blender_add_lib(bf_editor_space_buttons "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c
index f5107cb13fd..b83396b10d9 100644
--- a/source/blender/editors/space_buttons/buttons_context.c
+++ b/source/blender/editors/space_buttons/buttons_context.c
@@ -273,8 +273,8 @@ static bool buttons_context_path_data(ButsContextPath *path, int type)
if (RNA_struct_is_a(ptr->type, &RNA_GreasePencil) && (ELEM(type, -1, OB_GPENCIL))) {
return true;
}
-#ifdef WITH_HAIR_NODES
- if (RNA_struct_is_a(ptr->type, &RNA_Hair) && (ELEM(type, -1, OB_HAIR))) {
+#ifdef WITH_NEW_CURVES_TYPE
+ if (RNA_struct_is_a(ptr->type, &RNA_Curves) && (ELEM(type, -1, OB_CURVES))) {
return true;
}
#endif
@@ -314,7 +314,7 @@ static bool buttons_context_path_modifier(ButsContextPath *path)
OB_SURF,
OB_LATTICE,
OB_GPENCIL,
- OB_HAIR,
+ OB_CURVES,
OB_POINTCLOUD,
OB_VOLUME)) {
ModifierData *md = BKE_object_active_modifier(ob);
@@ -845,8 +845,8 @@ const char *buttons_context_dir[] = {
"line_style",
"collection",
"gpencil",
-#ifdef WITH_HAIR_NODES
- "hair",
+#ifdef WITH_NEW_CURVES_TYPE
+ "curves",
#endif
#ifdef WITH_POINT_CLOUD
"pointcloud",
@@ -941,9 +941,9 @@ int /*eContextResult*/ buttons_context(const bContext *C,
set_pointer_type(path, result, &RNA_LightProbe);
return CTX_RESULT_OK;
}
-#ifdef WITH_HAIR_NODES
- if (CTX_data_equals(member, "hair")) {
- set_pointer_type(path, result, &RNA_Hair);
+#ifdef WITH_NEW_CURVES_TYPE
+ if (CTX_data_equals(member, "curves")) {
+ set_pointer_type(path, result, &RNA_Curves);
return CTX_RESULT_OK;
}
#endif
diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c
index 044d7aba88f..6be17bbd355 100644
--- a/source/blender/editors/space_file/filelist.c
+++ b/source/blender/editors/space_file/filelist.c
@@ -2783,7 +2783,8 @@ int ED_path_extension_type(const char *path)
NULL)) {
return FILE_TYPE_TEXT;
}
- if (BLI_path_extension_check_n(path, ".ttf", ".ttc", ".pfb", ".otf", ".otc", NULL)) {
+ if (BLI_path_extension_check_n(
+ path, ".ttf", ".ttc", ".pfb", ".otf", ".otc", ".woff", ".woff2", NULL)) {
return FILE_TYPE_FTFONT;
}
if (BLI_path_extension_check(path, ".btx")) {
diff --git a/source/blender/editors/space_file/fsmenu.c b/source/blender/editors/space_file/fsmenu.c
index 0a69d0f9b39..e95e3bef8a8 100644
--- a/source/blender/editors/space_file/fsmenu.c
+++ b/source/blender/editors/space_file/fsmenu.c
@@ -790,7 +790,7 @@ void fsmenu_read_system(struct FSMenu *fsmenu, int read_bookmarks)
}
/* Get mounted volumes better method OSX 10.6 and higher, see:
- * https://developer.apple.com/library/mac/#documentation/CoreFOundation/Reference/CFURLRef/Reference/reference.html
+ * https://developer.apple.com/library/mac/#documentation/CoreFoundation/Reference/CFURLRef/Reference/reference.html
*/
/* We get all volumes sorted including network and do not relay
diff --git a/source/blender/editors/space_info/info_stats.cc b/source/blender/editors/space_info/info_stats.cc
index 005ae0214cd..a1eacc2bc3a 100644
--- a/source/blender/editors/space_info/info_stats.cc
+++ b/source/blender/editors/space_info/info_stats.cc
@@ -219,7 +219,7 @@ static void stats_object(Object *ob,
}
break;
}
- case OB_HAIR:
+ case OB_CURVES:
case OB_POINTCLOUD:
case OB_VOLUME: {
break;
diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c
index 1376dade659..28041c0389f 100644
--- a/source/blender/editors/space_nla/nla_edit.c
+++ b/source/blender/editors/space_nla/nla_edit.c
@@ -1397,8 +1397,11 @@ static void nlaedit_split_strip_actclip(
nstrip->actstart = splitaframe;
}
- /* clear the active flag from the copy */
- nstrip->flag &= ~NLASTRIP_FLAG_ACTIVE;
+ /* Make sure Sync Length is off. With that setting on, entering and exiting tweak mode would
+ * effectively undo the split, because both the old and the new strip will be at the length of
+ * the Action again. */
+ strip->flag &= ~NLASTRIP_FLAG_SYNC_LENGTH;
+ nstrip->flag &= ~(NLASTRIP_FLAG_SYNC_LENGTH | NLASTRIP_FLAG_ACTIVE);
/* auto-name the new strip */
BKE_nlastrip_validate_name(adt, nstrip);
diff --git a/source/blender/editors/space_node/drawnode.cc b/source/blender/editors/space_node/drawnode.cc
index 94da7d55e5d..30f2cc970bd 100644
--- a/source/blender/editors/space_node/drawnode.cc
+++ b/source/blender/editors/space_node/drawnode.cc
@@ -231,7 +231,6 @@ static void node_buts_math(uiLayout *layout, bContext *UNUSED(C), PointerRNA *pt
NodeResizeDirection node_get_resize_direction(const bNode *node, const int x, const int y)
{
if (node->type == NODE_FRAME) {
- const float size = 10.0f;
NodeFrame *data = (NodeFrame *)node->storage;
/* shrinking frame size is determined by child nodes */
@@ -242,7 +241,9 @@ NodeResizeDirection node_get_resize_direction(const bNode *node, const int x, co
NodeResizeDirection dir = NODE_RESIZE_NONE;
const rctf &totr = node->totr;
- if (x >= totr.xmax - size && x < totr.xmax && y >= totr.ymin && y < totr.ymax) {
+ const float size = NODE_RESIZE_MARGIN;
+
+ if (x > totr.xmax - size && x <= totr.xmax && y >= totr.ymin && y < totr.ymax) {
dir |= NODE_RESIZE_RIGHT;
}
if (x >= totr.xmin && x < totr.xmin + size && y >= totr.ymin && y < totr.ymax) {
diff --git a/source/blender/editors/space_node/node_draw.cc b/source/blender/editors/space_node/node_draw.cc
index 834bb3e5802..e290316af1f 100644
--- a/source/blender/editors/space_node/node_draw.cc
+++ b/source/blender/editors/space_node/node_draw.cc
@@ -397,7 +397,7 @@ static void node_update_basis(const bContext &C, bNodeTree &ntree, bNode &node,
/* Round the socket location to stop it from jiggling. */
nsock->locx = round(loc.x + NODE_WIDTH(node));
- nsock->locy = round(0.5f * (dy + buty));
+ nsock->locy = round(dy - NODE_DYS);
dy = buty;
if (nsock->next) {
@@ -527,7 +527,7 @@ static void node_update_basis(const bContext &C, bNodeTree &ntree, bNode &node,
nsock->locx = loc.x;
/* Round the socket vertical position to stop it from jiggling. */
- nsock->locy = round(0.5f * (dy + buty));
+ nsock->locy = round(dy - NODE_DYS);
dy = buty - multi_input_socket_offset * 0.5;
if (nsock->next) {
@@ -626,7 +626,9 @@ static void node_update_hidden(bNode &node, uiBlock &block)
static int node_get_colorid(const bNode &node)
{
- switch (node.typeinfo->nclass) {
+ const int nclass = (node.typeinfo->ui_class == nullptr) ? node.typeinfo->nclass :
+ node.typeinfo->ui_class(&node);
+ switch (nclass) {
case NODE_CLASS_INPUT:
return TH_NODE_INPUT;
case NODE_CLASS_OUTPUT:
@@ -2270,6 +2272,13 @@ void node_set_cursor(wmWindow &win, SpaceNode &snode, const float2 &cursor)
if (node) {
NodeResizeDirection dir = node_get_resize_direction(node, cursor[0], cursor[1]);
wmcursor = node_get_resize_cursor(dir);
+ /* We want to indicate that Frame nodes can be moved/selected on their borders. */
+ if (node->type == NODE_FRAME && dir == NODE_RESIZE_NONE) {
+ const rctf frame_inside = node_frame_rect_inside(*node);
+ if (!BLI_rctf_isect_pt(&frame_inside, cursor[0], cursor[1])) {
+ wmcursor = WM_CURSOR_NSEW_SCROLL;
+ }
+ }
}
WM_cursor_set(&win, wmcursor);
diff --git a/source/blender/editors/space_node/node_edit.cc b/source/blender/editors/space_node/node_edit.cc
index 6275e7e4656..aa27edd77a7 100644
--- a/source/blender/editors/space_node/node_edit.cc
+++ b/source/blender/editors/space_node/node_edit.cc
@@ -394,7 +394,7 @@ static void send_notifiers_after_tree_change(ID *id, bNodeTree *ntree)
{
WM_main_add_notifier(NC_NODE | NA_EDITED, nullptr);
- if (ntree->type == NTREE_SHADER) {
+ if (ntree->type == NTREE_SHADER && id != nullptr) {
if (GS(id->name) == ID_MA) {
WM_main_add_notifier(NC_MATERIAL | ND_SHADING, id);
}
@@ -667,6 +667,7 @@ void ED_node_set_active(
node->flag |= NODE_DO_OUTPUT;
if (!was_output) {
do_update = true;
+ BKE_ntree_update_tag_active_output_changed(ntree);
}
}
@@ -684,6 +685,7 @@ void ED_node_set_active(
}
node->flag |= NODE_DO_OUTPUT;
+ BKE_ntree_update_tag_active_output_changed(ntree);
}
ED_node_tree_propagate_change(nullptr, bmain, ntree);
@@ -750,6 +752,7 @@ void ED_node_set_active(
node->flag |= NODE_DO_OUTPUT;
if (was_output == 0) {
+ BKE_ntree_update_tag_active_output_changed(ntree);
ED_node_tree_propagate_change(nullptr, bmain, ntree);
}
@@ -765,6 +768,7 @@ void ED_node_set_active(
}
node->flag |= NODE_DO_OUTPUT;
+ BKE_ntree_update_tag_active_output_changed(ntree);
ED_node_tree_propagate_change(nullptr, bmain, ntree);
}
}
diff --git a/source/blender/editors/space_node/node_intern.hh b/source/blender/editors/space_node/node_intern.hh
index f6397baf9f2..51825f5bd39 100644
--- a/source/blender/editors/space_node/node_intern.hh
+++ b/source/blender/editors/space_node/node_intern.hh
@@ -130,6 +130,8 @@ ENUM_OPERATORS(NodeResizeDirection, NODE_RESIZE_LEFT);
*/
float2 space_node_group_offset(const SpaceNode &snode);
+rctf node_frame_rect_inside(const bNode &node);
+
int node_get_resize_cursor(NodeResizeDirection directions);
/**
* Usual convention here would be #node_socket_get_color(),
diff --git a/source/blender/editors/space_node/node_relationships.cc b/source/blender/editors/space_node/node_relationships.cc
index fd9420b173d..d92f86c2cfc 100644
--- a/source/blender/editors/space_node/node_relationships.cc
+++ b/source/blender/editors/space_node/node_relationships.cc
@@ -365,10 +365,7 @@ void sort_multi_input_socket_links(SpaceNode &snode,
}
}
-static void snode_autoconnect(Main &bmain,
- SpaceNode &snode,
- const bool allow_multiple,
- const bool replace)
+static void snode_autoconnect(SpaceNode &snode, const bool allow_multiple, const bool replace)
{
bNodeTree *ntree = snode.edittree;
Vector<bNode *> sorted_nodes;
@@ -441,10 +438,6 @@ static void snode_autoconnect(Main &bmain,
}
}
}
-
- if (numlinks > 0) {
- BKE_ntree_update_main_tree(&bmain, ntree, nullptr);
- }
}
/** \} */
@@ -1304,13 +1297,13 @@ static int node_make_link_exec(bContext *C, wmOperator *op)
ED_preview_kill_jobs(CTX_wm_manager(C), &bmain);
- snode_autoconnect(bmain, snode, true, replace);
+ snode_autoconnect(snode, true, replace);
/* deselect sockets after linking */
node_deselect_all_input_sockets(snode, false);
node_deselect_all_output_sockets(snode, false);
- ED_node_tree_propagate_change(C, CTX_data_main(C), snode.edittree);
+ ED_node_tree_propagate_change(C, &bmain, snode.edittree);
return OPERATOR_FINISHED;
}
@@ -2435,54 +2428,73 @@ void ED_node_link_insert(Main *bmain, ScrArea *area)
{
using namespace blender::ed::space_node;
- bNode *select;
+ bNode *node_to_insert;
SpaceNode *snode;
- if (!ed_node_link_conditions(area, true, &snode, &select)) {
+ if (!ed_node_link_conditions(area, true, &snode, &node_to_insert)) {
return;
}
- /* get the link */
- bNodeLink *link;
- for (link = (bNodeLink *)snode->edittree->links.first; link; link = link->next) {
+ /* Find link to insert on. */
+ bNodeTree &ntree = *snode->edittree;
+ bNodeLink *old_link = nullptr;
+ LISTBASE_FOREACH (bNodeLink *, link, &ntree.links) {
if (link->flag & NODE_LINKFLAG_HILITE) {
+ old_link = link;
break;
}
}
+ if (old_link == nullptr) {
+ return;
+ }
- if (link) {
- bNodeSocket *best_input = get_main_socket(*snode->edittree, *select, SOCK_IN);
- bNodeSocket *best_output = get_main_socket(*snode->edittree, *select, SOCK_OUT);
+ old_link->flag &= ~NODE_LINKFLAG_HILITE;
- if (best_input && best_output) {
- bNode *node = link->tonode;
- bNodeSocket *sockto = link->tosock;
+ bNodeSocket *best_input = get_main_socket(ntree, *node_to_insert, SOCK_IN);
+ bNodeSocket *best_output = get_main_socket(ntree, *node_to_insert, SOCK_OUT);
- link->tonode = select;
- link->tosock = best_input;
- node_remove_extra_links(*snode, *link);
- link->flag &= ~NODE_LINKFLAG_HILITE;
+ /* Ignore main sockets when the types don't match. */
+ if (best_input != nullptr && ntree.typeinfo->validate_link != nullptr &&
+ !ntree.typeinfo->validate_link(static_cast<eNodeSocketDatatype>(old_link->fromsock->type),
+ static_cast<eNodeSocketDatatype>(best_input->type))) {
+ best_input = nullptr;
+ }
+ if (best_output != nullptr && ntree.typeinfo->validate_link != nullptr &&
+ !ntree.typeinfo->validate_link(static_cast<eNodeSocketDatatype>(best_output->type),
+ static_cast<eNodeSocketDatatype>(old_link->tosock->type))) {
+ best_output = nullptr;
+ }
- bNodeLink *new_link = nodeAddLink(snode->edittree, select, best_output, node, sockto);
+ bNode *from_node = old_link->fromnode;
+ bNodeSocket *from_socket = old_link->fromsock;
+ bNode *to_node = old_link->tonode;
- /* Copy the socket index for the new link, and reset it for the old link. This way the
- * relative order of links is preserved, and the links get drawn in the right place. */
- new_link->multi_input_socket_index = link->multi_input_socket_index;
- link->multi_input_socket_index = 0;
+ if (best_output != nullptr) {
+ /* Relink the "start" of the existing link to the newly inserted node. */
+ old_link->fromnode = node_to_insert;
+ old_link->fromsock = best_output;
+ BKE_ntree_update_tag_link_changed(&ntree);
+ }
+ else {
+ nodeRemLink(&ntree, old_link);
+ }
- /* set up insert offset data, it needs stuff from here */
- if ((snode->flag & SNODE_SKIP_INSOFFSET) == 0) {
- NodeInsertOfsData *iofsd = MEM_cnew<NodeInsertOfsData>(__func__);
+ if (best_input != nullptr) {
+ /* Add a new link that connects the node on the left to the newly inserted node. */
+ nodeAddLink(&ntree, from_node, from_socket, node_to_insert, best_input);
+ }
- iofsd->insert = select;
- iofsd->prev = link->fromnode;
- iofsd->next = node;
+ /* Set up insert offset data, it needs stuff from here. */
+ if ((snode->flag & SNODE_SKIP_INSOFFSET) == 0) {
+ NodeInsertOfsData *iofsd = MEM_cnew<NodeInsertOfsData>(__func__);
- snode->runtime->iofsd = iofsd;
- }
+ iofsd->insert = node_to_insert;
+ iofsd->prev = from_node;
+ iofsd->next = to_node;
- ED_node_tree_propagate_change(nullptr, bmain, snode->edittree);
- }
+ snode->runtime->iofsd = iofsd;
}
+
+ ED_node_tree_propagate_change(nullptr, bmain, snode->edittree);
}
/** \} */
diff --git a/source/blender/editors/space_node/node_select.cc b/source/blender/editors/space_node/node_select.cc
index 2751a53e8af..6b0fa2cc37c 100644
--- a/source/blender/editors/space_node/node_select.cc
+++ b/source/blender/editors/space_node/node_select.cc
@@ -99,11 +99,51 @@ static bool has_workbench_in_texture_color(const wmWindowManager *wm,
/** \name Public Node Selection API
* \{ */
+rctf node_frame_rect_inside(const bNode &node)
+{
+ const float margin = 1.5f * U.widget_unit;
+ rctf frame_inside = {
+ node.totr.xmin,
+ node.totr.xmax,
+ node.totr.ymin,
+ node.totr.ymax,
+ };
+
+ BLI_rctf_pad(&frame_inside, -margin, -margin);
+
+ return frame_inside;
+}
+
+static bool node_frame_select_isect_mouse(bNode *node, const float2 &mouse)
+{
+ /* Frame nodes are selectable by their borders (including their whole rect - as for other nodes -
+ * would prevent e.g. box selection of nodes inside that frame). */
+ const rctf frame_inside = node_frame_rect_inside(*node);
+ if (BLI_rctf_isect_pt(&node->totr, mouse.x, mouse.y) &&
+ !BLI_rctf_isect_pt(&frame_inside, mouse.x, mouse.y)) {
+ return true;
+ }
+
+ return false;
+}
+
static bNode *node_under_mouse_select(bNodeTree &ntree, int mx, int my)
{
LISTBASE_FOREACH_BACKWARD (bNode *, node, &ntree.nodes) {
- if (BLI_rctf_isect_pt(&node->totr, mx, my)) {
- return node;
+ switch (node->type) {
+ case NODE_FRAME: {
+ const float2 mouse{(float)mx, (float)my};
+ if (node_frame_select_isect_mouse(node, mouse)) {
+ return node;
+ }
+ break;
+ }
+ default: {
+ if (BLI_rctf_isect_pt(&node->totr, mx, my)) {
+ return node;
+ }
+ break;
+ }
}
}
return nullptr;
@@ -114,15 +154,27 @@ static bNode *node_under_mouse_tweak(bNodeTree &ntree, const float2 &mouse)
using namespace blender::math;
LISTBASE_FOREACH_BACKWARD (bNode *, node, &ntree.nodes) {
- if (node->type == NODE_REROUTE) {
- bNodeSocket *socket = (bNodeSocket *)node->inputs.first;
- const float2 location{socket->locx, socket->locy};
- if (distance(mouse, location) < 24.0f) {
- return node;
+ switch (node->type) {
+ case NODE_REROUTE: {
+ bNodeSocket *socket = (bNodeSocket *)node->inputs.first;
+ const float2 location{socket->locx, socket->locy};
+ if (distance(mouse, location) < 24.0f) {
+ return node;
+ }
+ break;
+ }
+ case NODE_FRAME: {
+ if (node_frame_select_isect_mouse(node, mouse)) {
+ return node;
+ }
+ break;
+ }
+ default: {
+ if (BLI_rctf_isect_pt(&node->totr, mouse.x, mouse.y)) {
+ return node;
+ }
+ break;
}
- }
- if (BLI_rctf_isect_pt(&node->totr, mouse.x, mouse.y)) {
- return node;
}
}
return nullptr;
@@ -687,12 +739,24 @@ static int node_box_select_exec(bContext *C, wmOperator *op)
}
LISTBASE_FOREACH (bNode *, node, &node_tree.nodes) {
- bool is_inside;
- if (node->type == NODE_FRAME) {
- is_inside = BLI_rctf_inside_rctf(&rectf, &node->totr);
- }
- else {
- is_inside = BLI_rctf_isect(&rectf, &node->totr, nullptr);
+ bool is_inside = false;
+
+ switch (node->type) {
+ case NODE_FRAME: {
+ /* Frame nodes are selectable by their borders (including their whole rect - as for other
+ * nodes - would prevent selection of other nodes inside that frame. */
+ const rctf frame_inside = node_frame_rect_inside(*node);
+ if (BLI_rctf_isect(&rectf, &node->totr, NULL) &&
+ !BLI_rctf_inside_rctf(&frame_inside, &rectf)) {
+ nodeSetSelected(node, select);
+ is_inside = true;
+ }
+ break;
+ }
+ default: {
+ is_inside = BLI_rctf_isect(&rectf, &node->totr, nullptr);
+ break;
+ }
}
if (is_inside) {
@@ -781,8 +845,25 @@ static int node_circleselect_exec(bContext *C, wmOperator *op)
UI_view2d_region_to_view(&region->v2d, x, y, &offset[0], &offset[1]);
for (node = (bNode *)snode->edittree->nodes.first; node; node = node->next) {
- if (BLI_rctf_isect_circle(&node->totr, offset, radius / zoom)) {
- nodeSetSelected(node, select);
+ switch (node->type) {
+ case NODE_FRAME: {
+ /* Frame nodes are selectable by their borders (including their whole rect - as for other
+ * nodes - would prevent selection of _only_ other nodes inside that frame. */
+ rctf frame_inside = node_frame_rect_inside(*node);
+ const float radius_adjusted = (float)radius / zoom;
+ BLI_rctf_pad(&frame_inside, -2.0f * radius_adjusted, -2.0f * radius_adjusted);
+ if (BLI_rctf_isect_circle(&node->totr, offset, radius_adjusted) &&
+ !BLI_rctf_isect_circle(&frame_inside, offset, radius_adjusted)) {
+ nodeSetSelected(node, select);
+ }
+ break;
+ }
+ default: {
+ if (BLI_rctf_isect_circle(&node->totr, offset, radius / zoom)) {
+ nodeSetSelected(node, select);
+ }
+ break;
+ }
}
}
@@ -859,16 +940,35 @@ static bool do_lasso_select_node(bContext *C,
continue;
}
- int screen_co[2];
- const float cent[2] = {BLI_rctf_cent_x(&node->totr), BLI_rctf_cent_y(&node->totr)};
-
- /* marker in screen coords */
- if (UI_view2d_view_to_region_clip(
- &region->v2d, cent[0], cent[1], &screen_co[0], &screen_co[1]) &&
- BLI_rcti_isect_pt(&rect, screen_co[0], screen_co[1]) &&
- BLI_lasso_is_point_inside(mcoords, mcoords_len, screen_co[0], screen_co[1], INT_MAX)) {
- nodeSetSelected(node, select);
- changed = true;
+ switch (node->type) {
+ case NODE_FRAME: {
+ /* Frame nodes are selectable by their borders (including their whole rect - as for other
+ * nodes - would prevent selection of other nodes inside that frame. */
+ rctf rectf;
+ BLI_rctf_rcti_copy(&rectf, &rect);
+ UI_view2d_region_to_view_rctf(&region->v2d, &rectf, &rectf);
+ const rctf frame_inside = node_frame_rect_inside(*node);
+ if (BLI_rctf_isect(&rectf, &node->totr, NULL) &&
+ !BLI_rctf_inside_rctf(&frame_inside, &rectf)) {
+ nodeSetSelected(node, select);
+ changed = true;
+ }
+ break;
+ }
+ default: {
+ int screen_co[2];
+ const float cent[2] = {BLI_rctf_cent_x(&node->totr), BLI_rctf_cent_y(&node->totr)};
+
+ /* marker in screen coords */
+ if (UI_view2d_view_to_region_clip(
+ &region->v2d, cent[0], cent[1], &screen_co[0], &screen_co[1]) &&
+ BLI_rcti_isect_pt(&rect, screen_co[0], screen_co[1]) &&
+ BLI_lasso_is_point_inside(mcoords, mcoords_len, screen_co[0], screen_co[1], INT_MAX)) {
+ nodeSetSelected(node, select);
+ changed = true;
+ }
+ break;
+ }
}
}
diff --git a/source/blender/editors/space_outliner/outliner_draw.cc b/source/blender/editors/space_outliner/outliner_draw.cc
index 259fdd4e009..13c273d1ec9 100644
--- a/source/blender/editors/space_outliner/outliner_draw.cc
+++ b/source/blender/editors/space_outliner/outliner_draw.cc
@@ -2632,8 +2632,8 @@ TreeElementIcon tree_element_get_icon(TreeStoreElem *tselem, TreeElement *te)
case OB_LIGHTPROBE:
data.icon = ICON_OUTLINER_OB_LIGHTPROBE;
break;
- case OB_HAIR:
- data.icon = ICON_OUTLINER_OB_HAIR;
+ case OB_CURVES:
+ data.icon = ICON_OUTLINER_OB_CURVES;
break;
case OB_POINTCLOUD:
data.icon = ICON_OUTLINER_OB_POINTCLOUD;
@@ -2746,8 +2746,8 @@ TreeElementIcon tree_element_get_icon(TreeStoreElem *tselem, TreeElement *te)
case ID_GR:
data.icon = ICON_OUTLINER_COLLECTION;
break;
- case ID_HA:
- data.icon = ICON_OUTLINER_DATA_HAIR;
+ case ID_CV:
+ data.icon = ICON_OUTLINER_DATA_CURVES;
break;
case ID_PT:
data.icon = ICON_OUTLINER_DATA_POINTCLOUD;
diff --git a/source/blender/editors/space_outliner/outliner_intern.hh b/source/blender/editors/space_outliner/outliner_intern.hh
index bd288241a63..efbd8a32716 100644
--- a/source/blender/editors/space_outliner/outliner_intern.hh
+++ b/source/blender/editors/space_outliner/outliner_intern.hh
@@ -145,7 +145,7 @@ typedef struct TreeElementIcon {
ID_GD, \
ID_LS, \
ID_LP, \
- ID_HA, \
+ ID_CV, \
ID_PT, \
ID_VO, \
ID_SIM) || /* Only in 'blendfile' mode ... :/ */ \
diff --git a/source/blender/editors/space_outliner/outliner_select.cc b/source/blender/editors/space_outliner/outliner_select.cc
index ebb4e529b04..f256475c0da 100644
--- a/source/blender/editors/space_outliner/outliner_select.cc
+++ b/source/blender/editors/space_outliner/outliner_select.cc
@@ -1198,7 +1198,7 @@ static void outliner_set_properties_tab(bContext *C, TreeElement *te, TreeStoreE
case ID_AR:
case ID_GD:
case ID_LP:
- case ID_HA:
+ case ID_CV:
case ID_PT:
case ID_VO:
context = BCONTEXT_DATA;
diff --git a/source/blender/editors/space_outliner/outliner_tools.cc b/source/blender/editors/space_outliner/outliner_tools.cc
index 3b8c284cd65..337649834a4 100644
--- a/source/blender/editors/space_outliner/outliner_tools.cc
+++ b/source/blender/editors/space_outliner/outliner_tools.cc
@@ -29,8 +29,8 @@
#include "DNA_armature_types.h"
#include "DNA_collection_types.h"
#include "DNA_constraint_types.h"
+#include "DNA_curves_types.h"
#include "DNA_gpencil_types.h"
-#include "DNA_hair_types.h"
#include "DNA_light_types.h"
#include "DNA_linestyle_types.h"
#include "DNA_material_types.h"
@@ -164,7 +164,7 @@ static void get_element_operation_type(
case ID_CF:
case ID_WS:
case ID_LP:
- case ID_HA:
+ case ID_CV:
case ID_PT:
case ID_VO:
case ID_SIM:
@@ -262,10 +262,10 @@ static void unlink_material_fn(bContext *UNUSED(C),
totcol = mb->totcol;
matar = mb->mat;
}
- else if (GS(tsep->id->name) == ID_HA) {
- Hair *hair = (Hair *)tsep->id;
- totcol = hair->totcol;
- matar = hair->mat;
+ else if (GS(tsep->id->name) == ID_CV) {
+ Curves *curves = (Curves *)tsep->id;
+ totcol = curves->totcol;
+ matar = curves->mat;
}
else if (GS(tsep->id->name) == ID_PT) {
PointCloud *pointcloud = (PointCloud *)tsep->id;
diff --git a/source/blender/editors/space_outliner/outliner_tree.cc b/source/blender/editors/space_outliner/outliner_tree.cc
index 4e16fe64988..60f5437ad88 100644
--- a/source/blender/editors/space_outliner/outliner_tree.cc
+++ b/source/blender/editors/space_outliner/outliner_tree.cc
@@ -32,9 +32,9 @@
#include "DNA_camera_types.h"
#include "DNA_collection_types.h"
#include "DNA_constraint_types.h"
+#include "DNA_curves_types.h"
#include "DNA_gpencil_modifier_types.h"
#include "DNA_gpencil_types.h"
-#include "DNA_hair_types.h"
#include "DNA_key_types.h"
#include "DNA_light_types.h"
#include "DNA_lightprobe_types.h"
@@ -773,10 +773,10 @@ static void outliner_add_id_contents(SpaceOutliner *space_outliner,
}
break;
}
- case ID_HA: {
- Hair *hair = (Hair *)id;
- if (outliner_animdata_test(hair->adt)) {
- outliner_add_element(space_outliner, &te->subtree, hair, te, TSE_ANIM_DATA, 0);
+ case ID_CV: {
+ Curves *curves = (Curves *)id;
+ if (outliner_animdata_test(curves->adt)) {
+ outliner_add_element(space_outliner, &te->subtree, curves, te, TSE_ANIM_DATA, 0);
}
break;
}
diff --git a/source/blender/editors/space_outliner/tree/tree_element_id.cc b/source/blender/editors/space_outliner/tree/tree_element_id.cc
index afbbd171cf4..3289cb8ac76 100644
--- a/source/blender/editors/space_outliner/tree/tree_element_id.cc
+++ b/source/blender/editors/space_outliner/tree/tree_element_id.cc
@@ -69,7 +69,7 @@ std::unique_ptr<TreeElementID> TreeElementID::createFromID(TreeElement &legacy_t
case ID_LP:
case ID_GD:
case ID_WS:
- case ID_HA:
+ case ID_CV:
case ID_PT:
case ID_VO:
case ID_SIM:
diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c
index aef6b30986d..439a37631e0 100644
--- a/source/blender/editors/space_sequencer/sequencer_add.c
+++ b/source/blender/editors/space_sequencer/sequencer_add.c
@@ -632,7 +632,7 @@ static void sequencer_add_movie_clamp_sound_strip_length(Scene *scene,
Sequence *seq_movie,
Sequence *seq_sound)
{
- if (ELEM(NULL, seq_movie, seq_sound) || seq_sound->len <= seq_movie->len) {
+ if (ELEM(NULL, seq_movie, seq_sound)) {
return;
}
diff --git a/source/blender/editors/space_sequencer/sequencer_scopes.c b/source/blender/editors/space_sequencer/sequencer_scopes.c
index 5d857f62b47..fd341fc9c0d 100644
--- a/source/blender/editors/space_sequencer/sequencer_scopes.c
+++ b/source/blender/editors/space_sequencer/sequencer_scopes.c
@@ -13,7 +13,7 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * Author: Peter Schlaile < peter [at] schlaile [dot] de >
+ * Copyright 2006-2008 Peter Schlaile < peter [at] schlaile [dot] de >
*/
/** \file
diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c
index 243d4033cbc..6edb0a070c0 100644
--- a/source/blender/editors/space_view3d/view3d_buttons.c
+++ b/source/blender/editors/space_view3d/view3d_buttons.c
@@ -1764,7 +1764,8 @@ static void view3d_panel_transform(const bContext *C, Panel *panel)
v3d_transform_butsR(col, &obptr);
/* Dimensions and editmode are mostly the same check. */
- if (OB_TYPE_SUPPORT_EDITMODE(ob->type) || ELEM(ob->type, OB_VOLUME, OB_HAIR, OB_POINTCLOUD)) {
+ if (OB_TYPE_SUPPORT_EDITMODE(ob->type) ||
+ ELEM(ob->type, OB_VOLUME, OB_CURVES, OB_POINTCLOUD)) {
View3D *v3d = CTX_wm_view3d(C);
v3d_object_dimension_buts(NULL, col, v3d, ob);
}