- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have been trying to create a rollout whose height is based on the number of objects selected by the user. The objects selected are displayed in a multilistbox and below that are 3 buttons. The line of maxscript that specifies the height of the rollout is:
-- Create the rollout with a dynamic height value that adjusts to the initial selection set count
rollout Isolate_Plus "Isolate Plus" width:180 height:(selection.count * 16 + 130)
When I run the script from the script editor (using Evaluate Line Selection) I get exactly what I want, the rollout scales appropriately based on the number of selected objects. However, when I run the same script as a macro in a menu, the size does not scale and the box is greatly truncated and the 3 buttons are not available (see below).
It appears that the first part of the height term, (i.e., “selection.count * 16” ) is recognized by the script editor as I want, but is evaluated differently (i.e., ignored) when max loads the macro at start up.
So my questions are:
- Why and how exactly is the script evaluation by Max different in the Script Editor window vs the max startup/macro load process?
- Is there a simpler and better way to scale the height of a rollout based on the number of selected objects displayed in a multilistbox on a rollout?
Any help would be appreciated.
Solved! Go to Solution.