0

I'm trying to register input variables by extending the scene type using the following line of code:

import bpy
from bpy.props import IntProperty

bpy.types.Scene.myInt = IntProperty(name = "Int Name", default_value = 2)

Which works, but this gets removed every time I save and reload the blender file. How can I make it persistent?

Chris
  • 59,454
  • 6
  • 30
  • 84
user116656
  • 15
  • 4
  • You need to transform your script into an addon an register it as a regular addon – Gorgious Feb 24 '23 at 12:50
  • I did that, but it's still not registering permanently. myInt will have to be defined again on the next load. – user116656 Feb 24 '23 at 20:22
  • Could you add your final code to the question so we can take a look and see how to make it work ? – Gorgious Feb 25 '23 at 10:20
  • Got it, thank you. I found this post:

    https://blender.stackexchange.com/questions/235572/what-handler-should-i-use-to-run-code-when-a-new-file-is-loaded/237154#237154

    – user116656 Feb 26 '23 at 06:52

0 Answers0