API change - simple script help

here is the error



Traceback (most recent call last):
  File "/Users/waylow/iAnimate/Semester 1/Week1/untitled.blend/Text", line 24, in draw
AttributeError: 'NoneType' object has no attribute 'data'

line 24, is the line we are talking about
I don’t understand why it is working for you

Weird…

maybe try replacing that line with

body.prop(context.active_object.modifiers['Subsurf'], "show_viewport", toggle=True ,text="Subsurf")

but it will only work if the object you want to toggle is selected which kind of defeats the purpose of having a button to set visibility.

yeah - that works but yes it won’t work for my situation need this to show when the armature is selected

is this a bug? if it works for you?

I posted it on the bug tracker – it seems that bpy is being imported as None on OSX for some odd reason.

The trials & tribulations of beta software…

Hopefully it’ll be fixed soon.

–edit–

Maybe trying context.scene.objects[“Cube”] will work

ahh - thanks

this might have been a bug for a while, as this is why I tried to separate this as an operator in the first place

guess I’m stuck till the bug is squashed

this bug has been fixed now - if anybody is following

The shortend script for subsurf of the cube works nicely!
SVN 34223 (W 32 Vista) :wink: