Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to configure functions with more than five parameters in AnimationTrack #54185

Closed
Rubonnek opened this issue Oct 24, 2021 · 2 comments · Fixed by #54188 or #54189
Closed

Unable to configure functions with more than five parameters in AnimationTrack #54185

Rubonnek opened this issue Oct 24, 2021 · 2 comments · Fixed by #54188 or #54189

Comments

@Rubonnek
Copy link
Member

Godot version

3.x at 4febf69

System information

Arch Linux

Issue description

Currently it's impossible to properly configure AnimationPlayer "Call Method" tracks which call functions with more than five parameters, such as TileMap.set_cell.

The issue is that the argument count is capped at 5, and the possible argument counts for the associated EditorSpinSlider is also capped at 5.

Steps to reproduce

  1. Create an AnimationPlayer node with a TileMap as it's root node.
  2. Add a "Call method" track to the AnimationPlayer tracks.
  3. Insert a track key for TileMap.set_cell
  4. Note that the arguments array has the correct number of parameters (7) but the argument count is stuck at 5.
  5. If one were to decrease the argument count, it will be impossible to increase it back to 7.

Minimal reproduction project

ArgCountBug.zip

Look at the Args array and the Arg Count value Inspector in the following screenshot taken from the attached project

2021-10-24-063527_1425x825_scrot
.

@Rubonnek
Copy link
Member Author

This issue is also present on master.

@Rubonnek
Copy link
Member Author

Limit caused by VARIANT_ARG_MAX, and related macros/function calls.

godot/core/object.h

Lines 46 to 52 in 4febf69

#define VARIANT_ARG_LIST const Variant &p_arg1 = Variant(), const Variant &p_arg2 = Variant(), const Variant &p_arg3 = Variant(), const Variant &p_arg4 = Variant(), const Variant &p_arg5 = Variant()
#define VARIANT_ARG_PASS p_arg1, p_arg2, p_arg3, p_arg4, p_arg5
#define VARIANT_ARG_DECLARE const Variant &p_arg1, const Variant &p_arg2, const Variant &p_arg3, const Variant &p_arg4, const Variant &p_arg5
#define VARIANT_ARG_MAX 5
#define VARIANT_ARGPTRS const Variant *argptr[5] = { &p_arg1, &p_arg2, &p_arg3, &p_arg4, &p_arg5 };
#define VARIANT_ARGPTRS_PASS *argptr[0], *argptr[1], *argptr[2], *argptr[3], *argptr[4]
#define VARIANT_ARGS_FROM_ARRAY(m_arr) m_arr[0], m_arr[1], m_arr[2], m_arr[3], m_arr[4]

Related:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants