UNDO_XXX Clarification...



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 20/08/2006 at 03:35, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:   8.2+ 
    Platform:   Windows  ;   
    Language(s) :     C++  ;

    ---------
    It looks like the UNDO_ types changed at some point after R7.3, so I just wanted to get some clarification on what to use and where.  In the 7.3 ge_prepass.h file, I see these:

        
        
        
        
        #define UNDO_OBJECT_REC        1  
        #define UNDO_OBJECT          2  
        #define UNDO_OBJECT_DATA_REC      3  
        #define UNDO_OBJECT_DATA       4  
        #define UNDO_MATERIAL_DATA        5  
        #define UNDO_TAG_DATA         6  
        #define UNDO_KEY_DATA         7  
        #define UNDO_SEQUENCE_DATA        8  
        #define UNDO_TRACK_DATA        9  
        #define UNDO_OBJECT_NEW       10  
        #define UNDO_TAG_NEW        11  
        #define UNDO_KEY_NEW        12  
        #define UNDO_SEQUENCE_NEW        13  
        #define UNDO_TRACK_NEW       14  
        #define UNDO_MATERIAL_NEW      15  
        #define UNDO_OBJECT_DEL       17  
        #define UNDO_TAG_DEL        18  
        #define UNDO_KEY_DEL        19  
        #define UNDO_SEQUENCE_DEL        20  
        #define UNDO_TRACK_DEL       21  
        #define UNDO_MATERIAL_DEL        22  
        #define UNDO_OBJECT_ACTIVE       23  
        
    

    ...and in the R8.206 (and later) SDK ge_prepass.h file, I see these:

        
        
        
        
        #define UNDO_CHANGE       40  
        #define UNDO_CHANGE_NOCHILDS  41  
        #define UNDO_CHANGE_SMALL    42  
        #define UNDO_CHANGE_SELECTION  43  
                          
        #define UNDO_NEW        44  
        #define UNDO_DELETE       45  
                          
        #define UNDO_ACTIVATE      46  
        #define UNDO_DEACTIVATE     47  
        #define UNDO_TLACTIVATE     48  
        #define UNDO_TLDEACTIVATE    49  
        
    

    ...but I don't see the first group listed in the later files or the second group listed in the 7.3 file, so I assume the second (smaller) set of UNDO_ types replace the earlier ones?
    Specifically, I'm mostly 'changing' the BaseSelect returned from op->GetPolygonS() and op->GetPointS()... so I'd use:

        
        
        
        
         BaseSelect *pSel = op->GetPolygonS();
        
        
        
        
         m_baseDoc->StartUndo();  
         if( pSel->GetCount() == 0 )  
         {  
          m_baseDoc->AddUndo(UNDO_CHANGE_SELECTION, pSel);  
          m_pUserSelected->SelectAll(0, op->GetPolygonCount()-1); // select all  
         }  
         do_other_stuff();  
         m_baseDoc->EndUndo();  
        
    

    ...?  My question in this case is related to the fact that I'm not really changing a 'Selection Tag' that's attached to the object, I'm making changes directly to the object's current selection.  Would I still use UNDO_CHANGE_SELECTION there?
    Also, if I'm making changes to the UVW tag on an object, do I use UNDO_CHANGE?
    Thanks,
    Keith



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 20/08/2006 at 03:39, xxxxxxxx wrote:

    ...actually, I'm guessing that I should be using AddUndo(UNDO_CHANGE, op) for changes to the BaseSelect returned by op->GetPolygonS()... right?



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 20/08/2006 at 04:18, xxxxxxxx wrote:

    Hey Keith,

    Yes. UNDO_CHANGE_SELECTION is only for Editor selections. UNDO_CHANGE will store an undo for an object, including substructures - i.e.: tags. Nonetheless, best to verify that the undo covers the change of the tag's BaseSelect.


Log in to reply