public void AddModel(IModelSceneFormat resource) { foreach (var model in resource.ToGeneric().Models) { Models.Add(new ModelEntry() { Renderer = resource.Renderer, GenericModel = model, }); } }
static ObjectTreeNode LoadModelFormat(IModelSceneFormat modelFormat) { IFileFormat fileFormat = (IFileFormat)modelFormat; var scene = modelFormat.ToGeneric(); ObjectTreeNode root = new ObjectTreeNode(fileFormat.FileInfo.FileName) { Tag = modelFormat }; return(root); }
public void LoadModelFormat(IModelSceneFormat resourceFormat) { var resource = resourceFormat.ToGeneric(); if (ResourceFormats.Contains(resourceFormat)) { activeModelCB.SelectedItem = resource.Name; return; } ResourceFormats.Add(resourceFormat); var container = new ModelContainer(); container.AddModel(resourceFormat); Runtime.ModelContainers.Add(container); ModelContainers.Add(container); var drawableContainer = new DrawContainer(); drawableContainer.Name = resource.Name; var drawable = new GenericModelRender(resourceFormat.Renderer); drawableContainer.Drawables.Add(drawable); foreach (var model in resource.Models) { var skeleton = new GenericSkeletonRenderer(model.Skeleton); drawableContainer.Drawables.Add(skeleton); } Containers.Add(drawableContainer); if (Viewport3D.Scene != null) { ReloadScene(); } activeModelCB.Items.Add(resource.Name); activeModelCB.SelectedItem = resource.Name; }
public void LoadFileFormat(IModelSceneFormat fileFormat) { Viewport.LoadModelFormat(fileFormat); }