-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Add more physics options to the Scene importer #77533
Conversation
3bef421
to
c0d1edc
Compare
c0d1edc
to
8c2f952
Compare
I should probably also add the option to set the collision layer and mask. These are important for the same reason exposing PMO is (not having to create hundreds of inherited scenes just to configure things properly) |
After some additional discussion, I'm going to expose some additional options on meshes too to streamline the import process.
|
I want to support this, but trying to get people to review. |
It's not quite ready for review yet since speaking to Calinou I plan on adding a bunch of extra options. That being said Calinou seems to be on board but I'm not sure if I'll need additional approval for this to be pulled in. |
Can you consider splitting the feature? It's easier to merge smaller changes. |
Sure thing, In that case please feel free to get this change reviewed as I think the physics options belong in a single PR. |
e6e491a
to
adb86dd
Compare
@Calinou any movement on this? |
We're in feature freeze now, and the milestone is 4.x, so I think this might have to wait for 4.2 |
Is there anything else needing done before looking at getting this merged? |
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.
Tested locally (rebased on top of master
851bc64), it works as expected.
Testing project: test_pr_77533.zip
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.
Makes sense. Makes the advanced importer a lot more useful with just a tiny bit of code.
@@ -1245,6 +1245,10 @@ Node *ResourceImporterScene::_post_fix_node(Node *p_node, Node *p_root, HashMap< | |||
col->set_owner(p_node->get_owner()); | |||
col->set_transform(get_collision_shapes_transform(node_settings)); | |||
col->set_position(p_applied_root_scale * col->get_position()); | |||
const Ref<PhysicsMaterial> &pmo = node_settings["physics/physics_material_override"]; | |||
if (!pmo.is_null()) { |
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.
This could be if (pmo.is_valid())
(same applies to the other cases), but no biggie.
godot/core/object/ref_counted.h
Lines 201 to 202 in 202e4b2
inline bool is_valid() const { return reference != nullptr; } | |
inline bool is_null() const { return reference == nullptr; } |
Thanks! |
Implements and closes godotengine/godot-proposals#6932