PDA

View Full Version : update one rollout from another


displaced
01-25-2008, 10:41 AM
I've created a tool for importing proxy objects.

so i have one button to bring up the open dialog to select a file which then puts the file name into a text box then a second button which creates a second dialog with the list of objects within that file.

now when you double click an object the dialog destroys but i cant get the name of the select object out of that dialog.

It wont populate the text field with its name on the first rollout.

Heres snipets of my code


global proxyfile = ""

global newproxyobject = 0

global obj_names = #()



rollout anewone "Select Proxy Object"
(

listbox lbx_objects "Objects:"





on lbx_objects doubleclicked itm do

(

newproxyobject = itm

destroydialog anewone

applyproxyobject

)



)

--SCRIPT-----------------------------------------------------------------------------------------------

rollout Ran_pro "Random Productizer" width:225 height:420

(

--LAYOUT--------------------------------------------------------------------------------------------------



GroupBox grp1 "Materials" pos:[4,51] width:215 height:121









GroupBox grp3 "" pos:[1,268] width:222 height:82



Label rm_label3 "Proxy Filename" pos:[5,275]

edittext et_proxyfilename "" pos:[1,290] width:160 height:20 readonly: true

button but_loadproxyfile "..." pos:[165,290] width:20 height:20



Label rm_label4 "Proxy Objectname" pos:[5,310]

edittext et_proxyobjectname "" pos:[1,325] width:160 height:20 readonly: true

button but_loadproxyobject "..." pos:[165,325] width:20 height:20



button but_applyproxy "A" pos:[190,290] width:25 height:55 enabled:false images:#(getdir #maxroot+"ui/icons/ran_pro/apply.jpg", undefined, 1, 1, 1, 1, 1) tooltip:"Apply Proxy Object to selection"



on but_loadproxyfile pressed do

(

proxyfile = (getopenfilename caption:"Select the Proxy file" filename:"P:\\something\\" types:"MAX FILES(*.max)")

--et_proxyfilepath.text = proxyfile

et_proxyfilename.text = (getfilenamefile proxyfile)

)



on but_loadproxyobject pressed do

(

if (proxyfile != "") then

(

createdialog anewone width:280

obj_names = (getmaxfileobjectnames proxyfile)

anewone.lbx_objects.items = obj_names

)



)



Ive read a few post about prefixing varialbes with the rollout name name.variable etc but that didnt seem to help.


any help would be great.

Colin

dutch_delight
01-25-2008, 12:54 PM
not sure if im with you here but would this work?

rollout anewone "Select Proxy Object"
(
listbox lbx_objects "Objects:" items:obj_names
on lbx_objects doubleclicked itm do
(
newproxyobject = itm
destroydialog anewone
applyproxyobject(obj_names[itm])
)
)

displaced
01-25-2008, 03:13 PM
Cheers Mate i think that did the trick I had to adjust the function to carry a parameter but yeah its working now.


Thanks again..

CGTalk Moderation
01-25-2008, 03:13 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.