[Closed] Autosmooth and threshold
Hi, I’m having a little problem with my script:
(
button btn2 "Smooth" pos:[10,55] width:130 height:20 (working ok)
)
on btn2 pressed do
(
addmodifier $ (smooth ()) ui:on - (So far ok)
$.modifiers[#Smooth].autosmooth = on - (Problem:-- Unknown property: "modifiers" in $selection)
$.modifiers[#Smooth].threshold = 45
)
I think I’m supposed to change the “$” to some other value, but I not really sure which one. I’m trying to select a different number of objects and apply the smooth modifier with those values working as instance.
Hi Marcogfaria
I think you have forgotten to create your smooth modifier before applying the addmodifier fuction.
It would look something like…
SmoothMod = smooth() – variable containing our new smooth modifier
addModifier $ SmoothMod – add smooth mod to our selection.
or alternatively you can skip the variable step by using this function instead
modpanel.addModToSelection smooth() – add smooth modifier via the modifier tab
Also if you use the first method you can declare the modifier’s properties simultaneously rather than performing additional lines to make adjustments. this would look something like this…
smoothmod = smooth autosmooth:true threshold: 90 – add modifier and set properties simultaneously
the first method is easier and can help make your screat shorter and easier to read. if you only to use it once or twice the later may be more useful.
hope this helps. I’m no pro or anything
You should use selection[1] instead of $ if you are using only 1 object.
This is because if your object is instanced, $ might grab the wrong instance and apply things unexpectedly. In this case it might be ok though.