Changeset 473

Show
Ignore:
Timestamp:
01/28/12 23:14:39 (4 months ago)
Author:
Carsten
Message:

Model Editor: Small fixes and improvements.

Location:
cafu/trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • cafu/trunk/CaWE/ModelEditor/ChildFrame.cpp

    r472 r473  
    173173    ModelMenu->Append(ID_MENU_MODEL_SKIN_ADD, "Add skin", "Adds a new skin to the model"); 
    174174    ModelMenu->Append(ID_MENU_MODEL_GUIFIXTURE_ADD, "Add GUI fixture", "Adds a new GUI fixture to the model"); 
    175     ModelMenu->Append(ID_MENU_MODEL_ANIM_IMPORT, "Import anim sequences", "Imports additional animation sequences into the model"); 
     175    ModelMenu->Append(ID_MENU_MODEL_ANIM_IMPORT, "Import animation sequences...", "Imports additional animation sequences into the model"); 
    176176    ModelMenu->Append(ID_MENU_MODEL_CHANNEL_ADD, "Add channel", "Adds a new animation channel to the model"); 
    177177    ModelMenu->Append(-1, "Run benchmark", "Move the camera along a predefined path and determine the time taken")->Enable(false); 
     
    389389{ 
    390390    wxFileDialog FileDialog(this,                           // The window parent. 
    391                             "Import animation sequence",    // Message. 
     391                            "Import animation sequences",   // Message. 
    392392                            "",                             // The default directory. 
    393393                            "*.md5anim",                    // The default file name. 
  • cafu/trunk/CaWE/ModelEditor/ElementsList.cpp

    r472 r473  
    193193    const ArrayT<unsigned int>& Sel=m_ModelDoc->GetSelection(m_TYPE); 
    194194 
     195    m_IsRecursiveSelfNotify=true; 
    195196    Freeze(); 
    196197    DeleteAllItems(); 
     
    278279 
    279280    Thaw(); 
     281    m_IsRecursiveSelfNotify=false; 
    280282} 
    281283 
     
    305307    Menu.Append(ID_MENU_RENAME, "Rename\tF2"); 
    306308    if (m_TYPE==GFIX || m_TYPE==SKIN || m_TYPE==CHAN) Menu.Append(ID_MENU_ADD_NEW, "Add/create new"); 
    307     if (m_TYPE==ANIM) Menu.Append(ID_MENU_ADD_NEW, "Import more..."); 
     309    if (m_TYPE==ANIM) Menu.Append(ID_MENU_ADD_NEW, "Import..."); 
    308310 
    309311    if (m_TYPE==MESH) 
  • cafu/trunk/Libs/Models/Loader_md5.cpp

    r472 r473  
    265265        CafuModelT::AnimT Anim; 
    266266 
    267         Anim.Name="Anim"; 
     267        Anim.Name=cf::String::StripExt(m_FileName); 
    268268        Anim.FPS =24.0f; 
    269269        Anim.Next=-1; 
     270 
     271        const size_t PathLength=cf::String::GetPath(Anim.Name).length() + 1; 
     272 
     273        if (PathLength < Anim.Name.length()) 
     274            Anim.Name=std::string(Anim.Name, PathLength); 
    270275 
    271276        bool GotHierarchy=false; 
     
    297302                const unsigned long numJoints=TP.GetNextTokenAsInt(); 
    298303 
    299                 if (numJoints!=Joints.Size()) { printf("%lu joints in md5anim file, %lu joints in the model.\n", numJoints, Joints.Size()); throw ModelLoaderT::LoadErrorT("The number of joints in the md5anim file does not match number of bones in the model."); } 
     304                if (numJoints!=Joints.Size()) { printf("%lu joints in md5anim file, %lu joints in the model.\n", numJoints, Joints.Size()); throw ModelLoaderT::LoadErrorT("The number of joints in the md5anim file does not match number of joints in the model."); } 
    300305                if (Anim.AnimJoints.Size()>0) { printf("Anim.AnimJoints.Size()==%lu\n", Anim.AnimJoints.Size()); throw ModelLoaderT::LoadErrorT("Anim.AnimJoints.Size() > 0"); } 
    301306 
     
    397402 
    398403        // Make sure that the imported animation sequence is valid. 
    399         if (Anim.AnimJoints.Size()!=Joints.Size()) throw ModelLoaderT::LoadErrorT("The number of joints in the md5anim file does not match number of bones in the model."); 
     404        if (Anim.AnimJoints.Size()!=Joints.Size()) throw ModelLoaderT::LoadErrorT("The number of joints in the md5anim file does not match number of joints in the model."); 
    400405        if (!GotHierarchy) throw ModelLoaderT::LoadErrorT("There seems to be no joints hierarchy defined in this file."); 
    401406        if (!GotBounds) throw ModelLoaderT::LoadErrorT("There seem to be no bounds in this file.");