Maxscript: How to access UI controls that are defined later inside other groups in a rollout (Scripted plug-in)

StackOverflow https://stackoverflow.com/questions/9416211

  •  12-11-2019
  •  | 
  •  

سؤال

I have a simpleObject scripted plug-in where I define a parameters block and its associated rollout:

rollout mainParamsRollout "Main Properties"
(
    group "Group1"
    (
        dropdownlist ddl1 "ddl1" items:#("A", "B") height:4
        on ddl1  selected i do
        (
            ddl2.enabled = false    
        )
    )

    group "Group2"
    (
        dropdownlist ddl2 "ddl2" items:#("C", "D") height:4
    )   
)

When I try to make ddl2 disabled after a certain selection happens on ddl1, maxscript throws an exception saying that ddl2 is undefined.

I know it is possible to access ddl2 though mainParamsRollout.controls[5] but I am wondering if there is a better way. I have tried defining a local variable at the top of the scripted plugin as:

local ddl2

to make it available anywhere but this does not seem to work either. Any ideas? Thanks

لا يوجد حل صحيح

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top