using mdiifier subsurf on mesh >

1
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

ob1=bpy.context.object
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

bpy.ops.object.modifier_add(type='SUBSURF')

or my preferred method

  
mod = object.modifiers.new("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 !

strange

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 !

http://blenderartists.org/forum/showthread.php?t=205444&page=2

also when is this command working
mod.update

Thanks