Undo c4d.BASEDRAW_DATA_PICTURE ?



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

    On 02/07/2012 at 11:36, xxxxxxxx wrote:

    I'm trying to find out the way to be able to Undo
    a change of a filepath for the Background image.
    There are no problems anywhere else (for materials, objects using
    shaders etc). But when I use the same method as in a Material,
    no Undo is registered for the image path of the Background image, see below.

    Anyone have an idea?

    I've tried the different Undo Flags available with no success.
    OTOH, changing any parameter in the Viewport AM (Shift + V) manually
    doesn't register for an Undo either, so maybe this is not possible?

    Cheers
    Lennart

      
    doc.StartUndo()   
    bd      = doc.GetRenderBaseDraw()   
    abspath = bd[c4d.BASEDRAW_DATA_PICTURE]   
    if abspath == '':   
        print 'No Active BaseDraw Pict'   
        return   
           
    relpath = os.path.split(abspath)[1]   
    if relpath in globtex:   
        doc.AddUndo(c4d.UNDOTYPE_CHANGE_SMALL,bd)   
        bd[c4d.BASEDRAW_DATA_PICTURE] = relpath   
        print '[ BG Picture ]',relpath,' : Set to Relative Path'   
    else:   
        print '[ BG Picture ]',relpath,' : Is NOT in Global Texture Paths!'   
    doc.EndUndo()   
    

Log in to reply