module.setAttribute & SHOW_MEDIA
  • User avatar
    lotech
    ultim8 member
    Posts: 228
    Joined: Wed Feb 06, 2008 1:26 am
    Location: Auckland, NZ
    Contact:

    module.setAttribute & SHOW_MEDIA

    by lotech » Tue Apr 12, 2011 2:50 pm

    I'm trying to fix a quirk of one of my modules which show thumbs of all the active layers.
    Currently when you remove a layer the old thumb stays there until a new layer is made and clip loaded to overwrite it. Please correct me if I'm wrong or miles off but so far I've got this from the below code (from the part where thumbnails are generated).
    I think my problem is in the last line, as I want to to set that to blank/clear/black on a selected layer set to false/removed.

    # Clear Layer thumb on removal of layer
    if keyword == 'ctrl_layer_activated':
    if param == False:
    layname = "laymedia%d" % l
    module.setAttribute(layname,'SHOW_MEDIA', media+1)


    So it would mean that if ctrl_layer_activated = false on layer 3, clear the layer image on the media button called laymedia3 (or any layer 1->10.
    Just looking at it I think I'm looking at the wrong thing. Any pointers would be great.
  • User avatar
    lotech
    ultim8 member
    Posts: 228
    Joined: Wed Feb 06, 2008 1:26 am
    Location: Auckland, NZ
    Contact:

    by lotech » Thu Apr 14, 2011 7:29 am

    Cancel that, found the fix by going to that makes the thumbnail in PeriodicalEvent

    Code: Select all

    # Layer thumbs
    layname = 0

    for l in range (1, 11):
       media = modul8.getValue('ctrl_layer_media', l)
       if media >= 0 :
          layname = "laymedia%d" % l
          module.setAttribute(layname,'SHOW_MEDIA', media+1)
       else:
          layname = "laymedia%d" % l
          module.setAttribute(layname,'SHOW_MEDIA',0)

Who is online

Users browsing this forum: No registered users and 7 guests