Created
July 16, 2021 13:12
-
-
Save andybak/75d667d57672bebeec871c6adb853983 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void TestImport(string filename, Vector3 position, Quaternion rotation) | |
{ | |
path = Path.Combine(App.MediaLibraryPath(), "Models", path); | |
var model = new Model(Model.Location.File(path)); | |
model.LoadModel(); | |
var tr = new TrTransform(); | |
tr.translation = position; | |
tr.rotation = rotation; | |
CreateWidgetCommand createCommand = new CreateWidgetCommand( | |
WidgetManager.m_Instance.ModelWidgetPrefab, tr); | |
SketchMemoryScript.m_Instance.PerformAndRecordCommand(createCommand); | |
ModelWidget modelWidget = createCommand.Widget as ModelWidget; | |
modelWidget.Model = model; | |
modelWidget.Show(true); | |
createCommand.SetWidgetCost(modelWidget.GetTiltMeterCost()); | |
WidgetManager.m_Instance.WidgetsDormant = false; | |
SketchControlsScript.m_Instance.EatGazeObjectInput(); | |
SelectionManager.m_Instance.RemoveFromSelection(false); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment