layer is still visible in uiPanelCanvasLayerVisibility

Home Forums General Programming layer is still visible in uiPanelCanvasLayerVisibility

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #68357
    audiosync
    Participant
      • Topics: 5
      • Replies: 13
      • Total: 18

      I am hiding a layer with this command:
      layer_Voiced[visible_nr]:setVisible(false)
      and the layer hides but in layer editor the eye symbol still shows active…

      And also if I try to check in another function if it is visible, it tells me that it still is although I don’t see the layer anymore:

      if layer_Voiced[n]:getPropertyInt("uiPanelCanvasLayerVisibility") == 1 then
      	visible_element = "Voiced"
      	visible_nr = n
      	console(“Layer “..tostring(n)..” is visible!”)
      end

      Is the uiPanelCanvasLayerVisibility property and setVisible not “linked”?

      #68396
      Possemo
      Participant
        • Topics: 14
        • Replies: 638
        • Total: 652
        • ★★★

        Hi audiosync. At the end I did not use Layers, but I experimented some time with it. Maybe this is of some use for you:

        switchLayer=function()
        
        	switch=panel:getModulatorByName("SwitchLayer"):getModulatorValue()
        
        	if switch==1 then
        	--Layer visible
        	canvas=panel:getCanvas()
        	canvas:getLayerByName("Libr"):setPropertyInt("uiPanelCanvasLayerVisibility", 1)
        
        	elseif switch==0 then
        	--Layer invisible
        	canvas=panel:getCanvas()
        	canvas:getLayerByName("Libr"):setPropertyInt("uiPanelCanvasLayerVisibility", 0)
        	end
        
        end
        #68403
        audiosync
        Participant
          • Topics: 5
          • Replies: 13
          • Total: 18

          Thanks for your reply.

          I wanted to analyse the layers that are visible when the plugin is loaded.
          I did a workaround by checking the value of the buttons which are switching my layers.
          That worked reliable in my case.

          So I just hide all layers at startup and by analysing the active button (value 1),
          I simply make the corresponding layers visible.

        Viewing 3 posts - 1 through 3 (of 3 total)
        • The forum ‘Programming’ is closed to new topics and replies.
        There is currently 0 users and 73 guests online
        No users are currently active
        Forum Statistics
        Threads: 2,495, Posts: 17,374, Members: 77,605
        Most users ever online was 12 on January 22, 2019 3:47 pm
        Ctrlr