diff options
Diffstat (limited to 'scene/resources')
25 files changed, 166 insertions, 108 deletions
diff --git a/scene/resources/animation.cpp b/scene/resources/animation.cpp index eae95d9247..8dcc8d4e14 100644 --- a/scene/resources/animation.cpp +++ b/scene/resources/animation.cpp @@ -613,7 +613,7 @@ int Animation::transform_track_insert_key(int p_track, float p_time, const Vecto return ret; } -void Animation::track_remove_key_at_pos(int p_track, float p_pos) { +void Animation::track_remove_key_at_position(int p_track, float p_pos) { int idx = track_find_key(p_track, p_pos, true); ERR_FAIL_COND(idx < 0); @@ -707,12 +707,12 @@ void Animation::track_insert_key(int p_track, float p_time, const Variant &p_key Dictionary d = p_key; Vector3 loc; - if (d.has("loc")) - loc = d["loc"]; + if (d.has("location")) + loc = d["location"]; Quat rot; - if (d.has("rot")) - rot = d["rot"]; + if (d.has("rotation")) + rot = d["rotation"]; Vector3 scale; if (d.has("scale")) @@ -799,8 +799,8 @@ Variant Animation::track_get_key_value(int p_track, int p_key_idx) const { ERR_FAIL_INDEX_V(p_key_idx, tt->transforms.size(), Variant()); Dictionary d; - d["loc"] = tt->transforms[p_key_idx].value.loc; - d["rot"] = tt->transforms[p_key_idx].value.rot; + d["location"] = tt->transforms[p_key_idx].value.loc; + d["rotation"] = tt->transforms[p_key_idx].value.rot; d["scale"] = tt->transforms[p_key_idx].value.scale; return d; @@ -903,10 +903,10 @@ void Animation::track_set_key_value(int p_track, int p_key_idx, const Variant &p TransformTrack *tt = static_cast<TransformTrack *>(t); ERR_FAIL_INDEX(p_key_idx, tt->transforms.size()); Dictionary d = p_value; - if (d.has("loc")) - tt->transforms[p_key_idx].value.loc = d["loc"]; - if (d.has("rot")) - tt->transforms[p_key_idx].value.rot = d["rot"]; + if (d.has("location")) + tt->transforms[p_key_idx].value.loc = d["location"]; + if (d.has("rotation")) + tt->transforms[p_key_idx].value.rot = d["rotation"]; if (d.has("scale")) tt->transforms[p_key_idx].value.scale = d["scale"]; @@ -1590,7 +1590,7 @@ float Animation::get_step() const { void Animation::_bind_methods() { - ClassDB::bind_method(D_METHOD("add_track", "type", "at_pos"), &Animation::add_track, DEFVAL(-1)); + ClassDB::bind_method(D_METHOD("add_track", "type", "at_position"), &Animation::add_track, DEFVAL(-1)); ClassDB::bind_method(D_METHOD("remove_track", "idx"), &Animation::remove_track); ClassDB::bind_method(D_METHOD("get_track_count"), &Animation::get_track_count); ClassDB::bind_method(D_METHOD("track_get_type", "idx"), &Animation::track_get_type); @@ -1604,10 +1604,10 @@ void Animation::_bind_methods() { ClassDB::bind_method(D_METHOD("track_set_imported", "idx", "imported"), &Animation::track_set_imported); ClassDB::bind_method(D_METHOD("track_is_imported", "idx"), &Animation::track_is_imported); - ClassDB::bind_method(D_METHOD("transform_track_insert_key", "idx", "time", "loc", "rot", "scale"), &Animation::transform_track_insert_key); + ClassDB::bind_method(D_METHOD("transform_track_insert_key", "idx", "time", "location", "rotation", "scale"), &Animation::transform_track_insert_key); ClassDB::bind_method(D_METHOD("track_insert_key", "idx", "time", "key", "transition"), &Animation::track_insert_key, DEFVAL(1)); ClassDB::bind_method(D_METHOD("track_remove_key", "idx", "key_idx"), &Animation::track_remove_key); - ClassDB::bind_method(D_METHOD("track_remove_key_at_pos", "idx", "pos"), &Animation::track_remove_key_at_pos); + ClassDB::bind_method(D_METHOD("track_remove_key_at_position", "idx", "position"), &Animation::track_remove_key_at_position); ClassDB::bind_method(D_METHOD("track_set_key_value", "idx", "key", "value"), &Animation::track_set_key_value); ClassDB::bind_method(D_METHOD("track_set_key_transition", "idx", "key_idx", "transition"), &Animation::track_set_key_transition); ClassDB::bind_method(D_METHOD("track_get_key_transition", "idx", "key_idx"), &Animation::track_get_key_transition); diff --git a/scene/resources/animation.h b/scene/resources/animation.h index e653f6b124..6235e161a3 100644 --- a/scene/resources/animation.h +++ b/scene/resources/animation.h @@ -245,7 +245,7 @@ public: void track_set_key_value(int p_track, int p_key_idx, const Variant &p_value); int track_find_key(int p_track, float p_time, bool p_exact = false) const; void track_remove_key(int p_track, int p_idx); - void track_remove_key_at_pos(int p_track, float p_pos); + void track_remove_key_at_position(int p_track, float p_pos); int track_get_key_count(int p_track) const; Variant track_get_key_value(int p_track, int p_key_idx) const; float track_get_key_time(int p_track, int p_key_idx) const; diff --git a/scene/resources/audio_stream_sample.cpp b/scene/resources/audio_stream_sample.cpp index 659322897a..e47cb971ae 100644 --- a/scene/resources/audio_stream_sample.cpp +++ b/scene/resources/audio_stream_sample.cpp @@ -61,7 +61,7 @@ int AudioStreamPlaybackSample::get_loop_count() const { return 0; } -float AudioStreamPlaybackSample::get_pos() const { +float AudioStreamPlaybackSample::get_position() const { return float(offset >> MIX_FRAC_BITS) / base->mix_rate; } @@ -536,6 +536,14 @@ void AudioStreamSample::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::INT, "mix_rate"), "set_mix_rate", "get_mix_rate"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "stereo"), "set_stereo", "is_stereo"); ADD_PROPERTY(PropertyInfo(Variant::POOL_BYTE_ARRAY, "data", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_data", "get_data"); + + BIND_ENUM_CONSTANT(FORMAT_8_BITS); + BIND_ENUM_CONSTANT(FORMAT_16_BITS); + BIND_ENUM_CONSTANT(FORMAT_IMA_ADPCM); + + BIND_ENUM_CONSTANT(LOOP_DISABLED); + BIND_ENUM_CONSTANT(LOOP_FORWARD); + BIND_ENUM_CONSTANT(LOOP_PING_PONG); } AudioStreamSample::AudioStreamSample() { diff --git a/scene/resources/audio_stream_sample.h b/scene/resources/audio_stream_sample.h index 6cb255fedf..46fa78ddcf 100644 --- a/scene/resources/audio_stream_sample.h +++ b/scene/resources/audio_stream_sample.h @@ -71,7 +71,7 @@ public: virtual int get_loop_count() const; //times it looped - virtual float get_pos() const; + virtual float get_position() const; virtual void seek_pos(float p_time); virtual void mix(AudioFrame *p_buffer, float p_rate_scale, int p_frames); diff --git a/scene/resources/bit_mask.cpp b/scene/resources/bit_mask.cpp index be994e3b33..029a9ef0e8 100644 --- a/scene/resources/bit_mask.cpp +++ b/scene/resources/bit_mask.cpp @@ -172,8 +172,8 @@ void BitMap::_bind_methods() { ClassDB::bind_method(D_METHOD("create", "size"), &BitMap::create); ClassDB::bind_method(D_METHOD("create_from_image_alpha", "image"), &BitMap::create_from_image_alpha); - ClassDB::bind_method(D_METHOD("set_bit", "pos", "bit"), &BitMap::set_bit); - ClassDB::bind_method(D_METHOD("get_bit", "pos"), &BitMap::get_bit); + ClassDB::bind_method(D_METHOD("set_bit", "position", "bit"), &BitMap::set_bit); + ClassDB::bind_method(D_METHOD("get_bit", "position"), &BitMap::get_bit); ClassDB::bind_method(D_METHOD("set_bit_rect", "p_rect", "bit"), &BitMap::set_bit_rect); ClassDB::bind_method(D_METHOD("get_true_bit_count"), &BitMap::get_true_bit_count); diff --git a/scene/resources/curve.cpp b/scene/resources/curve.cpp index 7fbaa1f73c..daa8fc1874 100644 --- a/scene/resources/curve.cpp +++ b/scene/resources/curve.cpp @@ -84,15 +84,6 @@ int Curve::add_point(Vector2 p_pos, real_t left_tangent, real_t right_tangent, T int i = get_index(p_pos.x); - int nearest_index = i; - if (i + 1 < _points.size()) { - real_t diff0 = p_pos.x - _points[i].pos.x; - real_t diff1 = _points[i + 1].pos.x - p_pos.x; - - if (diff1 < diff0) - nearest_index = i + 1; - } - if (i == 0 && p_pos.x < _points[0].pos.x) { // Insert before anything else _points.insert(0, Point(p_pos, left_tangent, right_tangent, left_mode, right_mode)); @@ -250,7 +241,7 @@ int Curve::set_point_offset(int p_index, float offset) { return i; } -Vector2 Curve::get_point_pos(int p_index) const { +Vector2 Curve::get_point_position(int p_index) const { ERR_FAIL_INDEX_V(p_index, _points.size(), Vector2(0, 0)); return _points[p_index].pos; } @@ -331,18 +322,19 @@ real_t Curve::interpolate_local_nocheck(int index, real_t local_offset) const { const Point a = _points[index]; const Point b = _points[index + 1]; - // Cubic bezier - - // ac-----bc - // / \ - // / \ Here with a.right_tangent > 0 - // / \ and b.left_tangent < 0 - // / \ - // a b - // - // |-d1--|-d2--|-d3--| - // - // d1 == d2 == d3 == d / 3 + /* Cubic bezier + * + * ac-----bc + * / \ + * / \ Here with a.right_tangent > 0 + * / \ and b.left_tangent < 0 + * / \ + * a b + * + * |-d1--|-d2--|-d3--| + * + * d1 == d2 == d3 == d / 3 + */ // Control points are chosen at equal distances real_t d = b.pos.x - a.pos.x; @@ -488,11 +480,10 @@ real_t Curve::interpolate_baked(real_t offset) { void Curve::_bind_methods() { - ClassDB::bind_method(D_METHOD("add_point", "pos", "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("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); - ClassDB::bind_method(D_METHOD("get_point_pos", "index"), &Curve::get_point_pos); + ClassDB::bind_method(D_METHOD("get_point_position", "index"), &Curve::get_point_position); ClassDB::bind_method(D_METHOD("set_point_value", "index", "y"), &Curve::set_point_value); ClassDB::bind_method(D_METHOD("set_point_offset", "index", "offset"), &Curve::set_point_value); ClassDB::bind_method(D_METHOD("interpolate", "offset"), &Curve::interpolate); @@ -522,6 +513,10 @@ void Curve::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::INT, "_data", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "_set_data", "_get_data"); ADD_SIGNAL(MethodInfo(SIGNAL_RANGE_CHANGED)); + + BIND_ENUM_CONSTANT(TANGENT_FREE); + BIND_ENUM_CONSTANT(TANGENT_LINEAR); + BIND_ENUM_CONSTANT(TANGENT_MODE_COUNT); } int Curve2D::get_point_count() const { @@ -543,7 +538,7 @@ void Curve2D::add_point(const Vector2 &p_pos, const Vector2 &p_in, const Vector2 emit_signal(CoreStringNames::get_singleton()->changed); } -void Curve2D::set_point_pos(int p_index, const Vector2 &p_pos) { +void Curve2D::set_point_position(int p_index, const Vector2 &p_pos) { ERR_FAIL_INDEX(p_index, points.size()); @@ -551,7 +546,7 @@ void Curve2D::set_point_pos(int p_index, const Vector2 &p_pos) { baked_cache_dirty = true; emit_signal(CoreStringNames::get_singleton()->changed); } -Vector2 Curve2D::get_point_pos(int p_index) const { +Vector2 Curve2D::get_point_position(int p_index) const { ERR_FAIL_INDEX_V(p_index, points.size(), Vector2()); return points[p_index].pos; @@ -895,12 +890,12 @@ PoolVector2Array Curve2D::tessellate(int p_max_stages, float p_tolerance) const void Curve2D::_bind_methods() { ClassDB::bind_method(D_METHOD("get_point_count"), &Curve2D::get_point_count); - ClassDB::bind_method(D_METHOD("add_point", "pos", "in", "out", "atpos"), &Curve2D::add_point, DEFVAL(Vector2()), DEFVAL(Vector2()), DEFVAL(-1)); - ClassDB::bind_method(D_METHOD("set_point_pos", "idx", "pos"), &Curve2D::set_point_pos); - ClassDB::bind_method(D_METHOD("get_point_pos", "idx"), &Curve2D::get_point_pos); - ClassDB::bind_method(D_METHOD("set_point_in", "idx", "pos"), &Curve2D::set_point_in); + ClassDB::bind_method(D_METHOD("add_point", "position", "in", "out", "at_position"), &Curve2D::add_point, DEFVAL(Vector2()), DEFVAL(Vector2()), DEFVAL(-1)); + ClassDB::bind_method(D_METHOD("set_point_position", "idx", "position"), &Curve2D::set_point_position); + ClassDB::bind_method(D_METHOD("get_point_position", "idx"), &Curve2D::get_point_position); + ClassDB::bind_method(D_METHOD("set_point_in", "idx", "position"), &Curve2D::set_point_in); ClassDB::bind_method(D_METHOD("get_point_in", "idx"), &Curve2D::get_point_in); - ClassDB::bind_method(D_METHOD("set_point_out", "idx", "pos"), &Curve2D::set_point_out); + ClassDB::bind_method(D_METHOD("set_point_out", "idx", "position"), &Curve2D::set_point_out); ClassDB::bind_method(D_METHOD("get_point_out", "idx"), &Curve2D::get_point_out); ClassDB::bind_method(D_METHOD("remove_point", "idx"), &Curve2D::remove_point); ClassDB::bind_method(D_METHOD("clear_points"), &Curve2D::clear_points); @@ -920,9 +915,6 @@ void Curve2D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::REAL, "bake_interval", PROPERTY_HINT_RANGE, "0.01,512,0.01"), "set_bake_interval", "get_bake_interval"); ADD_PROPERTY(PropertyInfo(Variant::INT, "_data", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "_set_data", "_get_data"); - /*ADD_PROPERTY( PropertyInfo( Variant::VECTOR3_ARRAY, "points_out"), "set_points_out","get_points_out"); - ADD_PROPERTY( PropertyInfo( Variant::VECTOR3_ARRAY, "points_pos"), "set_points_pos","get_points_pos"); -*/ } Curve2D::Curve2D() { @@ -959,7 +951,7 @@ void Curve3D::add_point(const Vector3 &p_pos, const Vector3 &p_in, const Vector3 baked_cache_dirty = true; emit_signal(CoreStringNames::get_singleton()->changed); } -void Curve3D::set_point_pos(int p_index, const Vector3 &p_pos) { +void Curve3D::set_point_position(int p_index, const Vector3 &p_pos) { ERR_FAIL_INDEX(p_index, points.size()); @@ -967,7 +959,7 @@ void Curve3D::set_point_pos(int p_index, const Vector3 &p_pos) { baked_cache_dirty = true; emit_signal(CoreStringNames::get_singleton()->changed); } -Vector3 Curve3D::get_point_pos(int p_index) const { +Vector3 Curve3D::get_point_position(int p_index) const { ERR_FAIL_INDEX_V(p_index, points.size(), Vector3()); return points[p_index].pos; @@ -1390,14 +1382,14 @@ PoolVector3Array Curve3D::tessellate(int p_max_stages, float p_tolerance) const void Curve3D::_bind_methods() { ClassDB::bind_method(D_METHOD("get_point_count"), &Curve3D::get_point_count); - ClassDB::bind_method(D_METHOD("add_point", "pos", "in", "out", "atpos"), &Curve3D::add_point, DEFVAL(Vector3()), DEFVAL(Vector3()), DEFVAL(-1)); - ClassDB::bind_method(D_METHOD("set_point_pos", "idx", "pos"), &Curve3D::set_point_pos); - ClassDB::bind_method(D_METHOD("get_point_pos", "idx"), &Curve3D::get_point_pos); + ClassDB::bind_method(D_METHOD("add_point", "position", "in", "out", "at_position"), &Curve3D::add_point, DEFVAL(Vector3()), DEFVAL(Vector3()), DEFVAL(-1)); + ClassDB::bind_method(D_METHOD("set_point_position", "idx", "position"), &Curve3D::set_point_position); + ClassDB::bind_method(D_METHOD("get_point_position", "idx"), &Curve3D::get_point_position); ClassDB::bind_method(D_METHOD("set_point_tilt", "idx", "tilt"), &Curve3D::set_point_tilt); ClassDB::bind_method(D_METHOD("get_point_tilt", "idx"), &Curve3D::get_point_tilt); - ClassDB::bind_method(D_METHOD("set_point_in", "idx", "pos"), &Curve3D::set_point_in); + ClassDB::bind_method(D_METHOD("set_point_in", "idx", "position"), &Curve3D::set_point_in); ClassDB::bind_method(D_METHOD("get_point_in", "idx"), &Curve3D::get_point_in); - ClassDB::bind_method(D_METHOD("set_point_out", "idx", "pos"), &Curve3D::set_point_out); + ClassDB::bind_method(D_METHOD("set_point_out", "idx", "position"), &Curve3D::set_point_out); ClassDB::bind_method(D_METHOD("get_point_out", "idx"), &Curve3D::get_point_out); ClassDB::bind_method(D_METHOD("remove_point", "idx"), &Curve3D::remove_point); ClassDB::bind_method(D_METHOD("clear_points"), &Curve3D::clear_points); @@ -1418,9 +1410,6 @@ void Curve3D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::REAL, "bake_interval", PROPERTY_HINT_RANGE, "0.01,512,0.01"), "set_bake_interval", "get_bake_interval"); ADD_PROPERTY(PropertyInfo(Variant::INT, "_data", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "_set_data", "_get_data"); - /*ADD_PROPERTY( PropertyInfo( Variant::VECTOR3_ARRAY, "points_out"), "set_points_out","get_points_out"); - ADD_PROPERTY( PropertyInfo( Variant::VECTOR3_ARRAY, "points_pos"), "set_points_pos","get_points_pos"); -*/ } Curve3D::Curve3D() { diff --git a/scene/resources/curve.h b/scene/resources/curve.h index 3071aee5de..e7d47f4056 100644 --- a/scene/resources/curve.h +++ b/scene/resources/curve.h @@ -92,7 +92,7 @@ public: void set_point_value(int p_index, real_t pos); int set_point_offset(int p_index, float offset); - Vector2 get_point_pos(int p_index) const; + Vector2 get_point_position(int p_index) const; Point get_point(int p_index) const; @@ -180,8 +180,8 @@ protected: public: int get_point_count() const; void add_point(const Vector2 &p_pos, const Vector2 &p_in = Vector2(), const Vector2 &p_out = Vector2(), int p_atpos = -1); - void set_point_pos(int p_index, const Vector2 &p_pos); - Vector2 get_point_pos(int p_index) const; + void set_point_position(int p_index, const Vector2 &p_pos); + Vector2 get_point_position(int p_index) const; void set_point_in(int p_index, const Vector2 &p_in); Vector2 get_point_in(int p_index) const; void set_point_out(int p_index, const Vector2 &p_out); @@ -245,8 +245,8 @@ protected: public: int get_point_count() const; void add_point(const Vector3 &p_pos, const Vector3 &p_in = Vector3(), const Vector3 &p_out = Vector3(), int p_atpos = -1); - void set_point_pos(int p_index, const Vector3 &p_pos); - Vector3 get_point_pos(int p_index) const; + void set_point_position(int p_index, const Vector3 &p_pos); + Vector3 get_point_position(int p_index) const; void set_point_tilt(int p_index, float p_tilt); float get_point_tilt(int p_index) const; void set_point_in(int p_index, const Vector3 &p_in); diff --git a/scene/resources/default_theme/default_theme.cpp b/scene/resources/default_theme/default_theme.cpp index fdea5960e5..2fbd5ebdd3 100644 --- a/scene/resources/default_theme/default_theme.cpp +++ b/scene/resources/default_theme/default_theme.cpp @@ -794,7 +794,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const // RichTextLabel theme->set_stylebox("focus", "RichTextLabel", focus); - theme->set_stylebox("normal", "RichTextLabel", make_stylebox(tree_bg_png, 3, 3, 3, 3)); + theme->set_stylebox("normal", "RichTextLabel", make_empty_stylebox(0, 0, 0, 0)); theme->set_font("normal_font", "RichTextLabel", default_font); theme->set_font("bold_font", "RichTextLabel", default_font); @@ -879,7 +879,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const theme->set_icon("minus", "GraphEdit", make_icon(icon_zoom_less_png)); theme->set_icon("reset", "GraphEdit", make_icon(icon_zoom_reset_png)); theme->set_icon("more", "GraphEdit", make_icon(icon_zoom_more_png)); - theme->set_icon("snap", "GraphEdit", make_icon(icon_snap_png)); + theme->set_icon("SnapGrid", "GraphEdit", make_icon(icon_snap_grid_png)); theme->set_stylebox("bg", "GraphEdit", make_stylebox(tree_bg_png, 4, 4, 4, 5)); theme->set_color("grid_minor", "GraphEdit", Color(1, 1, 1, 0.05)); theme->set_color("grid_major", "GraphEdit", Color(1, 1, 1, 0.2)); diff --git a/scene/resources/default_theme/icon_snap.png b/scene/resources/default_theme/icon_snap_grid.png Binary files differindex 93194d34e7..44db9bdfdc 100644 --- a/scene/resources/default_theme/icon_snap.png +++ b/scene/resources/default_theme/icon_snap_grid.png diff --git a/scene/resources/default_theme/theme_data.h b/scene/resources/default_theme/theme_data.h index bed4bdb760..6643b4ccc1 100644 --- a/scene/resources/default_theme/theme_data.h +++ b/scene/resources/default_theme/theme_data.h @@ -182,8 +182,8 @@ static const unsigned char icon_reload_png[] = { 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0, 0x10, 0x8, 0x6, 0x0, 0x0, 0x0, 0x1f, 0xf3, 0xff, 0x61, 0x0, 0x0, 0x0, 0x6, 0x62, 0x4b, 0x47, 0x44, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xa0, 0xbd, 0xa7, 0x93, 0x0, 0x0, 0x1, 0x59, 0x49, 0x44, 0x41, 0x54, 0x38, 0x8d, 0xcd, 0x92, 0x31, 0x4b, 0x3, 0x31, 0x18, 0x86, 0x9f, 0x5c, 0xe, 0xec, 0x20, 0x76, 0x70, 0x39, 0xd0, 0xe3, 0xba, 0x74, 0x51, 0x41, 0xdd, 0xfc, 0x7, 0xba, 0xb8, 0x8, 0x52, 0xec, 0x2e, 0x4e, 0x3a, 0x88, 0x3f, 0xa3, 0xa3, 0x53, 0x7, 0x47, 0x67, 0x41, 0x17, 0xdd, 0x9c, 0x5c, 0x3b, 0xd8, 0x82, 0x64, 0x68, 0xca, 0xd5, 0x55, 0x11, 0x3c, 0x1a, 0x87, 0x24, 0x2e, 0xd7, 0x72, 0x9e, 0x9e, 0xab, 0xbe, 0xd3, 0xc7, 0x1b, 0x9e, 0x37, 0xf9, 0xbe, 0x7c, 0xf0, 0xd7, 0x12, 0x3f, 0x99, 0x4a, 0xa9, 0xb9, 0x30, 0xc, 0x8f, 0x84, 0x10, 0x7, 0xc0, 0x5a, 0x6e, 0x3f, 0x3a, 0xe7, 0x2e, 0xad, 0xb5, 0xdd, 0x66, 0xb3, 0xf9, 0x51, 0x19, 0x90, 0xa6, 0xe9, 0x92, 0xb5, 0xf6, 0x6, 0x58, 0xaf, 0xb8, 0xb4, 0x27, 0xa5, 0xdc, 0x8d, 0xe3, 0xf8, 0x19, 0x20, 0x28, 0xdf, 0x5c, 0x80, 0x53, 0x60, 0xdf, 0x18, 0x53, 0x37, 0xc6, 0xd4, 0xbd, 0xf7, 0x7b, 0xc0, 0x13, 0xb0, 0x61, 0xad, 0xbd, 0x56, 0x4a, 0xcd, 0x1, 0x84, 0xc5, 0x80, 0x30, 0xc, 0x8f, 0xa6, 0xb0, 0x94, 0x72, 0x33, 0x8e, 0xe3, 0x97, 0xc2, 0xf1, 0xd5, 0x68, 0x34, 0xba, 0xf7, 0xde, 0xf7, 0x80, 0xd, 0x29, 0xe5, 0x21, 0x70, 0xfe, 0xe5, 0x5, 0x42, 0x88, 0x76, 0x5e, 0x9e, 0x96, 0x60, 0x0, 0x92, 0x24, 0x79, 0x75, 0xce, 0x9d, 0x1, 0x4, 0x41, 0xd0, 0xfe, 0xd6, 0x2, 0xb0, 0x2, 0x60, 0x8c, 0xb9, 0xab, 0xe8, 0x1f, 0x6b, 0xed, 0x6d, 0x5e, 0xae, 0xce, 0x2, 0xb4, 0xd6, 0x17, 0x5a, 0x6b, 0x7, 0xcc, 0x3, 0xd4, 0x6a, 0xb5, 0x37, 0xad, 0xf5, 0xc5, 0x4f, 0x1, 0x41, 0x10, 0x7c, 0x19, 0x7c, 0x90, 0x3, 0xc7, 0xc0, 0xa0, 0xe0, 0xf, 0x72, 0xef, 0x9b, 0x84, 0x10, 0xdb, 0x79, 0xd9, 0x9f, 0x5, 0x44, 0x51, 0x94, 0x9, 0x21, 0x5a, 0x40, 0x6, 0x64, 0x42, 0x88, 0x56, 0x14, 0x45, 0x59, 0x19, 0x1e, 0x8f, 0xc7, 0x8b, 0x52, 0xca, 0xe, 0x80, 0x73, 0xee, 0x12, 0xa, 0xbf, 0x90, 0x24, 0x49, 0x7f, 0x38, 0x1c, 0x1e, 0x3, 0x34, 0x1a, 0x8d, 0x7e, 0x11, 0x54, 0x4a, 0x2d, 0x48, 0x29, 0x77, 0xac, 0xb5, 0x1d, 0xef, 0xfd, 0x32, 0xd0, 0x9b, 0x4c, 0x26, 0x5d, 0xa8, 0xd8, 0xc4, 0xb2, 0xf2, 0xf9, 0x4c, 0x55, 0xbd, 0x48, 0xbf, 0xe8, 0x1d, 0x78, 0x70, 0xce, 0x9d, 0x64, 0x59, 0xb6, 0x35, 0x85, 0xff, 0x87, 0x3e, 0x1, 0x53, 0x7, 0x87, 0x11, 0xd3, 0x3a, 0x9b, 0x9e, 0x0, 0x0, 0x0, 0x0, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82 }; -static const unsigned char icon_snap_png[] = { - 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0, 0x10, 0x8, 0x6, 0x0, 0x0, 0x0, 0x1f, 0xf3, 0xff, 0x61, 0x0, 0x0, 0x0, 0x6, 0x62, 0x4b, 0x47, 0x44, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xa0, 0xbd, 0xa7, 0x93, 0x0, 0x0, 0x0, 0xc2, 0x49, 0x44, 0x41, 0x54, 0x38, 0x8d, 0xad, 0x90, 0xbd, 0xa, 0xc2, 0x30, 0x14, 0x85, 0xbf, 0x5b, 0x5c, 0x23, 0xe8, 0x6c, 0x9f, 0xc1, 0xb7, 0xd0, 0x47, 0xd1, 0x47, 0x70, 0x48, 0xa1, 0x43, 0x57, 0xe9, 0xd3, 0x88, 0x93, 0xef, 0xe0, 0xea, 0x5c, 0x9d, 0x1d, 0xb2, 0x96, 0xc6, 0xa1, 0x9, 0xd4, 0xd8, 0xd8, 0x4a, 0xfd, 0x20, 0x10, 0xee, 0xcf, 0xe1, 0xdc, 0x3, 0x1d, 0x8c, 0x31, 0xd6, 0x18, 0x63, 0x9, 0x88, 0xd5, 0x1, 0x92, 0xbe, 0xe2, 0x2f, 0x4c, 0x16, 0x90, 0x98, 0xb5, 0x21, 0x94, 0x52, 0xf2, 0x17, 0x7, 0x6f, 0x7c, 0xb, 0x2b, 0xc6, 0x64, 0x7, 0xb3, 0xa1, 0x1, 0x5b, 0x14, 0x29, 0x50, 0x2, 0x1b, 0x0, 0x44, 0x2e, 0x34, 0xcd, 0x41, 0xb2, 0xec, 0x6, 0x20, 0xdd, 0x61, 0x6f, 0xdf, 0x7, 0xe4, 0x96, 0xaf, 0xc0, 0x32, 0xd0, 0x7d, 0x2, 0x6b, 0xd1, 0xba, 0x4a, 0xfc, 0xdd, 0x91, 0xdb, 0x4b, 0xb7, 0x7c, 0x2, 0x56, 0xd4, 0x75, 0xa, 0x9c, 0x81, 0x5, 0x70, 0x84, 0xe1, 0xc, 0x5a, 0xdb, 0x75, 0xbd, 0x17, 0xad, 0x1f, 0x92, 0xe7, 0x77, 0x60, 0xe7, 0x7a, 0x5b, 0x80, 0x44, 0x29, 0x25, 0xfe, 0xf5, 0x8, 0x28, 0x0, 0xb7, 0xd8, 0x46, 0xa0, 0x75, 0xe5, 0xbe, 0xf3, 0x31, 0xe, 0x7e, 0x23, 0xcc, 0xc2, 0x3a, 0xc2, 0xb9, 0x58, 0xfd, 0x83, 0xc9, 0x2, 0x63, 0x78, 0x1, 0x4a, 0x50, 0x70, 0x86, 0xcc, 0x86, 0x2, 0x4, 0x0, 0x0, 0x0, 0x0, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82 +static const unsigned char icon_snap_grid_png[] = { + 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0, 0x10, 0x8, 0x6, 0x0, 0x0, 0x0, 0x1f, 0xf3, 0xff, 0x61, 0x0, 0x0, 0x0, 0x4, 0x73, 0x42, 0x49, 0x54, 0x8, 0x8, 0x8, 0x8, 0x7c, 0x8, 0x64, 0x88, 0x0, 0x0, 0x0, 0x9, 0x70, 0x48, 0x59, 0x73, 0x0, 0x0, 0xe, 0xc4, 0x0, 0x0, 0xe, 0xc4, 0x1, 0x95, 0x2b, 0xe, 0x1b, 0x0, 0x0, 0x0, 0x19, 0x74, 0x45, 0x58, 0x74, 0x53, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x0, 0x77, 0x77, 0x77, 0x2e, 0x69, 0x6e, 0x6b, 0x73, 0x63, 0x61, 0x70, 0x65, 0x2e, 0x6f, 0x72, 0x67, 0x9b, 0xee, 0x3c, 0x1a, 0x0, 0x0, 0x0, 0xc2, 0x49, 0x44, 0x41, 0x54, 0x38, 0x8d, 0xad, 0x90, 0xbd, 0xa, 0xc2, 0x30, 0x14, 0x85, 0xbf, 0x5b, 0x5c, 0x23, 0xe8, 0x6c, 0x9f, 0xc1, 0xb7, 0xd0, 0x47, 0xd1, 0x47, 0x70, 0x48, 0xa1, 0x43, 0x57, 0xe9, 0xd3, 0x88, 0x93, 0xef, 0xe0, 0xea, 0x5c, 0x9d, 0x1d, 0xb2, 0x96, 0xc6, 0xa1, 0x9, 0xd4, 0xd8, 0xd8, 0x4a, 0xfd, 0x20, 0x10, 0xee, 0xcf, 0xe1, 0xdc, 0x3, 0x1d, 0x8c, 0x31, 0xd6, 0x18, 0x63, 0x9, 0x88, 0xd5, 0x1, 0x92, 0xbe, 0xe2, 0x2f, 0x4c, 0x16, 0x90, 0x98, 0xb5, 0x21, 0x94, 0x52, 0xf2, 0x17, 0x7, 0x6f, 0x7c, 0xb, 0x2b, 0xc6, 0x64, 0x7, 0xb3, 0xa1, 0x1, 0x5b, 0x14, 0x29, 0x50, 0x2, 0x1b, 0x0, 0x44, 0x2e, 0x34, 0xcd, 0x41, 0xb2, 0xec, 0x6, 0x20, 0xdd, 0x61, 0x6f, 0xdf, 0x7, 0xe4, 0x96, 0xaf, 0xc0, 0x32, 0xd0, 0x7d, 0x2, 0x6b, 0xd1, 0xba, 0x4a, 0xfc, 0xdd, 0x91, 0xdb, 0x4b, 0xb7, 0x7c, 0x2, 0x56, 0xd4, 0x75, 0xa, 0x9c, 0x81, 0x5, 0x70, 0x84, 0xe1, 0xc, 0x5a, 0xdb, 0x75, 0xbd, 0x17, 0xad, 0x1f, 0x92, 0xe7, 0x77, 0x60, 0xe7, 0x7a, 0x5b, 0x80, 0x44, 0x29, 0x25, 0xfe, 0xf5, 0x8, 0x28, 0x0, 0xb7, 0xd8, 0x46, 0xa0, 0x75, 0xe5, 0xbe, 0xf3, 0x31, 0xe, 0x7e, 0x23, 0xcc, 0xc2, 0x3a, 0xc2, 0xb9, 0x58, 0xfd, 0x83, 0xc9, 0x2, 0x63, 0x78, 0x1, 0x4a, 0x50, 0x70, 0x86, 0xcc, 0x86, 0x2, 0x4, 0x0, 0x0, 0x0, 0x0, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82 }; static const unsigned char icon_stop_png[] = { diff --git a/scene/resources/dynamic_font.cpp b/scene/resources/dynamic_font.cpp index 82739b58a0..b2d87c8f35 100644 --- a/scene/resources/dynamic_font.cpp +++ b/scene/resources/dynamic_font.cpp @@ -397,7 +397,7 @@ unsigned long DynamicFontAtSize::_ft_stream_io(FT_Stream stream, unsigned long o FileAccess *f = (FileAccess *)stream->descriptor.pointer; - if (f->get_pos() != offset) { + if (f->get_position() != offset) { f->seek(offset); } diff --git a/scene/resources/font.cpp b/scene/resources/font.cpp index ea75748b3d..2b44ea4554 100644 --- a/scene/resources/font.cpp +++ b/scene/resources/font.cpp @@ -80,13 +80,13 @@ void Font::update_changes() { void Font::_bind_methods() { - ClassDB::bind_method(D_METHOD("draw", "canvas_item", "pos", "string", "modulate", "clip_w"), &Font::draw, DEFVAL(Color(1, 1, 1)), DEFVAL(-1)); + ClassDB::bind_method(D_METHOD("draw", "canvas_item", "position", "string", "modulate", "clip_w"), &Font::draw, DEFVAL(Color(1, 1, 1)), DEFVAL(-1)); ClassDB::bind_method(D_METHOD("get_ascent"), &Font::get_ascent); ClassDB::bind_method(D_METHOD("get_descent"), &Font::get_descent); ClassDB::bind_method(D_METHOD("get_height"), &Font::get_height); ClassDB::bind_method(D_METHOD("is_distance_field_hint"), &Font::is_distance_field_hint); ClassDB::bind_method(D_METHOD("get_string_size", "string"), &Font::get_string_size); - ClassDB::bind_method(D_METHOD("draw_char", "canvas_item", "pos", "char", "next", "modulate"), &Font::draw_char, DEFVAL(-1), DEFVAL(Color(1, 1, 1))); + ClassDB::bind_method(D_METHOD("draw_char", "canvas_item", "position", "char", "next", "modulate"), &Font::draw_char, DEFVAL(-1), DEFVAL(Color(1, 1, 1))); ClassDB::bind_method(D_METHOD("update_changes"), &Font::update_changes); } diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp index a187692bcb..abe9a00c3f 100644 --- a/scene/resources/material.cpp +++ b/scene/resources/material.cpp @@ -67,8 +67,8 @@ RID Material::get_rid() const { } void Material::_validate_property(PropertyInfo &property) const { - if (!_can_do_next_pass() && property.name=="next_pass") { - property.usage=0; + if (!_can_do_next_pass() && property.name == "next_pass") { + property.usage = 0; } } @@ -80,7 +80,7 @@ void Material::_bind_methods() { ClassDB::bind_method(D_METHOD("set_render_priority", "priority"), &Material::set_render_priority); ClassDB::bind_method(D_METHOD("get_render_priority"), &Material::get_render_priority); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "render_priority", PROPERTY_HINT_RANGE, itos(RENDER_PRIORITY_MIN) + "," + itos(RENDER_PRIORITY_MAX) + ",1"), "set_render_priority", "get_render_priority"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "render_priority", PROPERTY_HINT_RANGE, itos(RENDER_PRIORITY_MIN) + "," + itos(RENDER_PRIORITY_MAX) + ",1"), "set_render_priority", "get_render_priority"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "next_pass", PROPERTY_HINT_RESOURCE_TYPE, "Material"), "set_next_pass", "get_next_pass"); BIND_CONSTANT(RENDER_PRIORITY_MAX); @@ -212,7 +212,7 @@ void ShaderMaterial::get_argument_options(const StringName &p_function, int p_id bool ShaderMaterial::_can_do_next_pass() const { - return shader.is_valid() && shader->get_mode()==Shader::MODE_SPATIAL; + return shader.is_valid() && shader->get_mode() == Shader::MODE_SPATIAL; } ShaderMaterial::ShaderMaterial() { diff --git a/scene/resources/mesh.cpp b/scene/resources/mesh.cpp index aa7827a61a..db5d87d703 100644 --- a/scene/resources/mesh.cpp +++ b/scene/resources/mesh.cpp @@ -422,6 +422,46 @@ void Mesh::_bind_methods() { BIND_ENUM_CONSTANT(PRIMITIVE_TRIANGLES); BIND_ENUM_CONSTANT(PRIMITIVE_TRIANGLE_STRIP); BIND_ENUM_CONSTANT(PRIMITIVE_TRIANGLE_FAN); + + BIND_ENUM_CONSTANT(BLEND_SHAPE_MODE_NORMALIZED); + BIND_ENUM_CONSTANT(BLEND_SHAPE_MODE_RELATIVE); + + BIND_ENUM_CONSTANT(ARRAY_FORMAT_VERTEX); + BIND_ENUM_CONSTANT(ARRAY_FORMAT_NORMAL); + BIND_ENUM_CONSTANT(ARRAY_FORMAT_TANGENT); + BIND_ENUM_CONSTANT(ARRAY_FORMAT_COLOR); + BIND_ENUM_CONSTANT(ARRAY_FORMAT_TEX_UV); + BIND_ENUM_CONSTANT(ARRAY_FORMAT_TEX_UV2); + BIND_ENUM_CONSTANT(ARRAY_FORMAT_BONES); + BIND_ENUM_CONSTANT(ARRAY_FORMAT_WEIGHTS); + BIND_ENUM_CONSTANT(ARRAY_FORMAT_INDEX); + + BIND_ENUM_CONSTANT(ARRAY_COMPRESS_BASE); + BIND_ENUM_CONSTANT(ARRAY_COMPRESS_VERTEX); + BIND_ENUM_CONSTANT(ARRAY_COMPRESS_NORMAL); + BIND_ENUM_CONSTANT(ARRAY_COMPRESS_TANGENT); + BIND_ENUM_CONSTANT(ARRAY_COMPRESS_COLOR); + BIND_ENUM_CONSTANT(ARRAY_COMPRESS_TEX_UV); + BIND_ENUM_CONSTANT(ARRAY_COMPRESS_TEX_UV2); + BIND_ENUM_CONSTANT(ARRAY_COMPRESS_BONES); + BIND_ENUM_CONSTANT(ARRAY_COMPRESS_WEIGHTS); + BIND_ENUM_CONSTANT(ARRAY_COMPRESS_INDEX); + + BIND_ENUM_CONSTANT(ARRAY_FLAG_USE_2D_VERTICES); + BIND_ENUM_CONSTANT(ARRAY_FLAG_USE_16_BIT_BONES); + + BIND_ENUM_CONSTANT(ARRAY_COMPRESS_DEFAULT); + + BIND_ENUM_CONSTANT(ARRAY_VERTEX); + BIND_ENUM_CONSTANT(ARRAY_NORMAL); + BIND_ENUM_CONSTANT(ARRAY_TANGENT); + BIND_ENUM_CONSTANT(ARRAY_COLOR); + BIND_ENUM_CONSTANT(ARRAY_TEX_UV); + BIND_ENUM_CONSTANT(ARRAY_TEX_UV2); + BIND_ENUM_CONSTANT(ARRAY_BONES); + BIND_ENUM_CONSTANT(ARRAY_WEIGHTS); + BIND_ENUM_CONSTANT(ARRAY_INDEX); + BIND_ENUM_CONSTANT(ARRAY_MAX); } Mesh::Mesh() { @@ -761,7 +801,7 @@ Array ArrayMesh::surface_get_arrays(int p_surface) const { Array ArrayMesh::surface_get_blend_shape_arrays(int p_surface) const { ERR_FAIL_INDEX_V(p_surface, surfaces.size(), Array()); - return Array(); + return VisualServer::get_singleton()->mesh_surface_get_blend_shape_arrays(mesh, p_surface); } int ArrayMesh::get_surface_count() const { @@ -1010,6 +1050,8 @@ void ArrayMesh::_bind_methods() { ClassDB::bind_method(D_METHOD("surface_get_material", "surf_idx"), &ArrayMesh::surface_get_material); ClassDB::bind_method(D_METHOD("surface_set_name", "surf_idx", "name"), &ArrayMesh::surface_set_name); ClassDB::bind_method(D_METHOD("surface_get_name", "surf_idx"), &ArrayMesh::surface_get_name); + ClassDB::bind_method(D_METHOD("surface_get_arrays", "surf_idx"), &ArrayMesh::surface_get_arrays); + ClassDB::bind_method(D_METHOD("surface_get_blend_shape_arrays", "surf_idx"), &ArrayMesh::surface_get_blend_shape_arrays); ClassDB::bind_method(D_METHOD("create_trimesh_shape"), &ArrayMesh::create_trimesh_shape); ClassDB::bind_method(D_METHOD("create_convex_shape"), &ArrayMesh::create_convex_shape); ClassDB::bind_method(D_METHOD("create_outline", "margin"), &ArrayMesh::create_outline); diff --git a/scene/resources/mesh.h b/scene/resources/mesh.h index 53c6eb2d89..f4edb258b6 100644 --- a/scene/resources/mesh.h +++ b/scene/resources/mesh.h @@ -120,6 +120,7 @@ public: virtual int surface_get_array_len(int p_idx) const = 0; virtual int surface_get_array_index_len(int p_idx) const = 0; virtual Array surface_get_arrays(int p_surface) const = 0; + virtual Array surface_get_blend_shape_arrays(int p_surface) const = 0; virtual uint32_t surface_get_format(int p_idx) const = 0; virtual PrimitiveType surface_get_primitive_type(int p_idx) const = 0; virtual Ref<Material> surface_get_material(int p_idx) const = 0; @@ -174,7 +175,7 @@ public: void add_surface(uint32_t p_format, PrimitiveType p_primitive, const PoolVector<uint8_t> &p_array, int p_vertex_count, const PoolVector<uint8_t> &p_index_array, int p_index_count, const Rect3 &p_aabb, const Vector<PoolVector<uint8_t> > &p_blend_shapes = Vector<PoolVector<uint8_t> >(), const Vector<Rect3> &p_bone_aabbs = Vector<Rect3>()); Array surface_get_arrays(int p_surface) const; - virtual Array surface_get_blend_shape_arrays(int p_surface) const; + Array surface_get_blend_shape_arrays(int p_surface) const; void add_blend_shape(const StringName &p_name); int get_blend_shape_count() const; diff --git a/scene/resources/packed_scene.cpp b/scene/resources/packed_scene.cpp index c525ca600a..5d6f44dfef 100644 --- a/scene/resources/packed_scene.cpp +++ b/scene/resources/packed_scene.cpp @@ -92,7 +92,7 @@ Node *SceneState::instance(GenEditState p_edit_state) const { NODE_FROM_ID(nparent, n.parent); #ifdef DEBUG_ENABLED - if (!nparent && n.parent & FLAG_ID_IS_PATH) { + if (!nparent && (n.parent & FLAG_ID_IS_PATH)) { WARN_PRINT(String("Parent path '" + String(node_paths[n.parent & FLAG_MASK]) + "' for node '" + String(snames[n.name]) + "' has vanished when instancing: '" + get_path() + "'.").ascii().get_data()); } @@ -489,7 +489,7 @@ Error SceneState::_parse_node(Node *p_owner, Node *p_node, int p_parent_idx, Map // only save what has been changed // only save changed properties in instance - if (E->get().usage & PROPERTY_USAGE_NO_INSTANCE_STATE || E->get().name == "__meta__") { + if ((E->get().usage & PROPERTY_USAGE_NO_INSTANCE_STATE) || E->get().name == "__meta__") { //property has requested that no instance state is saved, sorry //also, meta won't be overridden or saved continue; @@ -1288,7 +1288,7 @@ bool SceneState::is_node_instance_placeholder(int p_idx) const { ERR_FAIL_INDEX_V(p_idx, nodes.size(), false); - return nodes[p_idx].instance >= 0 && nodes[p_idx].instance & FLAG_INSTANCE_IS_PLACEHOLDER; + return nodes[p_idx].instance >= 0 && (nodes[p_idx].instance & FLAG_INSTANCE_IS_PLACEHOLDER); } Ref<PackedScene> SceneState::get_node_instance(int p_idx) const { @@ -1313,7 +1313,7 @@ String SceneState::get_node_instance_placeholder(int p_idx) const { ERR_FAIL_INDEX_V(p_idx, nodes.size(), String()); - if (nodes[p_idx].instance >= 0 && nodes[p_idx].instance & FLAG_INSTANCE_IS_PLACEHOLDER) { + if (nodes[p_idx].instance >= 0 && (nodes[p_idx].instance & FLAG_INSTANCE_IS_PLACEHOLDER)) { return variants[nodes[p_idx].instance & FLAG_MASK]; } diff --git a/scene/resources/primitive_meshes.cpp b/scene/resources/primitive_meshes.cpp index cfc1468533..ba356d89b1 100644 --- a/scene/resources/primitive_meshes.cpp +++ b/scene/resources/primitive_meshes.cpp @@ -105,6 +105,15 @@ Array PrimitiveMesh::surface_get_arrays(int p_surface) const { return VisualServer::get_singleton()->mesh_surface_get_arrays(mesh, 0); } +Array PrimitiveMesh::surface_get_blend_shape_arrays(int p_surface) const { + ERR_FAIL_INDEX_V(p_surface, 1, Array()); + if (pending_request) { + _update(); + } + + return Array(); +} + uint32_t PrimitiveMesh::surface_get_format(int p_idx) const { ERR_FAIL_INDEX_V(p_idx, 1, 0); if (pending_request) { @@ -119,6 +128,8 @@ Mesh::PrimitiveType PrimitiveMesh::surface_get_primitive_type(int p_idx) const { } Ref<Material> PrimitiveMesh::surface_get_material(int p_idx) const { + ERR_FAIL_INDEX_V(p_idx, 1, NULL); + return material; } @@ -151,6 +162,8 @@ void PrimitiveMesh::_bind_methods() { ClassDB::bind_method(D_METHOD("set_material", "material"), &PrimitiveMesh::set_material); ClassDB::bind_method(D_METHOD("get_material"), &PrimitiveMesh::get_material); + ClassDB::bind_method(D_METHOD("get_mesh_arrays"), &PrimitiveMesh::get_mesh_arrays); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "material", PROPERTY_HINT_RESOURCE_TYPE, "Material"), "set_material", "get_material"); } @@ -168,6 +181,10 @@ Ref<Material> PrimitiveMesh::get_material() const { return material; } +Array PrimitiveMesh::get_mesh_arrays() const { + return surface_get_arrays(0); +} + PrimitiveMesh::PrimitiveMesh() { // defaults mesh = VisualServer::get_singleton()->mesh_create(); @@ -213,7 +230,6 @@ void CapsuleMesh::_create_mesh_array(Array &p_arr) const { prevrow = 0; for (j = 0; j <= (rings + 1); j++) { v = j; - w; v /= (rings + 1); w = sin(0.5 * Math_PI * v); @@ -292,7 +308,6 @@ void CapsuleMesh::_create_mesh_array(Array &p_arr) const { prevrow = 0; for (j = 0; j <= (rings + 1); j++) { v = j; - w; v /= (rings + 1); v += 1.0; diff --git a/scene/resources/primitive_meshes.h b/scene/resources/primitive_meshes.h index 34fb75a196..38a5695883 100644 --- a/scene/resources/primitive_meshes.h +++ b/scene/resources/primitive_meshes.h @@ -67,6 +67,7 @@ public: virtual int surface_get_array_len(int p_idx) const; virtual int surface_get_array_index_len(int p_idx) const; virtual Array surface_get_arrays(int p_surface) const; + virtual Array surface_get_blend_shape_arrays(int p_surface) const; virtual uint32_t surface_get_format(int p_idx) const; virtual Mesh::PrimitiveType surface_get_primitive_type(int p_idx) const; virtual Ref<Material> surface_get_material(int p_idx) const; @@ -78,6 +79,8 @@ public: void set_material(const Ref<Material> &p_material); Ref<Material> get_material() const; + Array get_mesh_arrays() const; + PrimitiveMesh(); ~PrimitiveMesh(); }; diff --git a/scene/resources/scene_format_text.cpp b/scene/resources/scene_format_text.cpp index 14e2ef83f8..f0304bfaa5 100644 --- a/scene/resources/scene_format_text.cpp +++ b/scene/resources/scene_format_text.cpp @@ -679,7 +679,7 @@ Error ResourceInteractiveLoaderText::rename_dependencies(FileAccess *p_f, const String base_path = local_path.get_base_dir(); - uint64_t tag_end = f->get_pos(); + uint64_t tag_end = f->get_position(); while (true) { @@ -741,7 +741,7 @@ Error ResourceInteractiveLoaderText::rename_dependencies(FileAccess *p_f, const fw->store_line("[ext_resource path=\"" + path + "\" type=\"" + type + "\" id=" + itos(index) + "]"); - tag_end = f->get_pos(); + tag_end = f->get_position(); } } diff --git a/scene/resources/shader_graph.cpp b/scene/resources/shader_graph.cpp index 2ca9a14562..3813854922 100644 --- a/scene/resources/shader_graph.cpp +++ b/scene/resources/shader_graph.cpp @@ -172,8 +172,8 @@ void ShaderGraph::_bind_methods() { ClassDB::bind_method(D_METHOD("node_add","shader_type","node_type","id"),&ShaderGraph::node_add); ClassDB::bind_method(D_METHOD("node_remove","shader_type","id"),&ShaderGraph::node_remove); - ClassDB::bind_method(D_METHOD("node_set_pos","shader_type","id","pos"),&ShaderGraph::node_set_pos); - ClassDB::bind_method(D_METHOD("node_get_pos","shader_type","id"),&ShaderGraph::node_get_pos); + ClassDB::bind_method(D_METHOD("node_set_position","shader_type","id","position"),&ShaderGraph::node_set_position); + ClassDB::bind_method(D_METHOD("node_get_position","shader_type","id"),&ShaderGraph::node_get_position); ClassDB::bind_method(D_METHOD("node_get_type","shader_type","id"),&ShaderGraph::node_get_type); @@ -501,7 +501,7 @@ void ShaderGraph::node_add(ShaderType p_type, NodeType p_node_type,int p_id) { _request_update(); } -void ShaderGraph::node_set_pos(ShaderType p_type,int p_id, const Vector2& p_pos) { +void ShaderGraph::node_set_position(ShaderType p_type,int p_id, const Vector2& p_pos) { ERR_FAIL_INDEX(p_type,3); ERR_FAIL_COND(!shader[p_type].node_map.has(p_id)); @@ -509,7 +509,7 @@ void ShaderGraph::node_set_pos(ShaderType p_type,int p_id, const Vector2& p_pos) _request_update(); } -Vector2 ShaderGraph::node_get_pos(ShaderType p_type,int p_id) const { +Vector2 ShaderGraph::node_get_position(ShaderType p_type,int p_id) const { ERR_FAIL_INDEX_V(p_type,3,Vector2()); ERR_FAIL_COND_V(!shader[p_type].node_map.has(p_id),Vector2()); @@ -1245,7 +1245,7 @@ Variant ShaderGraph::node_get_state(ShaderType p_type,int p_id) const { ERR_FAIL_COND_V(!shader[p_type].node_map.has(p_id),Variant()); const Node& n = shader[p_type].node_map[p_id]; Dictionary s; - s["pos"]=n.pos; + s["position"]=n.pos; s["param1"]=n.param1; s["param2"]=n.param2; Array keys; @@ -1263,12 +1263,12 @@ void ShaderGraph::node_set_state(ShaderType p_type,int p_id,const Variant& p_sta ERR_FAIL_COND(!shader[p_type].node_map.has(p_id)); Node& n = shader[p_type].node_map[p_id]; Dictionary d = p_state; - ERR_FAIL_COND(!d.has("pos")); + ERR_FAIL_COND(!d.has("position")); ERR_FAIL_COND(!d.has("param1")); ERR_FAIL_COND(!d.has("param2")); ERR_FAIL_COND(!d.has("default_keys")); - n.pos=d["pos"]; + n.pos=d["position"]; n.param1=d["param1"]; n.param2=d["param2"]; Array keys = d["default_keys"]; diff --git a/scene/resources/shader_graph.h b/scene/resources/shader_graph.h index 9a74b6c53a..5d9dd7054f 100644 --- a/scene/resources/shader_graph.h +++ b/scene/resources/shader_graph.h @@ -195,8 +195,8 @@ public: void node_add(ShaderType p_type, NodeType p_node_type, int p_id); void node_remove(ShaderType p_which,int p_id); - void node_set_pos(ShaderType p_which,int p_id,const Point2& p_pos); - Point2 node_get_pos(ShaderType p_which,int p_id) const; + void node_set_position(ShaderType p_which,int p_id,const Point2& p_pos); + Point2 node_get_position(ShaderType p_which,int p_id) const; void get_node_list(ShaderType p_which,List<int> *p_node_list) const; NodeType node_get_type(ShaderType p_which,int p_id) const; diff --git a/scene/resources/sky_box.cpp b/scene/resources/sky_box.cpp index 9af8c42110..2ef20f67f5 100644 --- a/scene/resources/sky_box.cpp +++ b/scene/resources/sky_box.cpp @@ -419,10 +419,10 @@ void ProceduralSky::_queue_update() { call_deferred("_update_sky"); } -void ProceduralSky::_thread_done(const Ref<Image> &image) { +void ProceduralSky::_thread_done(const Ref<Image> &p_image) { - VS::get_singleton()->texture_allocate(texture, image->get_width(), image->get_height(), Image::FORMAT_RGBE9995, VS::TEXTURE_FLAG_FILTER | VS::TEXTURE_FLAG_REPEAT); - VS::get_singleton()->texture_set_data(texture, image); + VS::get_singleton()->texture_allocate(texture, p_image->get_width(), p_image->get_height(), Image::FORMAT_RGBE9995, VS::TEXTURE_FLAG_FILTER | VS::TEXTURE_FLAG_REPEAT); + VS::get_singleton()->texture_set_data(texture, p_image); _radiance_changed(); Thread::wait_to_finish(sky_thread); memdelete(sky_thread); diff --git a/scene/resources/style_box.h b/scene/resources/style_box.h index 3d085f7166..4627c900ff 100644 --- a/scene/resources/style_box.h +++ b/scene/resources/style_box.h @@ -178,7 +178,7 @@ public: void set_border_width_all(int p_size); int get_border_width_min() const; - void set_border_width(Margin p_margin, int p_size); + void set_border_width(Margin p_margin, int p_width); int get_border_width(Margin p_margin) const; //blend @@ -214,7 +214,7 @@ public: int get_shadow_size() const; //ANTI_ALIASING - void set_anti_aliased(const bool &p_anit_aliasing); + void set_anti_aliased(const bool &p_anti_aliased); bool is_anti_aliased() const; //tempAA void set_aa_size(const int &p_aa_size); diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp index 6a9ded9ea3..c202fad1a4 100644 --- a/scene/resources/texture.cpp +++ b/scene/resources/texture.cpp @@ -70,7 +70,7 @@ void Texture::_bind_methods() { ClassDB::bind_method(D_METHOD("has_alpha"), &Texture::has_alpha); ClassDB::bind_method(D_METHOD("set_flags", "flags"), &Texture::set_flags); ClassDB::bind_method(D_METHOD("get_flags"), &Texture::get_flags); - ClassDB::bind_method(D_METHOD("draw", "canvas_item", "pos", "modulate", "transpose", "normal_map"), &Texture::draw, DEFVAL(Color(1, 1, 1)), DEFVAL(false), DEFVAL(Variant())); + ClassDB::bind_method(D_METHOD("draw", "canvas_item", "position", "modulate", "transpose", "normal_map"), &Texture::draw, DEFVAL(Color(1, 1, 1)), DEFVAL(false), DEFVAL(Variant())); ClassDB::bind_method(D_METHOD("draw_rect", "canvas_item", "rect", "tile", "modulate", "transpose", "normal_map"), &Texture::draw_rect, DEFVAL(Color(1, 1, 1)), DEFVAL(false), DEFVAL(Variant())); ClassDB::bind_method(D_METHOD("draw_rect_region", "canvas_item", "rect", "src_rect", "modulate", "transpose", "normal_map", "clip_uv"), &Texture::draw_rect_region, DEFVAL(Color(1, 1, 1)), DEFVAL(false), DEFVAL(Variant()), DEFVAL(true)); ClassDB::bind_method(D_METHOD("get_data"), &Texture::get_data); @@ -488,7 +488,7 @@ Error StreamTexture::_load_data(const String &p_path, int &tw, int &th, int &fla while (mipmaps > 1 && p_size_limit > 0 && (sw > p_size_limit || sh > p_size_limit)) { - f->seek(f->get_pos() + size); + f->seek(f->get_position() + size); mipmaps = f->get_32(); size = f->get_32(); @@ -610,7 +610,7 @@ Error StreamTexture::_load_data(const String &p_path, int &tw, int &th, int &fla ERR_FAIL_V(ERR_FILE_CORRUPT); } - f->seek(f->get_pos() + ofs); + f->seek(f->get_position() + ofs); PoolVector<uint8_t> img_data; img_data.resize(total_size - ofs); diff --git a/scene/resources/video_stream.h b/scene/resources/video_stream.h index e08be02a07..30264691ee 100644 --- a/scene/resources/video_stream.h +++ b/scene/resources/video_stream.h @@ -55,7 +55,7 @@ public: virtual float get_length() const = 0; - virtual float get_pos() const = 0; + virtual float get_position() const = 0; virtual void seek_pos(float p_time) = 0; virtual void set_audio_track(int p_idx) = 0; |