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

Multimeshinstance3D use_custom_data can't be set by gdscript #58019

Closed
croxis opened this issue Feb 12, 2022 · 1 comment · Fixed by #63215
Closed

Multimeshinstance3D use_custom_data can't be set by gdscript #58019

croxis opened this issue Feb 12, 2022 · 1 comment · Fixed by #63215

Comments

@croxis
Copy link

croxis commented Feb 12, 2022

Tmp2.zip

Godot version

4.0 alpha 2

System information

Linux

Issue description

use_custom_data and cuse_colors can't be set via gdscript when setting up a multimesh in a multimeshinstance3d. Or I failed to read something correctly in the documentation.

init
ERROR: Condition "instance_count > 0" is true.
   at: set_use_custom_data (scene/resources/multimesh.cpp:289)
ERROR: Condition "instance_count > 0" is true.
   at: set_use_colors (scene/resources/multimesh.cpp:280)
init: 1 false

Steps to reproduce

In an otherwise empty project:

extends MultiMeshInstance3D

func _ready():
	print("init")
	multimesh.instance_count = 1
	multimesh.use_custom_data = true
	multimesh.use_colors = true
	print("init: ", multimesh.instance_count, " ", multimesh.use_custom_data)

Minimal reproduction project

No response

@vfig
Copy link

vfig commented Jul 7, 2022

This is a documentation issue. Both Optimization Using MultiMeshes and Animating thousands of fish with MultiMeshInstance note that the transform format, and color/custom options must be set before setting instance_count. To quote the latter:

instance_count specifies how many instances of the mesh you want to draw. For now, leave instance_count at 0 because you cannot change any of the other parameters while instance_count is larger than 0. We will set instance_count in GDScript later.

But this restriction is not mentioned at all in the MultiMesh api reference entry.

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

Successfully merging a pull request may close this issue.

4 participants