Skip to content

Commit 03a0942

Browse files
committed
take instatiation scale option from editor settings for prefab preview
1 parent a9f6aa1 commit 03a0942

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

editor/src/scene_viewer.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
use crate::{
22
camera::PickingOptions, gui::make_dropdown_list_option,
3-
gui::make_dropdown_list_option_with_height, load_image,
4-
scene::commands::graph::ScaleNodeCommand, utils::enable_widget, AddModelCommand, AssetItem,
5-
AssetKind, BuildProfile, ChangeSelectionCommand, CommandGroup, DropdownListBuilder,
3+
gui::make_dropdown_list_option_with_height, load_image, utils::enable_widget, AddModelCommand,
4+
AssetItem, AssetKind, BuildProfile, ChangeSelectionCommand, CommandGroup, DropdownListBuilder,
65
EditorScene, GameEngine, GraphSelection, InteractionMode, InteractionModeKind, Message, Mode,
76
SceneCommand, Selection, SetMeshTextureCommand, Settings,
87
};
@@ -623,6 +622,10 @@ impl SceneViewer {
623622
scene.animations[animation].set_enabled(true);
624623
}
625624

625+
scene.graph[instance.root]
626+
.local_transform_mut()
627+
.set_scale(settings.model.instantiation_scale);
628+
626629
let nodes = scene
627630
.graph
628631
.traverse_handle_iter(instance.root)
@@ -936,11 +939,6 @@ impl SceneViewer {
936939
)),
937940
editor_scene.selection.clone(),
938941
)),
939-
SceneCommand::new(ScaleNodeCommand::new(
940-
preview.instance.root,
941-
Vector3::new(1.0, 1.0, 1.0),
942-
settings.model.instantiation_scale,
943-
)),
944942
];
945943

946944
self.sender

0 commit comments

Comments
 (0)