diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2022-02-01 21:25:36 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2022-02-01 21:25:36 +0300 |
commit | 2b01964e6cea2fabee585395f7b85aa8ad4837b0 (patch) | |
tree | 9c09f955fd237e0b72fc76a0156cf1ba3e318ddb /source | |
parent | f39ade9e00fc24be6f45b33b391b3d6bfa6fee9f (diff) | |
parent | 83b6c8f2b1e3899680e807ced8ebd8d7ae77ce2d (diff) |
Merge branch 'blender-v3.1-release'
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_edit.c | 25 | ||||
-rw-r--r-- | source/blender/gpu/opengl/gl_shader.cc | 2 |
2 files changed, 27 insertions, 0 deletions
diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c index e71a56894d0..afb786da8c6 100644 --- a/source/blender/editors/gpencil/gpencil_edit.c +++ b/source/blender/editors/gpencil/gpencil_edit.c @@ -4626,6 +4626,31 @@ static int gpencil_stroke_separate_exec(bContext *C, wmOperator *op) BKE_report(op->reports, RPT_ERROR, "Not implemented!"); } else { + /* Check if all points are selected. */ + bool all_points_selected = true; + for (i = 0, pt = gps->points; i < gps->totpoints; i++, pt++) { + if ((pt->flag & GP_SPOINT_SELECT) == 0) { + all_points_selected = false; + break; + } + } + + /* Separate the entrie stroke. */ + if (all_points_selected) { + /* deselect old stroke */ + gps->flag &= ~GP_STROKE_SELECT; + BKE_gpencil_stroke_select_index_reset(gps); + /* unlink from source frame */ + BLI_remlink(&gpf->strokes, gps); + gps->prev = gps->next = NULL; + /* relink to destination frame */ + BLI_addtail(&gpf_dst->strokes, gps); + /* Reassign material. */ + gps->mat_nr = idx; + + continue; + } + /* make copy of source stroke */ bGPDstroke *gps_dst = BKE_gpencil_stroke_duplicate(gps, true, true); diff --git a/source/blender/gpu/opengl/gl_shader.cc b/source/blender/gpu/opengl/gl_shader.cc index 3a212eb165c..3ab3b11d1f4 100644 --- a/source/blender/gpu/opengl/gl_shader.cc +++ b/source/blender/gpu/opengl/gl_shader.cc @@ -415,11 +415,13 @@ std::string GLShader::resources_declare(const ShaderCreateInfo &info) const } ss << ";\n"; } +#if 0 /* T95278: This is not be enough to prevent some compilers think it is recursive. */ for (const ShaderCreateInfo::PushConst &uniform : info.push_constants_) { /* T95278: Double macro to avoid some compilers think it is recursive. */ ss << "#define " << uniform.name << "_ " << uniform.name << "\n"; ss << "#define " << uniform.name << " (" << uniform.name << "_)\n"; } +#endif ss << "\n"; return ss.str(); } |