-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
Make sure MeshLibrary
shape array has correct number of elements
#56891
Conversation
4336445
to
ed7f842
Compare
Ref<BoxShape3D> box_shape; | ||
box_shape.instantiate(); | ||
arr_shapes[size - 1] = box_shape; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about this, that seems pretty arbitrary, and could lead to a lot of instantiations that will then need to be freed and replaced by what the user wants to use.
Wouldn't it be sufficient to just make the step 2 for the SpinBox?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it be sufficient to just make the step 2 for the SpinBox?
Well not sure that's actually possible currently in the array editor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The array is expecting to have a shape. If there is anything else, even an empty Variant()
the array won't update and the size won't change. A few lines below that piece of code you can find
if (sd.shape.is_valid()) {
shapes.push_back(sd);
}
So, if it isn't a valid shape, nothing happens. Could you think of other way of doing it? It is absolutely arbitrary but is the way I found to do it.
ed7f842
to
5f8b292
Compare
Thanks! |
Cherry-picked for 3.5. |
Cherry-picked for 3.4.3. |
The shape array shown in the inspector increases and decreases by 2, ensuring that the last elements (when increasing) is a shape-transform pair.
Fixes: #53897