<?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: How to use &amp;quot;cancelled&amp;quot; parameter of the render() function in python in 3ds Max Programming Forum</title>
    <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/how-to-use-quot-cancelled-quot-parameter-of-the-render-function/m-p/12848619#M892</link>
    <description>&lt;P&gt;See the&amp;nbsp;&lt;A title="By-Reference Parameter Handling in pymxs" href="https://help.autodesk.com/view/MAXDEV/2024/ENU/?guid=MAXDEV_Python_using_pymxs_pymxs_differences_pymxs_by_ref_parameters_html" target="_blank" rel="noopener"&gt;By-Reference Parameter Handling in pymxs&lt;/A&gt; topic.&lt;/P&gt;</description>
    <pubDate>Wed, 19 Jun 2024 07:25:27 GMT</pubDate>
    <dc:creator>Swordslayer</dc:creator>
    <dc:date>2024-06-19T07:25:27Z</dc:date>
    <item>
      <title>How to use "cancelled" parameter of the render() function in python</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/how-to-use-quot-cancelled-quot-parameter-of-the-render-function/m-p/12846853#M891</link>
      <description>&lt;P&gt;Hi, I'm trying to figure out how to use "cancelled" function of the render() function in python. I'm referencing these docs, trying to convert the function to python, but having issues getting it to work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.autodesk.com/view/MAXDEV/2023/ENU/?guid=GUID-9175301C-13E6-488B-ABA6-D27CD804B205#:~:text=%5B%20cancelled%3A,)%20do...." target="_blank" rel="noopener"&gt;https://help.autodesk.com/view/MAXDEV/2023/ENU/?guid=GUID-9175301C-13E6-488B-ABA6-D27CD804B205#:~:text=%5B%20cancelled%3A,)%20do....&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the simplified code that i'm having issue with:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from pymxs import runtime as rt
render_canceled = False
r = rt.render(
   camera=camera,
   frame=frame,
   outputwidth=resolution,
   pixelaspect=pixel_aspect,
   outputfile=outputfile,
   vfb=False,
   progressbar=False,
   cancelled = render_canceled, # Cant figure out how to use in python
   to=rt.Bitmap(1, 1)
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have everything working except for the "cancelled" parameter. If i comment that out, everything works fine, but i'd like to get that working. If I uncomment it, i get the error below when run.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;r = rt.render(
    ^^^^^^^^^^
RuntimeError: MAXScript exception raised.
-- Unable to convert: false to type: &amp;amp;-reference&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't know enough about python or Maxscript to know what it means, but my guess is that it has to do with a conflict between how python and maxscript work internally. It seems Maxscript needs a variable reference to write a True/False value to, but python is providing a value (False) instead of the variable reference. I don't know how in python (or if it's even possible) to provide the variable reference instead.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Does anyone know how to get this working? Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2024 14:00:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/how-to-use-quot-cancelled-quot-parameter-of-the-render-function/m-p/12846853#M891</guid>
      <dc:creator>LoganAC34</dc:creator>
      <dc:date>2024-06-18T14:00:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to use "cancelled" parameter of the render() function in python</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/how-to-use-quot-cancelled-quot-parameter-of-the-render-function/m-p/12848619#M892</link>
      <description>&lt;P&gt;See the&amp;nbsp;&lt;A title="By-Reference Parameter Handling in pymxs" href="https://help.autodesk.com/view/MAXDEV/2024/ENU/?guid=MAXDEV_Python_using_pymxs_pymxs_differences_pymxs_by_ref_parameters_html" target="_blank" rel="noopener"&gt;By-Reference Parameter Handling in pymxs&lt;/A&gt; topic.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2024 07:25:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/how-to-use-quot-cancelled-quot-parameter-of-the-render-function/m-p/12848619#M892</guid>
      <dc:creator>Swordslayer</dc:creator>
      <dc:date>2024-06-19T07:25:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to use "cancelled" parameter of the render() function in python</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/how-to-use-quot-cancelled-quot-parameter-of-the-render-function/m-p/12852383#M893</link>
      <description>&lt;P&gt;This is perfect!! I didn't find that in my research. I got it working! Thank you!!&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from pymxs import runtime as rt
r, canceled = rt.render(
camera=camera,
frame=frame,
outputwidth=outputwidth,
outputheight=outputheight,
pixelaspect=pixel_aspect,
outputfile=outputfile,
vfb=False,
progressbar=False,
cancelled=pymxs.byref(None),
to=rt.Bitmap(1, 1)
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Aug 2024 12:05:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/how-to-use-quot-cancelled-quot-parameter-of-the-render-function/m-p/12852383#M893</guid>
      <dc:creator>LoganAC34</dc:creator>
      <dc:date>2024-08-21T12:05:37Z</dc:date>
    </item>
  </channel>
</rss>

