Previous Thread  Next Thread

chat icon 'module' object has no attribute 'ops' or 'context'

noblunder

Posted: Fri Aug 10, 2012 11:37 pm
Joined: 12 Sep 2011
Posts: 9
i'm on ubuntu maverick (10.10), blender 2.49b, Python 2.6.5 -- a total noob to this

I have "import bpy" at the top of my script. Some bpy methods and properties work for me (e.g., "bpy.data.objects["Cube"]" )

but any code I execute with

bpy.ops....
and
bpy.context....

leads to errors:

AttributeError: 'module' object has no attribute 'ops'
AttributeError: 'module' object has no attribute 'context'

What am I doing wrong??

TIA
Reply with quote


stiv

Posted: Sat Aug 11, 2012 2:49 am
Joined: 05 Aug 2003
Posts: 3491
You are trying to run new blender code on old blender.
You need the docs for the 2.49 API.

hint: import Blender as B is your friend.

hint: dir(some_module) will show you what is in it.
Reply with quote


 
Jump to:  
Powered by phpBB © 2001, 2005 phpBB Group