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:
authorPatrick Busch <Xylvier>2021-03-19 00:25:36 +0300
committerHans Goudey <h.goudey@me.com>2021-03-19 00:25:36 +0300
commitfc62d38ce105857f1c3400ba67271db7f2873a29 (patch)
tree5a4ac2a1b5def6aed716b084dc520baa637e648e /source/blender/blenkernel
parent7e3efac9a85743dbe6a3646170a4f4475bf91e6c (diff)
Python API: Expose CurveProfile Reset View function
Allow python access to the `reset_view` functionality which before was only available through the menu. This was suggested for consistency after D10561. Differential Revision: https://developer.blender.org/D10595
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/BKE_curveprofile.h2
-rw-r--r--source/blender/blenkernel/intern/curveprofile.c8
2 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_curveprofile.h b/source/blender/blenkernel/BKE_curveprofile.h
index 67f9095924a..501ae70ecdb 100644
--- a/source/blender/blenkernel/BKE_curveprofile.h
+++ b/source/blender/blenkernel/BKE_curveprofile.h
@@ -66,6 +66,8 @@ void BKE_curveprofile_selected_handle_set(struct CurveProfile *profile, int type
void BKE_curveprofile_reverse(struct CurveProfile *profile);
+void BKE_curveprofile_reset_view(struct CurveProfile *profile);
+
void BKE_curveprofile_reset(struct CurveProfile *profile);
void BKE_curveprofile_create_samples(struct CurveProfile *profile,
diff --git a/source/blender/blenkernel/intern/curveprofile.c b/source/blender/blenkernel/intern/curveprofile.c
index b7017253be1..752e0d4dfcf 100644
--- a/source/blender/blenkernel/intern/curveprofile.c
+++ b/source/blender/blenkernel/intern/curveprofile.c
@@ -436,6 +436,14 @@ static void curveprofile_build_steps(CurveProfile *profile)
}
/**
+ * Reset the view to the clipping rectangle.
+ */
+void BKE_curveprofile_reset_view(CurveProfile *profile)
+{
+ profile->view_rect = profile->clip_rect;
+}
+
+/**
* Resets the profile to the current preset.
*
* \note Requires #BKE_curveprofile_update call after.