<?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: Looking to create a script that would play an audio file on starting rendering. in 3ds Max Programming Forum</title>
    <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/looking-to-create-a-script-that-would-play-an-audio-file-on/m-p/11994108#M2530</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/13940336"&gt;@Matthew_Polewiak&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;I would like to create a script that plays an audo file (mp3 format though I can convert it if needed) whenever I start the rendering process (I usually start it with the shift +Q/Render production option).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Is there some special point to this, or is it just to make the process less boring?&lt;/P&gt;</description>
    <pubDate>Sun, 28 May 2023 05:10:05 GMT</pubDate>
    <dc:creator>denisT.MaxDoctor</dc:creator>
    <dc:date>2023-05-28T05:10:05Z</dc:date>
    <item>
      <title>Looking to create a script that would play an audio file on starting rendering.</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/looking-to-create-a-script-that-would-play-an-audio-file-on/m-p/11990945#M2525</link>
      <description>&lt;P&gt;I would like to create a script that plays an audo file (mp3 format though I can convert it if needed) whenever I start the rendering process (I usually start it with the shift +Q/Render production option).&lt;/P&gt;&lt;P&gt;I tried creating the script through chat gpt but it seems the script that I was given (written below) doesn't work in 2024 version of 3ds max.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;global renderEvents = undefined&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;fn playSoundOnRenderStart =&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;(&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;local soundPath = @"C:\Path\to\your\sound\clip.mp3" -- Replace with the actual path to your sound clip&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;playSound soundPath&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;fn onRenderStart evs = &lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;(&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;if evs.startRendering do&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;(&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;playSoundOnRenderStart()&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;fn setupRenderEvents =&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;(&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;if renderEvents == undefined do&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;(&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;renderEvents = dotNetObject "Autodesk.Max.RenderEvents"&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;dotNet.addEventHandler renderEvents "RenderStart" onRenderStart&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;setupRenderEvents()&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 May 2023 09:33:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/looking-to-create-a-script-that-would-play-an-audio-file-on/m-p/11990945#M2525</guid>
      <dc:creator>Matthew_Polewiak</dc:creator>
      <dc:date>2023-05-26T09:33:50Z</dc:date>
    </item>
    <item>
      <title>Re: Looking to create a script that would play an audio file on starting rendering.</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/looking-to-create-a-script-that-would-play-an-audio-file-on/m-p/11991516#M2526</link>
      <description>&lt;P&gt;Try this&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;(
player = dotnetobject "System.Media.SoundPlayer"
path = @"c:\Windows\Media\chimes.wav"
player.SoundLocation = path
player.Load()
function renderPlay = (
	format "playing\n"
	player.Play()
)

rollout r_play "play" (
	button bt_play "play" width:120 --align:#left
 	on r_play open do (
 		callbacks.removescripts id:#rplaycb
 		callbacks.addscript #preRender renderPlay id:#rplaycb
 	)
	on r_play close do (
		callbacks.removescripts id:#rplaycb
	)
	on bt_play pressed  do (
		renderPlay()
	)
)
createDialog r_play 200 60
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 May 2023 14:16:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/looking-to-create-a-script-that-would-play-an-audio-file-on/m-p/11991516#M2526</guid>
      <dc:creator>dmitriy.shpilevoy</dc:creator>
      <dc:date>2023-05-26T14:16:42Z</dc:date>
    </item>
    <item>
      <title>Re: Looking to create a script that would play an audio file on starting rendering.</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/looking-to-create-a-script-that-would-play-an-audio-file-on/m-p/11991563#M2527</link>
      <description>&lt;P&gt;It works thanks a lot,&lt;/P&gt;&lt;P&gt;Do you know how can I make 3Ds Max run the script automatically on launch?&lt;/P&gt;</description>
      <pubDate>Fri, 26 May 2023 14:29:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/looking-to-create-a-script-that-would-play-an-audio-file-on/m-p/11991563#M2527</guid>
      <dc:creator>Matthew_Polewiak</dc:creator>
      <dc:date>2023-05-26T14:29:35Z</dc:date>
    </item>
    <item>
      <title>Re: Looking to create a script that would play an audio file on starting rendering.</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/looking-to-create-a-script-that-would-play-an-audio-file-on/m-p/11991628#M2528</link>
      <description>&lt;P&gt;Run&lt;/P&gt;&lt;LI-CODE lang="general"&gt;GetDir #startupScripts&lt;/LI-CODE&gt;&lt;P&gt;in listener and put script there. Note that as it is script will open rollout each time and stop working if you close it.&lt;/P&gt;&lt;P&gt;You can leave the sound stuff and remove rollout from it, but then it will keep callbacks registered.&lt;/P&gt;</description>
      <pubDate>Fri, 26 May 2023 15:01:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/looking-to-create-a-script-that-would-play-an-audio-file-on/m-p/11991628#M2528</guid>
      <dc:creator>dmitriy.shpilevoy</dc:creator>
      <dc:date>2023-05-26T15:01:19Z</dc:date>
    </item>
    <item>
      <title>Re: Looking to create a script that would play an audio file on starting rendering.</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/looking-to-create-a-script-that-would-play-an-audio-file-on/m-p/11992217#M2529</link>
      <description>this kind of script deserves its own macro button to toggle on/off state</description>
      <pubDate>Fri, 26 May 2023 19:24:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/looking-to-create-a-script-that-would-play-an-audio-file-on/m-p/11992217#M2529</guid>
      <dc:creator>Serejah</dc:creator>
      <dc:date>2023-05-26T19:24:22Z</dc:date>
    </item>
    <item>
      <title>Re: Looking to create a script that would play an audio file on starting rendering.</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/looking-to-create-a-script-that-would-play-an-audio-file-on/m-p/11994108#M2530</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/13940336"&gt;@Matthew_Polewiak&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;I would like to create a script that plays an audo file (mp3 format though I can convert it if needed) whenever I start the rendering process (I usually start it with the shift +Q/Render production option).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Is there some special point to this, or is it just to make the process less boring?&lt;/P&gt;</description>
      <pubDate>Sun, 28 May 2023 05:10:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/looking-to-create-a-script-that-would-play-an-audio-file-on/m-p/11994108#M2530</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2023-05-28T05:10:05Z</dc:date>
    </item>
    <item>
      <title>Re: Looking to create a script that would play an audio file on starting rendering.</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/looking-to-create-a-script-that-would-play-an-audio-file-on/m-p/11994177#M2531</link>
      <description>The latter option i suppose, it's kind of an inside joke between me and my brother.</description>
      <pubDate>Sun, 28 May 2023 06:56:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/looking-to-create-a-script-that-would-play-an-audio-file-on/m-p/11994177#M2531</guid>
      <dc:creator>Matthew_Polewiak</dc:creator>
      <dc:date>2023-05-28T06:56:08Z</dc:date>
    </item>
    <item>
      <title>Re: Looking to create a script that would play an audio file on starting rendering.</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/looking-to-create-a-script-that-would-play-an-audio-file-on/m-p/11994576#M2532</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/13940336"&gt;@Matthew_Polewiak&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;The latter option i suppose, it's kind of an inside joke between me and my brother.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;then you better go to Reddit&lt;/P&gt;</description>
      <pubDate>Sun, 28 May 2023 15:13:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/looking-to-create-a-script-that-would-play-an-audio-file-on/m-p/11994576#M2532</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2023-05-28T15:13:53Z</dc:date>
    </item>
  </channel>
</rss>

