Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk 3ds® Max® / MaxScript / Scripted attributes and Rollout Creator
  RSS 2.0 ATOM  

Scripted attributes and Rollout Creator
Rate this thread
 
51385
 
Permlink of this thread  
avatar
  • Total Posts: 10
  • Joined: 20 July 2009 11:54 AM

Hi there,

I’m using rolloutCreator to generate a dynamic rollout, update it when you click on a button, etc.

Everything works fine when I use that rollout in a rolloutFloater, I juste need to set up a few variables in global scope.

Then I can just delete and add again the rollout once it’s updated by the rolloutCreator.

The problem comes when I try to do the same in a Scripted Attribute, as the rollouts are defined directly in the attribute and the functions addRollout and removeRollout can only act on the local rollouts.

I’ll put a little dumb example of how it works in a rolloutFloater :

global countBtn 1
(
 
fn refreshRoll n =
 (
 
rolloutCreator "interactiveRF" "interactiveRF"
 
r.begin()
 for 
1 to n do
 (
 
r.addControl #button (("btn"+(i as string)) as name) ("Button "+(i as string))
 
)
 
r.end()
 )

 
rollout staticRF "Static"
 
(
 
button btnAdd "Add Button!"
 
 
on btnAdd pressed do
 (
 
countBtn += 1
 removeRollout interactiveRF rf
 refreshRoll countBtn
 addRollout interactiveRF rf
 
)
 
 )

 
refreshRoll countBtn

 rf 
newRolloutFloater "RF" 200 200
 addRollout staticRF rf
 addRollout interactiveRF rf
)

So this works fine but I don’t manage to get the same thing in a scripted attribute…

Anyone has an idea ?



Replies: 0