Dynamic Model Viewer

I am looking for a model viewer I can quickly plug models (and animations) into, I have been looking into this, but cannot find a download for it anywhere:

If anyone knows of something this easy to use, or where I can get this one from, please let me know.

Thanks

This functionality is already built in to Unity
Get into the mecanim workflow and you’ll see
Suggest:

Sorry if I seemed a little hard to understand, I know how to use Macanim.
I don’t know how to script a model viewer, I know how to trigger animations, just not how to get the model switching functionality.

If you are really wanting a runtime solution, just Destroy the current model, and instance the next

Okay i started on one for you but stopped at the animations since you said you already know how to do that.
this is really rough but at least it’s something, You can add GUI instead of using arrow keys to change models.
BTW ATTACH THIS TO AN EMPTY GAMEOBJECT
Also I could make a camera system for you if you wanted me to…

using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.Linq;

public class ModelViewer : MonoBehaviour
{
    [System.Serializable]
    public class ModelViewerInformation{
        public GameObject Model;
        public List<AnimationClip> Animations;
    }

    public ModelViewerInformation[] Models;

    public int ModelIndex;
    void UpdateModelViewer(){
//        Transform[] childs = GetComponentsInChildren<Transform>();
        for(int i=0; i< transform.childCount; i++)
        {
            Destroy (transform.GetChild(i).gameObject);
        }
  

  
        GameObject SpawnedModel = Instantiate(Models[ModelIndex].Model, transform.position, transform.rotation) as GameObject;
        SpawnedModel.transform.parent = transform;
  
    }

    void Update(){
        if (Input.GetKeyDown(KeyCode.LeftArrow)){
      
            if (ModelIndex > 0) {
                ModelIndex -= 1;
            } else {
                ModelIndex = Models.Length;
            }
            UpdateModelViewer();
        }
        if (Input.GetKeyDown(KeyCode.RightArrow)){
      
            if (ModelIndex < Models.Length) {
                ModelIndex += 1;
            } else {
                ModelIndex = 0;
            }
            UpdateModelViewer();
        }
  
  
    }
}

FYI your loop 19-21 wont work when there’s more than 1 child of the object (perhaps unlikely in this scenario) - you modify the number of children each iteration, and about half would be ignored

I see but, there should only be one child within the root of the main game object at all time & that’s the model, within the model is everything else, You delete the model you delete everything.

A camera system could be very useful, how would I add an on-screen GUI to this & could I use the 4.6 GUI?
Sorry, i’m a 3D artist and not used to scripting, I can trigger things with colliders, that’s about it.

this is where i become useless i haven’t been using unity since the new update & i should but i haven’t had time, i come on here to help people if & when i can but if you’re good with the new gui replace getkeydown with a guibutton or something if they’re even in the new gui. i can start on a camera system for you if you want me to but what controls do you want? Mouse orbit? controlled with numpad?

Very similar controls to the Unity editor:
left click hold to orbit
wheel to zoom
right mouse button to pan (up and down)
s
Not sure how easy this is, would it be possible to have the camera move closer or further away depending on the size of the object, or even to resize the object in question so it fits in say a 3x3x3 area upon loading? the latter is probably better

Hi, just thought i’d see how this is going, I tried to create my own camera controller, didn’t go well.