using mdiifier subsurf on mesh >

i got some old commands that work may months ago and not working now
can someone heltp to amke this again in lastest version lik 34484

subsurf = ob1.modifiers[‘Subsurf’] # Apply Subsurf modifier
subsurf.levels = 3
bpy.ops.object.modifier_apply(apply_as=‘DATA’, modifier=“Subsurf”)

something is missing here
i can see in console report the subsurf applied
but not done on the object
but it’s not being applied and i cannot see it the toop panel as a modifier

so what is missing here to make it work ok

Thanks and happy 2.5

Don’t think this line matches the comment… It gets the already assigned modifier named Subsurf.

subsurf = ob1.modifiers[‘Subsurf’] # Apply Subsurf modifier

To add the new modifier use something like this


or my preferred method

mod ="yournameformodifier","SUBSURF")
mod.levels = 3

If it already has the modifier the code works fine for me… well in r34454 …

yes but i can see it in teport console seems ok there but not done on objet !


let me find this old script and be back may be it’s not really working !

here is link for this scriptbut may be your right it does not work also there
there is the smooth which seems to be applied
subsurf is executed but not shown in the properties panel tool panel
which is very strange !

also when is this command working