Skip to content

Commit 633df0b

Browse files
committed
Handle handle_modes being undefined by giving default values rather than flagging error
1 parent efc7c62 commit 633df0b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

scene/resources/animation.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,12 @@ bool Animation::_set(const StringName &p_name, const Variant &p_value) {
321321
Vector<real_t> times = d["times"];
322322
Vector<real_t> values = d["points"];
323323
#ifdef TOOLS_ENABLED
324-
ERR_FAIL_COND_V(!d.has("handle_modes"), false);
325-
Vector<int> handle_modes = d["handle_modes"];
324+
Vector<int> handle_modes;
325+
if (d.has("handle_modes")) {
326+
handle_modes = d["handle_modes"];
327+
} else {
328+
handle_modes.resize_zeroed(times.size());
329+
}
326330
#endif // TOOLS_ENABLED
327331

328332
ERR_FAIL_COND_V(times.size() * 5 != values.size(), false);

0 commit comments

Comments
 (0)