<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: VRED 2024, cancel sequenz rendering, python plugin in VRED Forum</title>
    <link>https://forums.autodesk.com/t5/vred-forum/vred-2024-cancel-sequenz-rendering-python-plugin/m-p/12859642#M378</link>
    <description>&lt;P&gt;You could check if the rendered image appeared at the specified directory. If the user canceled the process, there won't be an image.&lt;/P&gt;&lt;P&gt;A few issues with this approach:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;images might appear with names that differ from the given full path (e.g. when rendering with renderpasses?) -&amp;gt; reverse-engineer VRED's&amp;nbsp;filename composition and use the composed name when checking against existing files&lt;/LI&gt;&lt;LI&gt;if a given file already exists and has to be overwritten, the condition will always be met and the loop won't be cancelled -&amp;gt; Extra logic required (e.g. deleting previous file through code on purpose)&lt;/LI&gt;&lt;/UL&gt;</description>
    <pubDate>Tue, 25 Jun 2024 08:36:21 GMT</pubDate>
    <dc:creator>clemens_schlicker_audi</dc:creator>
    <dc:date>2024-06-25T08:36:21Z</dc:date>
    <item>
      <title>VRED 2024, cancel sequenz rendering, python plugin</title>
      <link>https://forums.autodesk.com/t5/vred-forum/vred-2024-cancel-sequenz-rendering-python-plugin/m-p/12846242#M377</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;i have a plugin where the user can arange several variantset and viewports to render everything at once.&lt;BR /&gt;I am using&amp;nbsp;vrAEBase class and put&amp;nbsp; the&amp;nbsp;vrMovieExport.createSnapshot in a for loop. (f.e. for each viewpoint)&lt;BR /&gt;When the rendering starts, for sure the user can cancel the actual image rendered, via the render dialog which is displayed. (with the progress bar) But i want to be able to break/stop the whole for loop.&lt;/P&gt;&lt;P&gt;I tried to cancel the loop with a Key pressed event, but it is not working, no way to interrupt.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have this class:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;class prova(vrAEBase.vrAEBase):
    
    def __init__(self):
        
        super(prova, self).__init__()
        
        self.addLoop()
        
        self.keyQ = vrKey.vrKey(vrController.Key_W)
        self.keyQ.connect(lambda: self.test())
        
        self.counter = 0
        
        
    def loop(self):
        
        for i in range(1000000):
            self.j = i
            
            if self.j == 400:
                print(self.j)
                vrMovieExport.createSnapshot("C:/Users/AXIGHXP/Projects/test/render_sky/test" + str(self.counter) + ".png",500,500,1,0)
                self.counter += 1

    
    def test(self):
        print("EXIT")
        self.subLoop()&lt;/LI-CODE&gt;&lt;P&gt;If i comment line 22, so not rendering, i can break the loop.&lt;/P&gt;&lt;P&gt;I guess because when starting the rendering, and the render dialog (with the progress bar) is display, the focus is lost for the key event, and there is no time in between the renderings to get the focus back.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When the user hit the cancel button on the render dialog, a message in the console is displayed.&lt;BR /&gt;"Rendering canceled".&lt;/P&gt;&lt;P&gt;Maybe i can grab this message/signal in my code to stop the loop? Would be ok, if the user just cancel one rendering, that all the progress is stoped then.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Andreas&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2024 08:58:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vred-forum/vred-2024-cancel-sequenz-rendering-python-plugin/m-p/12846242#M377</guid>
      <dc:creator>andreasK3K4G</dc:creator>
      <dc:date>2024-06-18T08:58:27Z</dc:date>
    </item>
    <item>
      <title>Re: VRED 2024, cancel sequenz rendering, python plugin</title>
      <link>https://forums.autodesk.com/t5/vred-forum/vred-2024-cancel-sequenz-rendering-python-plugin/m-p/12859642#M378</link>
      <description>&lt;P&gt;You could check if the rendered image appeared at the specified directory. If the user canceled the process, there won't be an image.&lt;/P&gt;&lt;P&gt;A few issues with this approach:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;images might appear with names that differ from the given full path (e.g. when rendering with renderpasses?) -&amp;gt; reverse-engineer VRED's&amp;nbsp;filename composition and use the composed name when checking against existing files&lt;/LI&gt;&lt;LI&gt;if a given file already exists and has to be overwritten, the condition will always be met and the loop won't be cancelled -&amp;gt; Extra logic required (e.g. deleting previous file through code on purpose)&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Tue, 25 Jun 2024 08:36:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vred-forum/vred-2024-cancel-sequenz-rendering-python-plugin/m-p/12859642#M378</guid>
      <dc:creator>clemens_schlicker_audi</dc:creator>
      <dc:date>2024-06-25T08:36:21Z</dc:date>
    </item>
    <item>
      <title>Re: VRED 2024, cancel sequenz rendering, python plugin</title>
      <link>https://forums.autodesk.com/t5/vred-forum/vred-2024-cancel-sequenz-rendering-python-plugin/m-p/12862218#M379</link>
      <description>&lt;P&gt;Hi Clemens,&lt;/P&gt;&lt;P&gt;thanks for the workaround, this works for me.&lt;/P&gt;&lt;P&gt;I can search for imagename + wildcard, so also with renderpasses i can check the file exists.&lt;/P&gt;&lt;P&gt;For the second concern, no problem, i will not allow the user to start the rendering if there are already the same&lt;/P&gt;&lt;P&gt;files with sequenz (names) in the choosen folder.&lt;BR /&gt;As a second approach, i can check the timestamps of the render start and the file created.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2024 11:53:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vred-forum/vred-2024-cancel-sequenz-rendering-python-plugin/m-p/12862218#M379</guid>
      <dc:creator>andreasK3K4G</dc:creator>
      <dc:date>2024-06-26T11:53:20Z</dc:date>
    </item>
  </channel>
</rss>

