5

I have a few properties created like:

bpy.types.Scene.myprop = bpy.props.IntProperty(name="Myprop",default=1)

I want to save their values to a text file but don't know how to extract the actual value (saving just myprop saves all object data instead of just the int value). How to get the actual value?

Val
  • 395
  • 1
  • 6
  • 14

1 Answers1

6

You can access using bpy.context.scene likes this: print(bpy.context.scene.myprop) or set it equal to a variable: value = bpy.context.scene.myprop, also in your post, make sure you have IntProperty not InProperty like you currently have.

BlendingJake
  • 2,557
  • 1
  • 23
  • 38
  • 1
    Yep, using bpy.context.scene instead of bpy.types.Scene did the trick for me. Thx! – Val Oct 23 '14 at 13:23