diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2018-09-10 16:49:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-10 16:49:09 +0200 |
commit | 584f1ab0c5c095c7ee6323a0e5f8e2d17fcb8a0f (patch) | |
tree | 5f4d04fa502698cbefbda4286ace1add4531ef1d | |
parent | de60714b910601b6e39cf440cc21b391a90ee58e (diff) | |
parent | 334f04251353194c5874901b69d3a027a6f17bf9 (diff) |
Merge pull request #21842 from merumelu/curve-point-count
Bind Curve::get_point_count
-rw-r--r-- | doc/classes/Curve.xml | 7 | ||||
-rw-r--r-- | scene/resources/curve.cpp | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/doc/classes/Curve.xml b/doc/classes/Curve.xml index c7f2f7bb8d..490772e400 100644 --- a/doc/classes/Curve.xml +++ b/doc/classes/Curve.xml @@ -49,6 +49,13 @@ Removes all points from the curve. </description> </method> + <method name="get_point_count" qualifiers="const"> + <return type="int"> + </return> + <description> + Returns the number of points describing the curve. + </description> + </method> <method name="get_point_left_mode" qualifiers="const"> <return type="int" enum="Curve.TangentMode"> </return> diff --git a/scene/resources/curve.cpp b/scene/resources/curve.cpp index d8989bf062..66af816a28 100644 --- a/scene/resources/curve.cpp +++ b/scene/resources/curve.cpp @@ -491,6 +491,7 @@ void Curve::ensure_default_setup(float p_min, float p_max) { void Curve::_bind_methods() { + ClassDB::bind_method(D_METHOD("get_point_count"), &Curve::get_point_count); ClassDB::bind_method(D_METHOD("add_point", "position", "left_tangent", "right_tangent", "left_mode", "right_mode"), &Curve::add_point, DEFVAL(0), DEFVAL(0), DEFVAL(TANGENT_FREE), DEFVAL(TANGENT_FREE)); ClassDB::bind_method(D_METHOD("remove_point", "index"), &Curve::remove_point); ClassDB::bind_method(D_METHOD("clear_points"), &Curve::clear_points); |