Skip to content

Commit

Permalink
take instatiation scale option from editor settings for prefab preview
Browse files Browse the repository at this point in the history
  • Loading branch information
mrDIMAS committed Oct 9, 2022
1 parent a9f6aa1 commit 03a0942
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions editor/src/scene_viewer.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
use crate::{
camera::PickingOptions, gui::make_dropdown_list_option,
gui::make_dropdown_list_option_with_height, load_image,
scene::commands::graph::ScaleNodeCommand, utils::enable_widget, AddModelCommand, AssetItem,
AssetKind, BuildProfile, ChangeSelectionCommand, CommandGroup, DropdownListBuilder,
gui::make_dropdown_list_option_with_height, load_image, utils::enable_widget, AddModelCommand,
AssetItem, AssetKind, BuildProfile, ChangeSelectionCommand, CommandGroup, DropdownListBuilder,
EditorScene, GameEngine, GraphSelection, InteractionMode, InteractionModeKind, Message, Mode,
SceneCommand, Selection, SetMeshTextureCommand, Settings,
};
Expand Down Expand Up @@ -623,6 +622,10 @@ impl SceneViewer {
scene.animations[animation].set_enabled(true);
}

scene.graph[instance.root]
.local_transform_mut()
.set_scale(settings.model.instantiation_scale);

let nodes = scene
.graph
.traverse_handle_iter(instance.root)
Expand Down Expand Up @@ -936,11 +939,6 @@ impl SceneViewer {
)),
editor_scene.selection.clone(),
)),
SceneCommand::new(ScaleNodeCommand::new(
preview.instance.root,
Vector3::new(1.0, 1.0, 1.0),
settings.model.instantiation_scale,
)),
];

self.sender
Expand Down

0 comments on commit 03a0942

Please sign in to comment.