feat: modules moved and engine moved to submodule

This commit is contained in:
Jan van der Weide 2025-04-12 18:40:44 +02:00
parent dfb5e645cd
commit c33d2130cc
5136 changed files with 225275 additions and 64485 deletions

View file

@ -186,8 +186,8 @@ Vector<Ref<Texture2D>> EditorInterface::make_mesh_previews(const Vector<Ref<Mesh
Vector3 ofs = aabb.get_center();
aabb.position -= ofs;
Transform3D xform;
xform.basis = Basis().rotated(Vector3(0, 1, 0), -Math_PI / 6);
xform.basis = Basis().rotated(Vector3(1, 0, 0), Math_PI / 6) * xform.basis;
xform.basis = Basis().rotated(Vector3(0, 1, 0), -Math::PI / 6);
xform.basis = Basis().rotated(Vector3(1, 0, 0), Math::PI / 6) * xform.basis;
AABB rot_aabb = xform.xform(aabb);
float m = MAX(rot_aabb.size.x, rot_aabb.size.y) * 0.5;
if (m == 0) {
@ -282,8 +282,8 @@ void EditorInterface::make_scene_preview(const String &p_path, Node *p_scene, in
Vector3 center = scene_aabb.get_center();
float camera_size = scene_aabb.get_longest_axis_size();
const float cam_rot_x = -Math_PI / 4;
const float cam_rot_y = -Math_PI / 4;
const float cam_rot_x = -Math::PI / 4;
const float cam_rot_y = -Math::PI / 4;
camera->set_orthogonal(camera_size * 2.0, 0.0001, camera_size * 2.0);
@ -295,8 +295,8 @@ void EditorInterface::make_scene_preview(const String &p_path, Node *p_scene, in
camera->set_transform(xf);
Transform3D xform;
xform.basis = Basis().rotated(Vector3(0, 1, 0), -Math_PI / 6);
xform.basis = Basis().rotated(Vector3(1, 0, 0), Math_PI / 6) * xform.basis;
xform.basis = Basis().rotated(Vector3(0, 1, 0), -Math::PI / 6);
xform.basis = Basis().rotated(Vector3(1, 0, 0), Math::PI / 6) * xform.basis;
light->set_transform(xform * Transform3D().looking_at(Vector3(-2, -1, -1), Vector3(0, 1, 0)));
light2->set_transform(xform * Transform3D().looking_at(Vector3(+1, -1, -2), Vector3(0, 1, 0)));
@ -647,8 +647,7 @@ void EditorInterface::open_scene_from_path(const String &scene_path, bool p_set_
if (EditorNode::get_singleton()->is_changing_scene()) {
return;
}
EditorNode::get_singleton()->open_request(scene_path, p_set_inherited);
EditorNode::get_singleton()->load_scene(scene_path, false, p_set_inherited);
}
void EditorInterface::reload_scene_from_path(const String &scene_path) {
@ -667,12 +666,24 @@ PackedStringArray EditorInterface::get_open_scenes() const {
PackedStringArray ret;
Vector<EditorData::EditedScene> scenes = EditorNode::get_editor_data().get_edited_scenes();
int scns_amount = scenes.size();
for (int idx_scn = 0; idx_scn < scns_amount; idx_scn++) {
if (scenes[idx_scn].root == nullptr) {
for (EditorData::EditedScene &edited_scene : scenes) {
if (edited_scene.root == nullptr) {
continue;
}
ret.push_back(scenes[idx_scn].root->get_scene_file_path());
ret.push_back(edited_scene.root->get_scene_file_path());
}
return ret;
}
TypedArray<Node> EditorInterface::get_open_scene_roots() const {
TypedArray<Node> ret;
Vector<EditorData::EditedScene> scenes = EditorNode::get_editor_data().get_edited_scenes();
for (EditorData::EditedScene &edited_scene : scenes) {
if (edited_scene.root == nullptr) {
continue;
}
ret.push_back(edited_scene.root);
}
return ret;
}
@ -736,12 +747,11 @@ bool EditorInterface::is_movie_maker_enabled() const {
return EditorRunBar::get_singleton()->is_movie_maker_enabled();
}
#ifdef TOOLS_ENABLED
void EditorInterface::get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const {
const String pf = p_function;
if (p_idx == 0) {
if (pf == "set_main_screen_editor") {
for (String E : { "\"2D\"", "\"3D\"", "\"Script\"", "\"AssetLib\"" }) {
for (String E : { "\"2D\"", "\"3D\"", "\"Script\"", "\"Game\"", "\"AssetLib\"" }) {
r_options->push_back(E);
}
} else if (pf == "get_editor_viewport_3d") {
@ -752,7 +762,6 @@ void EditorInterface::get_argument_options(const StringName &p_function, int p_i
}
Object::get_argument_options(p_function, p_idx, r_options);
}
#endif
// Base.
@ -830,6 +839,7 @@ void EditorInterface::_bind_methods() {
ClassDB::bind_method(D_METHOD("reload_scene_from_path", "scene_filepath"), &EditorInterface::reload_scene_from_path);
ClassDB::bind_method(D_METHOD("get_open_scenes"), &EditorInterface::get_open_scenes);
ClassDB::bind_method(D_METHOD("get_open_scene_roots"), &EditorInterface::get_open_scene_roots);
ClassDB::bind_method(D_METHOD("get_edited_scene_root"), &EditorInterface::get_edited_scene_root);
ClassDB::bind_method(D_METHOD("save_scene"), &EditorInterface::save_scene);