<?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: nested rollout questions (2) in 3ds Max Programming Forum</title>
    <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/nested-rollout-questions-2/m-p/3967413#M27979</link>
    <description>Just as a follow-up (that top-level local scope works a charm!) I'm finding that, at least to my taste, placing the rollouts in a floater works better visually than the subrollouts.  Here's a mini-routine:&lt;BR /&gt;&lt;PRE&gt;&lt;BR /&gt;(&lt;BR /&gt;local m&lt;BR /&gt;rollout setm "Set Value"&lt;BR /&gt;(&lt;BR /&gt;    spinner spn_set "Set m " range:&lt;BR /&gt;    spinner spn_show "m = "&lt;BR /&gt;    on spn_set changed value do&lt;BR /&gt;    (m = spn_set.value)&lt;BR /&gt;    on spn_show changed value do&lt;BR /&gt;    (&lt;BR /&gt;        spn_show.value = m&lt;BR /&gt;        spn_set.value = spn_show.value&lt;BR /&gt;    )    &lt;BR /&gt;    &lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;rollout setm2 "Set Value by Slider"&lt;BR /&gt;(&lt;BR /&gt;    slider sld_set "Set m" range:&lt;BR /&gt;    on sld_set changed value do&lt;BR /&gt;    (m = sld_set.value)&lt;BR /&gt;)&lt;BR /&gt;nf = newRolloutFloater "m Value" 200 170&lt;BR /&gt;addRollout setm nf&lt;BR /&gt;addRollout setm2 nf&lt;BR /&gt;)&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;With the floater, when one rollout is rolled up the other rollouts will "tighten up" the spacing, whereas a subRollout will claim a fixed amount of space whether it's rolled up or not.</description>
    <pubDate>Mon, 21 Jan 2008 23:08:01 GMT</pubDate>
    <dc:creator>bhnh</dc:creator>
    <dc:date>2008-01-21T23:08:01Z</dc:date>
    <item>
      <title>nested rollout questions (2)</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/nested-rollout-questions-2/m-p/3967406#M27972</link>
      <description>I've run into a couple questions concerning rollouts...&lt;BR /&gt;&lt;BR /&gt;Question 1. Here's a short test script for a utility:&lt;BR /&gt;&lt;PRE&gt;&lt;BR /&gt;utility test3 "Test3"&lt;BR /&gt;(&lt;BR /&gt;local v&lt;BR /&gt;rollout r1 "panel A"&lt;BR /&gt;(    &lt;BR /&gt;    spinner spn_r1 "spinner 1 "&lt;BR /&gt;    on spn_r1 changed value do&lt;BR /&gt;    (v = spn_r1.value)&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;rollout r2 "panel B"&lt;BR /&gt;(&lt;BR /&gt;    spinner spn_r2 "spinner 2 "&lt;BR /&gt;    on spn_r2 changed value do&lt;BR /&gt;    (spn_r2.value = v)&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;    on test3 open do&lt;BR /&gt;    (&lt;BR /&gt;        addRollout r1&lt;BR /&gt;        addRollout r2&lt;BR /&gt;    )&lt;BR /&gt;    &lt;BR /&gt;    on test3 close do&lt;BR /&gt;    (&lt;BR /&gt;        removeRollout r1&lt;BR /&gt;        removeRollout r2&lt;BR /&gt;    )&lt;BR /&gt;)&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;My question is on the attached .gif... basically, how do I get the rollouts "grouped" within the utility?&lt;BR /&gt;&lt;BR /&gt;Question 2: Can rollouts be nested within another rollout? I guess a better way of phrasing that is, can a variable be assigned locally on the RolloutFloater level such that it will be read by added rollouts? Here's what I'm getting at...&lt;BR /&gt;&lt;PRE&gt;&lt;BR /&gt;rollout one "One"&lt;BR /&gt;(&lt;BR /&gt;    button btn_1 "First Button"&lt;BR /&gt;&lt;BR /&gt;)&lt;BR /&gt;rollout two "Two"&lt;BR /&gt;(&lt;BR /&gt;    button btn_2 "Second Button"&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;rf = newRolloutFloater "Floater" 200 300&lt;BR /&gt;(button btn_f "Floater Button")&lt;BR /&gt;addRollout one rf&lt;BR /&gt;addRollout two rf&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;In the above I tried to add a "Floater" button on the floater level, to be followed the two rollouts. When I run it, there's no button on the floater level.&lt;BR /&gt;&lt;BR /&gt;Many thanks in advance.&lt;P&gt;&lt;IMG class="migr-att-link" src="http://area.autodesk.com/userdata/forum/1/1818_ziTuQ1kVAcEQx8MoA9qC.gif" /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jan 2008 04:06:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/nested-rollout-questions-2/m-p/3967406#M27972</guid>
      <dc:creator>bhnh</dc:creator>
      <dc:date>2008-01-21T04:06:32Z</dc:date>
    </item>
    <item>
      <title>Re: nested rollout questions (2)</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/nested-rollout-questions-2/m-p/3967407#M27973</link>
      <description>I haven't tried it yet but look at &lt;B&gt;subRollout&lt;/B&gt; in the Reference. It might be what you're looking for.</description>
      <pubDate>Mon, 21 Jan 2008 04:48:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/nested-rollout-questions-2/m-p/3967407#M27973</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-21T04:48:40Z</dc:date>
    </item>
    <item>
      <title>Re: nested rollout questions (2)</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/nested-rollout-questions-2/m-p/3967408#M27974</link>
      <description>Bless ya, Pat.  That's just what I was looking for in regards to the rollouts within rollouts.  Many thanks!    &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Still a bit in mystified about the utility.</description>
      <pubDate>Mon, 21 Jan 2008 05:12:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/nested-rollout-questions-2/m-p/3967408#M27974</guid>
      <dc:creator>bhnh</dc:creator>
      <dc:date>2008-01-21T05:12:47Z</dc:date>
    </item>
    <item>
      <title>Re: nested rollout questions (2)</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/nested-rollout-questions-2/m-p/3967409#M27975</link>
      <description>From my answer on CGTalk:&lt;BR /&gt;&lt;BR /&gt;"The scripted Utility was introduced back in Max 2 and became obsolete around Max 3. It was the way it worked, with the additional rollouts placed behind the main body of the Utility that had the Close button added automatically. I know the Help still shows you how to use it and it is rather simple to script so it is a good starter material, but don't expect too much control over formatting from it, as it was part of the "first baby steps" of MAXScript and is barely used nowadays."</description>
      <pubDate>Mon, 21 Jan 2008 07:11:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/nested-rollout-questions-2/m-p/3967409#M27975</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-21T07:11:56Z</dc:date>
    </item>
    <item>
      <title>Re: nested rollout questions (2)</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/nested-rollout-questions-2/m-p/3967410#M27976</link>
      <description>Many thanks, Bobo... particularly because you answered this as well over at CGT.  I'm repeating my CGT reply here for anyone who's following this in the Area rather than CGT.&lt;BR /&gt;&lt;BR /&gt;@Caprier, et.al.&lt;BR /&gt;I've been playing with the subRollouts since the first post in this thread. I'm stymied by whether a variable local to the parent rollout can be referenced in the subrollouts. Here's an example I pulled whole-hog from the MAXScript Reference and threw in a local and global variable:  &lt;BR /&gt;&lt;PRE&gt;&lt;BR /&gt;rollout test "test" height:200&lt;BR /&gt;( &lt;BR /&gt;-- here I added a local and a global variable&lt;BR /&gt;local L = 25.0&lt;BR /&gt;global G = 37.0&lt;BR /&gt;--&lt;BR /&gt;subrollout test1 "test1"&lt;BR /&gt;subrollout test2 "test2"&lt;BR /&gt;)&lt;BR /&gt;rollout test1a "test1a"&lt;BR /&gt;( spinner test1as "test1as"&lt;BR /&gt;-- the following throws an "undefined to type:Float" error&lt;BR /&gt;on test1as changed value do&lt;BR /&gt;(test1as.value = L)&lt;BR /&gt;--&lt;BR /&gt;)&lt;BR /&gt;rollout test1b "test1b"&lt;BR /&gt;( spinner test1bs "test1bs"&lt;BR /&gt;-- this works; the spinner displays the global value&lt;BR /&gt;on test1bs changed value do&lt;BR /&gt;(test1bs.value = G)&lt;BR /&gt;)&lt;BR /&gt;createdialog test&lt;BR /&gt;AddSubRollout test.test1 test1a&lt;BR /&gt;AddSubRollout test.test1 test1b&lt;BR /&gt;test.test1.height += 100&lt;BR /&gt;test.test2.pos += &lt;BR /&gt;rollout test2a "test2a"&lt;BR /&gt;( spinner test2as "test2as"&lt;BR /&gt;)&lt;BR /&gt;AddSubRollout test.test2 test2a&lt;BR /&gt;test.test2.height += 50&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;The question is, is it possible to access a variable from the parent rollout? I'm thinking of, for instance, of Array elements. When I tried this in the (antiquated) Utilities format, both parent-local and global were identified. Many thanks!</description>
      <pubDate>Mon, 21 Jan 2008 08:37:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/nested-rollout-questions-2/m-p/3967410#M27976</guid>
      <dc:creator>bhnh</dc:creator>
      <dc:date>2008-01-21T08:37:26Z</dc:date>
    </item>
    <item>
      <title>Re: nested rollout questions (2)</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/nested-rollout-questions-2/m-p/3967411#M27977</link>
      <description>It is indeed possible.&lt;BR /&gt;Remember that Scopes are like Onions (if I may quote Shrek+Donkey) - they have many layers, and any local variable declared in the higher scope is visible in the lower scopes. In your example though, you have declared a multitude of rollouts (where each rollout defines its own local scope) WITHIN the GLOBAL scope of MAXScript, so the L variable exists only locally in rollout test but not in the other rollouts.&lt;BR /&gt;&lt;BR /&gt;The correct way to do this would be &lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;(--open top-level local scope&lt;BR /&gt;&lt;BR /&gt;local L = 25.0 --declare a local variable higher than all rollouts&lt;BR /&gt;&lt;BR /&gt;rollout test "test" &lt;BR /&gt;( &lt;BR /&gt;subrollout test1 "test1" height:50&lt;BR /&gt;subrollout test2 "test2" height:50&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;rollout test1a "test1a"&lt;BR /&gt;( &lt;BR /&gt;spinner test1as "test1as"&lt;BR /&gt;on test1as changed value do (test1as.value = L) --L is visible because declared in a higher scope&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;createdialog test&lt;BR /&gt;AddSubRollout test.test1 test1a&lt;BR /&gt;&lt;BR /&gt;)--close top-level local scope&lt;/PRE&gt;</description>
      <pubDate>Mon, 21 Jan 2008 12:42:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/nested-rollout-questions-2/m-p/3967411#M27977</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-21T12:42:10Z</dc:date>
    </item>
    <item>
      <title>Re: nested rollout questions (2)</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/nested-rollout-questions-2/m-p/3967412#M27978</link>
      <description>Thank you immensely, Bobo.  I realize this was something of a "ground-level" question.</description>
      <pubDate>Mon, 21 Jan 2008 19:26:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/nested-rollout-questions-2/m-p/3967412#M27978</guid>
      <dc:creator>bhnh</dc:creator>
      <dc:date>2008-01-21T19:26:17Z</dc:date>
    </item>
    <item>
      <title>Re: nested rollout questions (2)</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/nested-rollout-questions-2/m-p/3967413#M27979</link>
      <description>Just as a follow-up (that top-level local scope works a charm!) I'm finding that, at least to my taste, placing the rollouts in a floater works better visually than the subrollouts.  Here's a mini-routine:&lt;BR /&gt;&lt;PRE&gt;&lt;BR /&gt;(&lt;BR /&gt;local m&lt;BR /&gt;rollout setm "Set Value"&lt;BR /&gt;(&lt;BR /&gt;    spinner spn_set "Set m " range:&lt;BR /&gt;    spinner spn_show "m = "&lt;BR /&gt;    on spn_set changed value do&lt;BR /&gt;    (m = spn_set.value)&lt;BR /&gt;    on spn_show changed value do&lt;BR /&gt;    (&lt;BR /&gt;        spn_show.value = m&lt;BR /&gt;        spn_set.value = spn_show.value&lt;BR /&gt;    )    &lt;BR /&gt;    &lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;rollout setm2 "Set Value by Slider"&lt;BR /&gt;(&lt;BR /&gt;    slider sld_set "Set m" range:&lt;BR /&gt;    on sld_set changed value do&lt;BR /&gt;    (m = sld_set.value)&lt;BR /&gt;)&lt;BR /&gt;nf = newRolloutFloater "m Value" 200 170&lt;BR /&gt;addRollout setm nf&lt;BR /&gt;addRollout setm2 nf&lt;BR /&gt;)&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;With the floater, when one rollout is rolled up the other rollouts will "tighten up" the spacing, whereas a subRollout will claim a fixed amount of space whether it's rolled up or not.</description>
      <pubDate>Mon, 21 Jan 2008 23:08:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/nested-rollout-questions-2/m-p/3967413#M27979</guid>
      <dc:creator>bhnh</dc:creator>
      <dc:date>2008-01-21T23:08:01Z</dc:date>
    </item>
  </channel>
</rss>

