You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-06 12:20:30 +00:00
Changed import workflow
-Rearrange favorites in fs dock with drag and drop -Removed import -> sub-scene, moved to scenetree contextual menu -Removed import -> re-import , moved and integrated to FS dock -Added ability in FS dock to re-import more than one resource simultaneously -Added ability to drag from native filesystem explorer to Godot, only works on Windows though -Removed scene reimport merge options, never worked well. Eventually merging materials should be re-added -Added ability to set custom root node type when importing scenes -Re-Import is now automatic, can be configured back to manual in editor settings -Added resource previews in property list for many resource types
This commit is contained in:
@@ -71,6 +71,22 @@ void MeshEditor::edit(Ref<Mesh> p_mesh) {
|
||||
rot_x=0;
|
||||
rot_y=0;
|
||||
_update_rotation();
|
||||
|
||||
AABB aabb= mesh->get_aabb();
|
||||
Vector3 ofs = aabb.pos + aabb.size*0.5;
|
||||
aabb.pos-=ofs;
|
||||
float m = MAX(aabb.size.x,aabb.size.y)*0.5;
|
||||
if (m!=0) {
|
||||
m=1.0/m;
|
||||
m*=0.5;
|
||||
//print_line("scale: "+rtos(m));
|
||||
Transform xform;
|
||||
xform.basis.scale(Vector3(m,m,m));
|
||||
xform.origin=-xform.basis.xform(ofs); //-ofs*m;
|
||||
xform.origin.z-=aabb.size.z*2;
|
||||
mesh_instance->set_transform(xform);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user