5
$\begingroup$

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?

$\endgroup$
5
$\begingroup$

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.

$\endgroup$
  • 1
    $\begingroup$ Yep, using bpy.context.scene instead of bpy.types.Scene did the trick for me. Thx! $\endgroup$ – Val Oct 23 '14 at 13:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.