Notifications
Clear all

[Closed] [help] modifier parameters

Ok lets start with my problem…

i want to make a script , it get a object (pickbutton) and i can change the proprieties from the some modifier (meshsmooth) becouse when you work with many objects who use meshsmooth … is unceptable to change one-on-one of the objets…

ok lets to code

rollout unnamedRollout “Untitled” width:578 height:212

(

label lbl1 “Ms Controler” pos:[14,6] width:62 height:15

pickButton pickbtn “Pick Object” pos:[4,25] width:83 height:24

groupBox grp1 “” pos:[97,19] width:263 height:35 enabled:true

checkbox chk1 “On” pos:[102,29] width:33 height:15

editText nameobjt “” pos:[137,27] width:109 height:18 enabled:false

label lbl3 “Iterations:” pos:[253,29] width:57 height:19

spinner spn1 “” pos:[309,28] width:36 height:16 type:#integer

on pickbtn picked obj do (

master = obj

nameobjt.text = obj.name

nameobj = obj.name

chk1.checked = true

thestate = true

return obj

)

on spn1 changed obj1 do (

obj = nameobjt.text

obj.meshsmooth.iterations = spn1.value

)

)

CreateDialog unnamedRollout width:370 height:212

My problem is in the spn1 … when you run … and pick a object , who have modifier aplly, and change the iterations spinner i got this error “Unknow property: “Meshsmooth” in “Box01” “
the image can explain better then my english lol

how can i fix this?

ps: sorry about my english!

cheers

1 Reply

this may works,
I dont like the style you program. sometimes use global vars.
init your vals, try to guess errors in your script and handle them.
try, catch, if, else if… commands.

You MUST reconstruct your program design.

rollout unnamedRollout “Untitled” width:578 height:212

(

label lbl1 “Ms Controler” pos:[14,6] width:62 height:15

pickButton pickbtn “Pick Object” pos:[4,25] width:83 height:24

groupBox grp1 “” pos:[97,19] width:263 height:35 enabled:true

checkbox chk1 “On” pos:[102,29] width:33 height:15

editText nameobjt “” pos:[137,27] width:109 height:18 enabled:false

label lbl3 “Iterations:” pos:[253,29] width:57 height:19

spinner spn1 “” pos:[309,28] width:36 height:16 type:#integer

on pickbtn picked obj do

(

global master = obj

nameobjt.text = obj.name

–nameobj = obj.name //dont understand?

chk1.checked = true

thestate = true

return obj

)

on spn1 changed val do

(

master.meshsmooth.iterations = val

)

)

CreateDialog unnamedRollout width:370 height:212

Didnt want to change your code. OK?